/* ============================================================
   ExamPilot AI — Auth Pages Styles (Signup / Verify / Login)
   Matches welcome.css: Linear-inspired premium dark theme
   ============================================================ */

:root {
  --bg: #08090a;
  --panel: #0f1011;
  --surface: #191a1b;
  --surface-2: #28282c;
  --text-1: #f7f8f8;
  --text-2: #d0d6e0;
  --text-3: #8a8f98;
  --text-4: #62666d;
  --brand: #5e6ad2;
  --accent: #7170ff;
  --accent-hover: #828fff;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --green: #27a644;
  --emerald: #10b981;
  --red: #f87171;
  --radius: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

body {
  font-family: var(--font);
  font-feature-settings: 'cv01', 'ss03';
  background: var(--bg);
  color: var(--text-2);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
}

::selection { background: rgba(113, 112, 255, 0.3); color: #fff; }

/* ---------- Ambient background (shared with welcome) ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 30%, transparent 75%);
  pointer-events: none;
}

#vanta-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Auth shell (split screen) ---------- */
.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
}

/* --- Left brand panel --- */
.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  background: rgba(15, 16, 17, 0.6);
  border-right: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  width: fit-content;
}

.auth-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(113, 112, 255, 0.35);
}

.auth-brand-mark svg { width: 18px; height: 18px; }

.auth-brand-text {
  color: var(--text-1);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.auth-brand-text span { color: var(--accent); }

.auth-copy { margin: 48px 0; }

.auth-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.auth-copy h1 {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: var(--text-1);
  margin-bottom: 16px;
}

.auth-copy p {
  font-size: 15px;
  color: var(--text-3);
  line-height: 1.65;
  max-width: 420px;
}

.auth-highlights {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-highlight {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 110px;
}

.auth-highlight strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.auth-highlight span {
  font-size: 12px;
  color: var(--text-4);
}

/* --- Right form panel --- */
.auth-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card-inner {
  width: 100%;
  max-width: 420px;
}

.auth-card-heading { margin-bottom: 32px; }

.auth-card-heading h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin-bottom: 8px;
}

.auth-card-heading span {
  font-size: 14px;
  color: var(--text-3);
}

/* ---------- Form fields ---------- */
.auth-form { display: flex; flex-direction: column; gap: 20px; }

.field-group { display: flex; flex-direction: column; gap: 8px; }

.field-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.field-group input {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-group input::placeholder { color: var(--text-4); }

.field-group select.select-input {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
}

.field-group select.select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(113, 112, 255, 0.15);
}

.field-group select.select-input option {
  background: var(--surface);
  color: var(--text-1);
}

.field-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(113, 112, 255, 0.15);
}

.field-group input.invalid {
  border-color: rgba(248, 113, 113, 0.6);
}

.field-hint {
  font-size: 12px;
  color: var(--text-4);
}

.field-hint.error { color: var(--red); }
.field-hint.ok { color: var(--emerald); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  border: none;
  font-feature-settings: 'cv01', 'ss03';
  width: 100%;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 4px 20px rgba(94, 106, 210, 0.25);
}

.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-2);
  border: 1px solid rgb(36, 40, 44);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-1); }

/* ---------- Alerts ---------- */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.alert.show { display: block; }

.alert-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* ---------- reCAPTCHA placeholder ---------- */
.recaptcha-wrap { display: flex; flex-direction: column; gap: 8px; }

.recaptcha-placeholder {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-4);
  background: rgba(255, 255, 255, 0.01);
}

/* ---------- Switch link ---------- */
.switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

.switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.switch a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- Verify OTP specific ---------- */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.otp-inputs input {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  padding: 14px 0;
  letter-spacing: 0.1em;
}

.resend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resend-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  padding: 4px 0;
  text-decoration: none;
}

.resend-btn:hover { color: var(--accent-hover); text-decoration: underline; }

.resend-btn:disabled {
  color: var(--text-4);
  cursor: not-allowed;
  text-decoration: none;
}

.countdown {
  font-size: 12px;
  color: var(--text-4);
  font-family: var(--mono);
}

.verify-steps {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.verify-step {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.verify-step span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.verify-step strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 24px; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .auth-copy { margin: 32px 0; }
  .auth-copy h1 { font-size: 28px; }
  .auth-card { padding: 32px 24px; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .auth-highlights { flex-direction: column; }
}
