/* ============================================================
   auth.css – Login, Register, Forgot & Reset Password pages
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #3B82F6;
  --primary-dk: #1D4ED8;
  --success:    #10B981;
  --danger:     #EF4444;
  --warning:    #F59E0B;
  --text:       #1E293B;
  --muted:      #64748B;
  --border:     #E2E8F0;
  --bg:         #F1F5F9;
  --radius:     12px;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ---- Two-column auth layout (login & register) ------------- */
.auth-page {
  display: flex;
  min-height: 100vh;
}

/* ---- Left panel -------------------------------------------- */
.auth-left {
  width: 420px;
  flex-shrink: 0;
  background: linear-gradient(160deg, #1D4ED8 0%, #3B82F6 50%, #06B6D4 100%);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
}
.auth-brand h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.auth-tagline h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
}
.auth-tagline p {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.85;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-item {
  font-size: 14px;
  opacity: 0.9;
  background: rgba(255,255,255,0.1);
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
}

/* ---- Right panel ------------------------------------------- */
.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 64, 175, 0.75) 100%),
              url('../images/class.png') center/cover no-repeat;
  background-attachment: fixed;
}

/* ---- Card -------------------------------------------------- */
.auth-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 36px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.2);
}
.auth-card-wide { max-width: 540px; }

.auth-card-header {
  text-align: center;
  margin-bottom: 28px;
}
.auth-card-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.auth-card-header p {
  font-size: 13px;
  color: var(--muted);
}
.auth-card-header a { color: var(--primary); text-decoration: none; }
.auth-card-header a:hover { text-decoration: underline; }

.welcome-after-signup {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
}
.welcome-after-signup h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text);
}
.welcome-after-signup p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}
.welcome-after-signup .welcome-features {
  display: grid;
  gap: 8px;
}
.welcome-after-signup .welcome-features div {
  font-size: 14px;
  color: var(--text);
}

.auth-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #EFF6FF;
  color: var(--primary);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

/* ---- Centered layout (forgot/reset) ----------------------- */
.auth-page-center {
  align-items: center;
  justify-content: center;
}

/* ---- Alerts ----------------------------------------------- */
.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.alert > div { margin-bottom: 2px; }
.alert > div:last-child { margin-bottom: 0; }
.alert-danger  { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-info    { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ---- Forms ------------------------------------------------- */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-group input::placeholder { color: #94A3B8; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.label-row label { margin-bottom: 0; }
.forgot-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

.optional {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

/* ---- Input with icon -------------------------------------- */
.input-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon input {
  padding-left: 36px;
}
.input-icon-symbol {
  position: absolute;
  left: 11px;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.toggle-pw {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  padding: 0;
}
.toggle-pw:hover { text-decoration: underline; }

/* ---- Password strength ------------------------------------ */
.pw-strength {
  font-size: 11px;
  font-weight: 600;
  margin-top: 5px;
  min-height: 16px;
}

/* ---- Role selector ---------------------------------------- */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.role-option {
  cursor: pointer;
}
.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.role-option-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  background: #fff;
  text-align: center;
}
.role-icon { font-size: 22px; }
.role-option input:checked + .role-option-inner {
  border-color: var(--primary);
  background: #EFF6FF;
  color: var(--primary);
}
.role-option:hover .role-option-inner {
  border-color: #93C5FD;
  background: #F8FAFF;
}

/* ---- Buttons ---------------------------------------------- */
.btn-auth {
  display: block;
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
  font-family: inherit;
  margin-top: 4px;
}
.btn-auth:hover { background: var(--primary-dk, #1D4ED8); }

.btn-auth-outline {
  display: block;
  width: 100%;
  padding: 11px;
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-auth-outline:hover { background: #EFF6FF; }

/* ---- Divider ---------------------------------------------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Terms ------------------------------------------------- */
.terms-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.5;
}
.terms-note a { color: var(--primary); text-decoration: none; }
.terms-note a:hover { text-decoration: underline; }

/* ---- Back link -------------------------------------------- */
.auth-back-link {
  text-align: center;
  margin-top: 18px;
}
.auth-back-link a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.auth-back-link a:hover { color: var(--primary); }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 860px) {
  .auth-left { display: none; }
  .auth-right { padding: 24px 16px; }
}
@media (max-width: 480px) {
  .auth-card { padding: 24px 18px; }
  .form-row { grid-template-columns: 1fr; }
  .role-selector { grid-template-columns: 1fr 1fr; }
}

/* ---- Extra additions for register v2 --------------------- */
.required { color: #EF4444; font-size: 13px; }
.form-hint { font-size: 11px; color: #94A3B8; margin-top: 4px; line-height: 1.4; }
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
}
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ── Multi-step reset progress ──────────────────────────────── */
.reset-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}
.reset-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E2E8F0;
    color: #94A3B8;
    font-size: 14px;
    font-weight: 700;
    justify-content: center;
    position: relative;
    transition: all .2s;
    flex-shrink: 0;
}
.reset-step span {
    position: absolute;
    top: 46px;
    font-size: 10px;
    font-weight: 500;
    color: #94A3B8;
    white-space: nowrap;
}
.reset-step.active {
    background: var(--primary);
    color: #fff;
}
.reset-step.active span { color: var(--primary); }
.reset-step-line {
    flex: 1;
    height: 2px;
    background: #E2E8F0;
    max-width: 60px;
}

/* ── Security question display box ─────────────────────────── */
.security-question-box {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #1E40AF;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ── Form section labels (register steps) ─────────────── */
.form-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #3B82F6;
  background: #EFF6FF;
  border-left: 3px solid #3B82F6;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  margin: 20px 0 14px;
}
.field-note {
  font-size: 11px;
  font-weight: 400;
  color: #94A3B8;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Step indicator (forgot-password) ─────────────────── */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 24px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #94A3B8;
  min-width: 72px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  transition: all .2s;
}
.step.active .step-num {
  background: #3B82F6;
  color: #fff;
}
.step.done .step-num {
  background: #10B981;
  color: #fff;
}
.step.active { color: #3B82F6; font-weight: 600; }
.step.done   { color: #10B981; }
.step-line {
  flex: 1;
  height: 2px;
  background: #E2E8F0;
  margin-bottom: 14px;
}

/* ── Security question display box ────────────────────── */
.security-question-display {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.sq-label {
  font-size: 11px;
  font-weight: 600;
  color: #065F46;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.sq-text {
  font-size: 14px;
  color: #1E293B;
  font-weight: 500;
}

/* ---- Registration wizard page styles -------------------- */
.wizard-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: #fff;
}

.wizard-header {
  padding: 24px 40px 0;
  flex-shrink: 0;
  max-width: 560px;
  width: 100%;
  align-self: center;
}

.wizard-title {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.wizard-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.wizard-sub a { color: var(--primary); text-decoration: none; font-weight: 600; }
.wizard-sub a:hover { text-decoration: underline; }

.step-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.step-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.3s;
  font-family: 'Outfit', sans-serif;
}

.step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

.step-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.step-label.active { color: var(--primary); }
.step-label.done { color: var(--success); }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 18px;
  transition: background 0.3s;
}

.step-line.done { background: var(--success); }

.wizard-body {
  padding: 20px 40px 28px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wizard-body > form {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.step-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.step-panel.active {
  display: flex;
  animation: fadeUp 0.25s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.step-panel-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.45;
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0;
  flex: 1;
}

.role-option { display: flex; flex-direction: column; }
.role-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.role-option-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: #F8FAFF;
  text-align: center;
}

.role-option-inner:hover {
  border-color: var(--primary);
  background: #EFF6FF;
}

.role-option input:checked + .role-option-inner {
  border-color: var(--primary);
  background: #EFF6FF;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.role-icon { font-size: 26px; line-height: 1; }
.role-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.role-option input:checked + .role-option-inner .role-name { color: var(--primary); }

.input-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

.input-wrap input.has-prefix { padding-left: 30px; }
.input-wrap input.has-suffix { padding-right: 56px; }

.toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  padding: 2px 4px;
  letter-spacing: 0.3px;
}

.strength-track {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}

.strength-seg {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--border);
  transition: background 0.25s;
}

.strength-label {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  min-height: 15px;
  color: #94A3B8;
}

.seg-weak { background: #EF4444; }
.seg-fair { background: #F59E0B; }
.seg-good { background: #3B82F6; }
.seg-strong { background: #10B981; }
.label-weak { color: #DC2626; }
.label-fair { color: #D97706; }
.label-good { color: #2563EB; }
.label-strong { color: #059669; }

.wizard-nav {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  align-items: center;
}

.btn-back {
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}

.btn-back:hover { border-color: var(--primary); color: var(--primary); background: #EFF6FF; }

.btn-next {
  flex: 1;
  padding: 11px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.2px;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-next:hover { background: var(--primary-dk); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.25); }
.btn-next:active { transform: none; box-shadow: none; }

.btn-submit {
  flex: 1;
  padding: 11px 20px;
  background: linear-gradient(135deg, #10B981, #0D9488);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(5,150,105,0.3); }

@media (max-width: 900px) {
  .auth-page { position: static; height: auto; min-height: 100vh; flex-direction: column; overflow: visible; }
  .auth-left { display: none; }
  .auth-right { height: auto; min-height: 100vh; }
  .wizard-card { border-left: none; min-height: 100vh; }
  .wizard-header { padding: 20px 20px 0; max-width: 100%; }
  .wizard-body { padding: 16px 20px 20px; overflow: visible; align-items: stretch; flex: unset; min-height: unset; }
  .wizard-body > form { max-width: 100%; flex: unset; }
  .step-panel { flex: unset; min-height: unset; }
  .wizard-nav { margin-top: 16px; padding-top: 0; }
}

@media (max-width: 480px) {
  .role-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .step-label { display: none; }
}
