/* ============================================================
   LearnBooster — Authentication Pages
   Layered on top of Bootstrap 5
   ============================================================ */

/* --- Design Tokens ---------------------------------------- */
:root {
  --lb-navy:        #16233A;
  --lb-dark-navy:   #0F1B2E;
  --lb-coral:       #FF6B4A;
  --lb-coral-hover: #e55a3a;
  --lb-coral-light: #FFF0EB;
  --lb-green:       #22C55E;
  --lb-blue:        #3B82F6;
  --lb-warning:     #F59E0B;
  --lb-danger:      #EF4444;
  --lb-bg:          #F4F6F9;
  --lb-white:       #FFFFFF;
  --lb-text:        #16233A;
  --lb-text-muted:  #6B7280;
  --lb-border:      #E5E7EB;
  --lb-radius:      10px;
  --lb-radius-lg:   16px;
  --lb-shadow:      0 8px 30px rgba(0,0,0,.10);
  --lb-transition:  all .2s ease;
}

/* --- Base -------------------------------------------------- */
body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  background-color: var(--lb-bg);
  color: var(--lb-text);
  min-height: 100vh;
}

/* --- Full-page auth wrapper -------------------------------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
}

/* --- Left branding panel ---------------------------------- */
.auth-panel {
  display: none;
  width: 420px;
  flex-shrink: 0;
  background: linear-gradient(160deg, var(--lb-navy) 0%, var(--lb-dark-navy) 100%);
  color: #fff;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

/* subtle dot-grid overlay */
.auth-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.auth-panel-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.auth-panel-logo {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 56px;
  letter-spacing: -.3px;
}

.auth-panel-logo span { color: var(--lb-coral); }

.auth-panel h2 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 14px;
}

.auth-panel p {
  font-size: 15px;
  opacity: .80;
  line-height: 1.7;
  margin-bottom: 48px;
}

.auth-feature-list { list-style: none; padding: 0; margin: 0; }

.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  margin-bottom: 20px;
  opacity: .90;
}

.auth-feature-list li .feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lb-coral);
  flex-shrink: 0;
}

/* --- Right form area -------------------------------------- */
.auth-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}

/* --- Card -------------------------------------------------- */
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--lb-white);
  border-radius: var(--lb-radius-lg);
  padding: 48px 44px;
  box-shadow: var(--lb-shadow);
}

/* --- Logo inside card ------------------------------------- */
.auth-card-logo {
  text-align: center;
  margin-bottom: 28px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--lb-navy);
  text-decoration: none;
  display: block;
}

.auth-card-logo span { color: var(--lb-coral); }

/* --- Headings --------------------------------------------- */
.auth-heading {
  font-size: 24px;
  font-weight: 600;
  color: var(--lb-text);
  text-align: center;
  margin-bottom: 6px;
}

.auth-subheading {
  font-size: 14px;
  color: var(--lb-text-muted);
  text-align: center;
  margin-bottom: 28px;
}

/* --- Form controls ---------------------------------------- */
.lb-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--lb-text);
  margin-bottom: 6px;
  display: block;
}

.lb-label .req { color: var(--lb-coral); }

.lb-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--lb-text);
  background: #fff;
  border: 1.5px solid var(--lb-border);
  border-radius: var(--lb-radius);
  outline: none;
  transition: var(--lb-transition);
  line-height: 1.5;
}

.lb-input::placeholder { color: #b0b7c3; }

.lb-input:focus {
  border-color: var(--lb-coral);
  box-shadow: 0 0 0 3px rgba(255,107,74,.12);
}

.lb-input.is-invalid {
  border-color: var(--lb-danger);
}

.lb-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

.lb-field-error {
  font-size: 12.5px;
  color: var(--lb-danger);
  margin-top: 5px;
}

/* --- Password wrapper ------------------------------------- */
.lb-password-wrap { position: relative; }

.lb-password-wrap .lb-input { padding-right: 46px; }

.lb-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #9ca3af;
  line-height: 0;
  transition: color .15s;
}

.lb-pw-toggle:hover { color: var(--lb-text-muted); }

/* --- Password strength ------------------------------------ */
.lb-strength {
  margin-top: 8px;
}

.lb-strength-bar {
  height: 4px;
  background: var(--lb-border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 5px;
}

.lb-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}

.lb-strength-fill.weak   { width: 25%; background: var(--lb-danger);  }
.lb-strength-fill.fair   { width: 50%; background: var(--lb-warning); }
.lb-strength-fill.good   { width: 75%; background: var(--lb-blue);    }
.lb-strength-fill.strong { width:100%; background: var(--lb-green);   }

.lb-strength-label {
  font-size: 12px;
  color: var(--lb-text-muted);
}

.lb-strength-label.weak   { color: var(--lb-danger);  }
.lb-strength-label.fair   { color: var(--lb-warning); }
.lb-strength-label.good   { color: var(--lb-blue);    }
.lb-strength-label.strong { color: var(--lb-green);   }

/* --- Alerts ----------------------------------------------- */
.lb-alert {
  padding: 12px 16px;
  border-radius: var(--lb-radius);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.lb-alert ul { margin: 0; padding-left: 18px; }

.lb-alert-danger  { background:#fee2e2; color:#991b1b; border-color:#fca5a5; }
.lb-alert-success { background:#dcfce7; color:#166534; border-color:#86efac; }
.lb-alert-info    { background:#dbeafe; color:#1e40af; border-color:#93c5fd; }
.lb-alert-warning { background:#fef3c7; color:#92400e; border-color:#fcd34d; }

/* --- Primary button --------------------------------------- */
.lb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--lb-radius);
  cursor: pointer;
  transition: var(--lb-transition);
  text-decoration: none;
  gap: 8px;
  position: relative;
}

.lb-btn:disabled { opacity: .7; cursor: not-allowed; }

.lb-btn-primary {
  background: var(--lb-coral);
  color: #fff;
}

.lb-btn-primary:hover:not(:disabled) {
  background: var(--lb-coral-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255,107,74,.30);
  color: #fff;
}

.lb-btn-primary:active:not(:disabled) { transform: translateY(0); }

.lb-btn-outline {
  background: transparent;
  color: var(--lb-text);
  border: 1.5px solid var(--lb-border);
}

.lb-btn-outline:hover:not(:disabled) {
  border-color: var(--lb-navy);
  background: var(--lb-navy);
  color: #fff;
}

/* Loading spinner inside button */
.lb-btn-loading { color: transparent !important; }

.lb-btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lb-spin .6s linear infinite;
}

.lb-btn-outline.lb-btn-loading::after {
  border-color: rgba(22,35,58,.25);
  border-top-color: var(--lb-navy);
}

@keyframes lb-spin { to { transform: rotate(360deg); } }

/* --- Checkbox --------------------------------------------- */
.lb-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--lb-text-muted);
  line-height: 1.5;
}

.lb-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--lb-coral);
  cursor: pointer;
  flex-shrink: 0;
}

.lb-check-label a {
  color: var(--lb-coral);
  text-decoration: none;
}

.lb-check-label a:hover { text-decoration: underline; }

/* --- Divider links ---------------------------------------- */
.auth-footer-links {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--lb-border);
  font-size: 13.5px;
  color: var(--lb-text-muted);
}

.auth-footer-links a {
  color: var(--lb-coral);
  font-weight: 500;
  text-decoration: none;
}

.auth-footer-links a:hover { text-decoration: underline; }

.auth-meta-links {
  text-align: center;
  margin-top: 18px;
  font-size: 12.5px;
  color: #b0b7c3;
}

.auth-meta-links a {
  color: #9ca3af;
  text-decoration: none;
  margin: 0 6px;
}

.auth-meta-links a:hover { color: var(--lb-coral); }

/* --- Verification code inputs ----------------------------- */
.lb-code-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.lb-code-input {
  width: 52px;
  height: 58px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 1.5px solid var(--lb-border);
  border-radius: var(--lb-radius);
  outline: none;
  transition: var(--lb-transition);
  color: var(--lb-navy);
  font-family: inherit;
}

.lb-code-input:focus {
  border-color: var(--lb-coral);
  box-shadow: 0 0 0 3px rgba(255,107,74,.12);
}

.lb-code-input.is-invalid { border-color: var(--lb-danger); }

/* --- Progress steps --------------------------------------- */
.lb-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  gap: 0;
}

.lb-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lb-border);
  color: #9ca3af;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--lb-transition);
  flex-shrink: 0;
}

.lb-step-num.active    { background: var(--lb-coral);  color: #fff; }
.lb-step-num.completed { background: var(--lb-green);  color: #fff; }

.lb-step-line {
  width: 48px;
  height: 2px;
  background: var(--lb-border);
  transition: background .3s;
}

.lb-step-line.completed { background: var(--lb-green); }

/* --- Exam card grid --------------------------------------- */
.lb-exam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.lb-exam-card {
  padding: 18px 14px;
  border: 1.5px solid var(--lb-border);
  border-radius: var(--lb-radius);
  cursor: pointer;
  transition: var(--lb-transition);
  text-align: center;
}

.lb-exam-card:hover {
  border-color: var(--lb-navy);
  background: #f8f9fb;
}

.lb-exam-card.selected {
  border-color: var(--lb-coral);
  background: var(--lb-coral-light);
}

.lb-exam-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--lb-text);
  margin-bottom: 4px;
}

.lb-exam-card p {
  font-size: 11px;
  color: var(--lb-text-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* --- Subject list ----------------------------------------- */
.lb-subject-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1.5px solid var(--lb-border);
  border-radius: var(--lb-radius);
  margin-bottom: 14px;
}

.lb-subject-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--lb-border);
  cursor: pointer;
  transition: background .15s;
}

.lb-subject-item:last-child { border-bottom: none; }

.lb-subject-item:hover { background: #f8f9fb; }

.lb-subject-item.selected { background: var(--lb-coral-light); }

.lb-subject-item input[type="checkbox"] {
  accent-color: var(--lb-coral);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.lb-subject-item label {
  font-size: 14px;
  font-weight: 500;
  color: var(--lb-text);
  cursor: pointer;
  flex: 1;
  margin: 0;
}

/* --- Success state ---------------------------------------- */
.lb-success-box {
  text-align: center;
  padding: 20px 0;
}

.lb-success-icon {
  width: 72px;
  height: 72px;
  background: var(--lb-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: lb-pop .3s ease;
}

@keyframes lb-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* --- Error state (suspended / invalid token) -------------- */
.lb-error-box {
  text-align: center;
  padding: 20px 0;
}

.lb-error-icon {
  width: 72px;
  height: 72px;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: var(--lb-danger);
}

/* --- Remember me / inline row ----------------------------- */
.lb-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 13.5px;
}

.lb-link-muted {
  color: var(--lb-coral);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
}

.lb-link-muted:hover { text-decoration: underline; }

/* --- Resend cooldown section ------------------------------ */
.lb-resend-section {
  text-align: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--lb-border);
  font-size: 13.5px;
  color: var(--lb-text-muted);
}

.lb-resend-section p { margin-bottom: 10px; }

.lb-resend-timer strong { color: var(--lb-navy); }

/* --- Fade-in animation ------------------------------------ */
.lb-fade-in {
  animation: lb-fade .3s ease;
}

@keyframes lb-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* --- Responsive ------------------------------------------ */
@media (min-width: 1024px) {
  .auth-panel { display: flex; flex-direction: column; }
}

@media (max-width: 576px) {
  .auth-card {
    padding: 32px 20px;
    border-radius: 12px;
  }

  .lb-code-input {
    width: 42px;
    height: 50px;
    font-size: 18px;
  }

  .lb-exam-grid { grid-template-columns: 1fr; }
}
