/* ═══════════════════════════════════════════════════════════
   VEXTALEARN — Shared form component library.
   Originally auth-only, now also loaded on the Become Instructor
   application form so both surfaces share one .vx-form-* input/
   button system instead of duplicating it. Consumes the shared
   design tokens defined in main.css (:root) — no colors, radii,
   or shadows are redefined here.
   ═══════════════════════════════════════════════════════════ */

body.auth-body {
  background:
    radial-gradient(1200px 480px at 50% -120px, rgba(109,56,232,.07), transparent 60%),
    var(--surface);
}

/* ─── Page / Card shell ──────────────────────────────────── */
.vx-auth-page {
  min-height: calc(100vh - 280px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px 56px;
}

.vx-auth-page .container {
  display: flex;
  justify-content: center;
}

.vx-auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
}

.vx-auth-card--wide { max-width: 540px; }

/* ─── Header ─────────────────────────────────────────────── */
.vx-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.vx-auth-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 10px 26px rgba(109,56,232,.30);
}

.vx-auth-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.vx-auth-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ─── Form fields ────────────────────────────────────────── */
.vx-form-group { margin-bottom: 20px; }

.vx-form-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.vx-form-label .vx-form-label-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.vx-form-label .vx-form-label-link:hover { text-decoration: underline; }

.vx-form-input-wrapper { position: relative; }

.vx-form-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.vx-form-input-wrapper:focus-within .vx-form-icon { color: var(--primary); }

.vx-form-input {
  width: 100%;
  height: 54px;
  padding: 0 16px 0 46px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
}

textarea.vx-form-input { height: auto; padding-top: 14px; padding-bottom: 14px; }

.vx-form-input::placeholder { color: var(--text-muted); opacity: 1; }

.vx-form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(109,56,232,.12);
}

.vx-form-input[type="password"] { padding-right: 48px; }

.vx-form-input.is-invalid { border-color: var(--danger); }
.vx-form-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(239,68,68,.12); }

.vx-form-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
}
.vx-form-toggle:hover { color: var(--primary); background: var(--primary-light); }
.vx-form-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.vx-form-error,
.vx-form-success,
.vx-form-help {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  margin-top: 7px;
}
.vx-form-error { color: var(--danger); font-weight: 500; }
.vx-form-success { color: var(--success); font-weight: 500; }
.vx-form-help { color: var(--text-muted); }

.vx-form-actions { margin-top: 28px; }

/* ─── Primary button ─────────────────────────────────────── */
.vx-primary-button {
  width: 100%;
  height: 54px;
  background: var(--gradient-brand);
  background-size: 160% 160%;
  background-position: 0% 50%;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 22px rgba(109,56,232,.32);
  transition: var(--transition), background-position 0.4s ease;
  cursor: pointer;
}
.vx-primary-button:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow: 0 12px 28px rgba(23,163,232,.35);
  color: #fff;
}
.vx-primary-button:active { transform: translateY(0); }
.vx-primary-button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.vx-primary-button:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }

/* ─── Checkbox ───────────────────────────────────────────── */
.vx-auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.vx-auth-checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.vx-auth-checkbox label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}
.vx-auth-checkbox a { color: var(--primary); font-weight: 600; }

/* ─── Form section grouping (Register: Account Details /
   Security / Optional). Subtle by design — a small uppercase
   label plus a hairline rule above every section after the
   first, not a heavy card-within-a-card. ─────────────────── */
.vx-form-section + .vx-form-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.vx-form-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ─── Divider ────────────────────────────────────────────── */
.vx-auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.vx-auth-divider::before,
.vx-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Status pages (verify-email, reset-email-sent, success,
   expired, etc.) — big icon + message + stacked actions,
   replacing what used to be popups/modals. ─────────────────── */
.vx-status-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  color: #fff;
}
.vx-status-icon--success { background: var(--success); box-shadow: 0 10px 26px rgba(16,185,129,.30); }
.vx-status-icon--info { background: var(--gradient-brand); box-shadow: 0 10px 26px rgba(109,56,232,.30); }
.vx-status-icon--warning { background: var(--danger); box-shadow: 0 10px 26px rgba(239,68,68,.25); }

.vx-status-message {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 30px;
}
.vx-status-message strong { color: var(--text-primary, #1a1a2e); }

.vx-status-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── Secondary (outline) button — used alongside .vx-primary-button
   on status pages, e.g. "Resend Verification Email". ───────────── */
.vx-secondary-button {
  width: 100%;
  height: 54px;
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.vx-secondary-button:hover {
  border-color: var(--primary);
  background: rgba(109,56,232,.05);
  color: var(--primary);
}
.vx-secondary-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── Footer link ────────────────────────────────────────── */
.vx-auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.vx-auth-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.vx-auth-footer a:hover { text-decoration: underline; }

/* ─── Password strength meter ───────────────────────────────
   Container gets a modifier class (vx-strength-weak/fair/good/strong)
   set by JS in main.js; the bar fill + label color follow purely
   from CSS so the JS only ever toggles one className. */
.vx-strength-meter { margin-top: 9px; }
.vx-strength-bars { display: flex; gap: 5px; margin-bottom: 5px; }
.vx-strength-bars span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.25s ease;
}
.vx-strength-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }

.vx-strength-weak .vx-strength-bars span:nth-child(1) { background: var(--danger); }
.vx-strength-weak .vx-strength-label { color: var(--danger); }

.vx-strength-fair .vx-strength-bars span:nth-child(-n+2) { background: var(--warning); }
.vx-strength-fair .vx-strength-label { color: var(--warning); }

.vx-strength-good .vx-strength-bars span:nth-child(-n+3) { background: #3B82F6; }
.vx-strength-good .vx-strength-label { color: #3B82F6; }

.vx-strength-strong .vx-strength-bars span { background: var(--success); }
.vx-strength-strong .vx-strength-label { color: var(--success); }

/* ─── Referral / info banner (register page) ────────────── */
.vx-auth-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .vx-auth-page { padding: 32px 14px 48px; }
  .vx-auth-card { padding: 30px 22px; border-radius: 20px; }
  .vx-auth-title { font-size: 1.4rem; }
  .vx-auth-logo { width: 52px; height: 52px; border-radius: 15px; font-size: 1.4rem; }
  .vx-form-input { height: 52px; }
  .vx-primary-button { height: 52px; }
}
