@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
@import url('components/buttons.css');

* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

:root {
   --color-primary: #024173;
   --color-primary-light: #035a9e;
   --color-primary-dark: #012a4a;
   --color-secondary: #C8A451;
   --color-secondary-light: #D9B661;
   
   /* Button component variables */
   --c-primary: var(--color-primary);
   --c-success: #16a34a;
   --c-danger: #dc2626;
   --c-warning: #d97706;
   --c-white: #ffffff;
   --c-bg-muted: #f8fafc;
   --c-text-secondary: #64748b;
   --c-border-light: #e2e8f0;
   --c-border-medium: #cbd5e1;
   --c-gold: var(--color-secondary);
   --c-gold-dark: var(--color-secondary-light);
   
   /* Layout variables */
   --radius-sm: 4px;
   --radius-md: 8px;
   --radius-lg: 12px;
   --transition-normal: 0.2s ease;
   
   /* Legacy aliases for compatibility */
   --scpc-green: var(--color-secondary);
   --scpc-navy: var(--color-primary);
}

body {
   max-width: 100%;
   font-family: 'Inter', sans-serif;
   background: #f5f5f5;
   min-height: 100vh;
}

.public-layout {
   height: 100dvh;
}

.login-container {
   max-width: 100%;
   display: flex;
   min-height: 100vh;
   align-items: stretch;
}

/* Left Side - Admin Branding */
.branding-section {
   flex: 1;
   min-height: 100vh;
   background: linear-gradient(135deg, var(--scpc-navy) 0%, #2d5a87 100%);
   padding: 60px;
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center;
   position: relative;
   overflow: hidden;
   color: white;
}

.branding-section::before {
   content: '';
   position: absolute;
   top: -50%;
   right: -50%;
   width: 100%;
   height: 100%;
   background: radial-gradient(circle, rgba(22, 163, 74, 0.15) 0%, transparent 70%);
   animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

   0%,
   100% {
      transform: scale(1);
      opacity: 0.5;
   }

   50% {
      transform: scale(1.2);
      opacity: 0.8;
   }
}

.branding-content {
   position: relative;
   z-index: 2;
   max-width: 500px;
   text-align: center;
}

.logo-section {
   margin-bottom: 40px;
}

.logo-circle {
   width: 100px;
   height: 100px;
   background: var(--scpc-green);
   border-radius: 50%;
   display: flex;
   align-items: center;
   justify-content: center;
   margin: 0 auto 20px;
   box-shadow: 0 10px 30px rgba(22, 163, 74, 0.3);
   animation: float 3s ease-in-out infinite;
}

@keyframes float {

   0%,
   100% {
      transform: translateY(0px);
   }

   50% {
      transform: translateY(-10px);
   }
}

.logo-circle svg {
   width: 50px;
   height: 50px;
   fill: white;
}

.branding-content h1 {
   font-size: 32px;
   font-weight: 800;
   margin-bottom: 10px;
   letter-spacing: -0.5px;
}

.branding-content .subtitle {
   font-size: 16px;
   color: var(--scpc-green);
   font-weight: 600;
   margin-bottom: 30px;
   text-transform: uppercase;
   letter-spacing: 2px;
}

.mission-statement {
   font-size: 18px;
   line-height: 1.6;
   margin-bottom: 40px;
   opacity: 0.9;
   font-style: italic;
}

.admin-features {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   gap: 20px;
   margin-top: 40px;
}

.feature-card {
   background: rgba(255, 255, 255, 0.1);
   backdrop-filter: blur(10px);
   border: 1px solid rgba(255, 255, 255, 0.2);
   border-radius: 12px;
   padding: 20px;
   text-align: center;
   transition: all 0.3s ease;
}

.feature-card:hover {
   background: rgba(255, 255, 255, 0.15);
   transform: translateY(-5px);
}

.feature-card svg {
   width: 32px;
   height: 32px;
   fill: var(--scpc-green);
   margin-bottom: 10px;
}

.feature-card h3 {
   font-size: 14px;
   font-weight: 600;
   margin-bottom: 5px;
}

.feature-card p {
   font-size: 12px;
   opacity: 0.8;
}

/* Right Side - Login Form */
.form-section {
   flex: 1;
   padding: 60px;
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center;
   background: white;
   min-height: 100vh;
}

.form-container {
   width: 100%;
   max-width: 450px;
}

.form-header {
   text-align: center;
   margin-bottom: 40px;
}

.admin-badge {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   background: var(--scpc-navy);
   color: white;
   padding: 8px 16px;
   border-radius: 20px;
   font-size: 12px;
   font-weight: 600;
   margin-bottom: 20px;
   text-transform: uppercase;
   letter-spacing: 1px;
}

.admin-badge svg {
   width: 16px;
   height: 16px;
   fill: var(--scpc-green);
}

.form-header h2 {
   font-size: 32px;
   font-weight: 800;
   color: var(--scpc-navy);
   margin-bottom: 10px;
}

.form-header p {
   color: #666;
   font-size: 15px;
}

.form-alert {
   margin: 16px 0 18px;
   padding: 12px 14px;
   border-radius: 10px;
   border: 1px solid rgba(220, 38, 38, 0.35);
   background: rgba(220, 38, 38, 0.08);
   color: #b91c1c;
   font-size: 14px;
   line-height: 1.5;
}

.form-alert strong {
   font-weight: 700;
}

.form-text-action {
   margin-top: 10px;
   text-align: center;
   font-size: 13px;
}

.form-text-action a {
   color: var(--color-primary);
   text-decoration: underline;
   text-underline-offset: 2px;
}

.form-text-action a:hover {
   color: var(--color-primary-light);
}

.login-form {
   margin-top: 30px;
}

.form-group {
   margin-bottom: 24px;
}

.form-group label {
   display: block;
   margin-bottom: 8px;
   color: var(--scpc-navy);
   font-weight: 600;
   font-size: 14px;
}

.input-wrapper {
   position: relative;
}

.helper-text{
   font-size: 14px;
   font-weight: 500;
   color: var(--scpc-navy);
   text-align: center;
}

.input-icon {
   position: absolute;
   left: 16px;
   top: 50%;
   transform: translateY(-50%);
   width: 20px;
   height: 20px;
   fill: var(--scpc-green);
   pointer-events: none;
}

.form-control {
   width: 100%;
   padding: 14px 16px 14px 48px;
   border: 2px solid #e0e0e0;
   border-radius: 10px;
   font-size: 15px;
   font-family: 'Inter', sans-serif;
   transition: all 0.3s ease;
   background: #fafafa;
}

.form-control:focus {
   outline: none;
   border-color: var(--scpc-green);
   background: white;
   box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}

.mfa-setup-section {
   text-align: center;
   margin: 32px 0;
}

.mfa-qr {
   width: 220px;
   height: 220px;
   border-radius: 12px;
   border: 1px solid #e5e7eb;
   padding: 10px;
   background: #fff;
   margin-bottom: 20px;
}

.mfa-secret {
   margin-bottom: 20px;
}

.mfa-secret label {
   display: block;
   font-size: 14px;
   font-weight: 600;
   margin-bottom: 6px;
   color: #1f2933;
}

.mfa-secret input {
   width: 100%;
   padding: 10px 12px;
   border: 1px solid #e5e7eb;
   border-radius: 10px;
   background: #f9fafb;
   font-family: "Inter", sans-serif;
   letter-spacing: 0.1em;
}

.input-with-copy {
   position: relative;
   display: flex;
   align-items: center;
}

.input-with-copy input {
   flex: 1;
   padding-right: 50px; /* Space for button */
}

.copy-btn {
   position: absolute;
   right: 8px;
   top: 50%;
   transform: translateY(-50%);
   background: var(--color-secondary);
   border: none;
   border-radius: 6px;
   padding: 6px;
   cursor: pointer;
   transition: background 0.2s ease;
   display: flex;
   align-items: center;
   justify-content: center;
}

.copy-btn:hover {
   background: var(--color-secondary-light);
}

.copy-btn svg {
   width: 16px;
   height: 16px;
   fill: white;
}

.copy-btn.copied {
   background: #10b981; /* Green for success */
}

.copy-btn.copied svg {
   fill: white;
}

.divider {
   text-align: center;
   color: #6b7280;
   font-size: 13px;
   margin: 12px 0;
}

.backup-codes-section {
   margin: 32px 0;
}

.backup-code-list {
   list-style: none;
   padding: 0;
   margin: 16px 0 24px;
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
   gap: 10px;
}

.backup-code-list li {
   background: #f8fafc;
   border: 1px dashed #cbd5f5;
   padding: 10px 12px;
   border-radius: 8px;
   font-weight: 600;
   text-align: center;
}

.password-toggle {
   position: absolute;
   right: 16px;
   top: 50%;
   transform: translateY(-50%);
   background: none;
   border: none;
   cursor: pointer;
   padding: 4px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.password-toggle svg {
   width: 20px;
   height: 20px;
   fill: var(--scpc-green);
   opacity: 0.7;
   transition: opacity 0.3s ease;
}

.password-toggle:hover svg {
   opacity: 1;
}

.btn-login {
   width: 100%;
   padding: 16px;
   background: #C8A451;
   color: white;
   border: none;
   border-radius: 10px;
   font-size: 12px;
   font-weight: 700;
   font-family: 'Inter', sans-serif;
   cursor: pointer;
   transition: all 0.3s ease;
   text-transform: capitalize;
   letter-spacing: 1px;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 12px;
}

.btn-login .spinner {
   width: 18px;
   height: 18px;
   border-radius: 999px;
   border: 2px solid rgba(255, 255, 255, 0.35);
   border-top-color: #ffffff;
   opacity: 0;
   transition: opacity 0.2s ease;
   pointer-events: none;
}

.btn-login .btn-label {
   display: inline-flex;
   align-items: center;
   gap: 8px;
}

.btn-login.is-loading {
   cursor: wait;
}

.btn-login.is-loading .spinner {
   opacity: 1;
   animation: spinner-rotate 0.75s linear infinite;
}

.btn-login:hover {
   background: #c8a451a4;
   transform: translateY(-2px);
}

.btn-login:active {
   transform: translateY(0);
}

.btn-login:disabled {
   opacity: 0.8;
   pointer-events: none;
}

.btn-login[href] {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   text-decoration: none;
   color: white;
}

@keyframes spinner-rotate {
   to {
      transform: rotate(360deg);
   }
}

.support-link {
   text-align: center;
   margin-top: 30px;
   padding-top: 30px;
   border-top: 1px solid #e0e0e0;
}

.support-link p {
   color: #666;
   font-size: 14px;
}

.support-link a {
   color: var(--scpc-navy);
   text-decoration: none;
   font-weight: 600;
   transition: color 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
   .login-container {
      flex-direction: column;
   }

   .branding-section {
      display: none;
   }

   .form-section {
      padding: 40px 30px;
   }
}

@media (max-width: 576px) {
   .form-section {
      padding: 30px 20px;
   }

   .form-header h2 {
      font-size: 26px;
   }
}

/* Download button styling */
#download-codes {
   width: 100%;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 0.5rem;
   padding: 0.6rem 1rem;
   border-radius: 8px;
   font-size: 0.9rem;
   font-weight: 600;
   font-family: 'Inter', sans-serif;
   cursor: pointer;
   transition: all 0.2s ease;
   border: 1px solid #024173;
   background: transparent;
   color: #024173;
   text-decoration: none;
   white-space: nowrap;
}

#download-codes:hover:not(:disabled) {
   background: #024173;
   color: #fff;
}

#download-codes .btn-icon {
   width: 18px;
   height: 18px;
   flex-shrink: 0;
}

#download-codes .btn-icon svg {
   width: 100%;
   height: 100%;
   fill: #024173;
}

#download-codes:hover:not(:disabled) .btn-icon svg {
   fill: #fff;
}
