/* ──────────────────────────────────────────────────────────────
   Foreclosure AI — Design System v2
   High-end real-estate investment platform aesthetic.
   Deep navy base + emerald accent + gold premium touches.
   ────────────────────────────────────────────────────────────── */

:root {
  /* Base palette */
  --bg-deep:      #0a0f1c;
  --bg-panel:    #111827;
  --bg-panel-2:  #151d2e;
  --bg-elevated: #1a2439;
  --bg-input:    #0d1422;

  /* Hairline borders */
  --border:       rgba(255, 255, 255, 0.06);
  --border-strong:rgba(255, 255, 255, 0.12);
  --border-focus: rgba(16, 185, 129, 0.5);

  /* Accent: emerald (value, growth, green-light) */
  --accent:       #10b981;
  --accent-light: #34d399;
  --accent-dark:  #059669;
  --accent-soft:  rgba(16, 185, 129, 0.12);

  /* Premium gold (secondary, reserved for prestige touches) */
  --gold:        #c9a066;
  --gold-light:  #e0ba82;
  --gold-soft:   rgba(201, 160, 102, 0.14);

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  /* Grades (real-estate specific) */
  --grade-a: #10b981;
  --grade-b: #f59e0b;
  --grade-c: #94a3b8;
  --grade-d: #ef4444;

  /* Text */
  --text-1: #f8fafc;       /* primary */
  --text-2: #cbd5e1;       /* secondary */
  --text-3: #94a3b8;       /* muted */
  --text-4: #64748b;       /* faint */

  /* Effects */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow:    0 4px 16px -4px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 40px -8px rgba(0,0,0,0.45);
  --shadow-emerald: 0 8px 32px -8px rgba(16,185,129,0.35);

  /* Layout */
  --nav-h: 64px;
}

/* ───── Reset (scoped, does NOT use global *) ───── */
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote {
  margin: 0;
}
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-deep);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  line-height: 1.55;
}

/* ───── Brand tokens ───── */
.brand {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-weight: 700; font-size: 20px; letter-spacing: -0.015em;
  color: var(--text-1);
  text-decoration: none;
}
.brand .brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  position: relative;
  display: inline-block;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(16,185,129,0.3), 0 4px 12px -2px rgba(16,185,129,0.3);
}
.brand .brand-mark::after {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 10px; height: 10px; border: 2px solid #061816;
  border-radius: 2px; border-top: none; border-right: none;
}
.brand-sub {
  display: block;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--gold);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
}

/* ───── Auth layout ───── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}
@media (min-width: 1024px) {
  .auth-shell { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

/* Left: brand panel (desktop only) */
.auth-narrative {
  display: none;
  position: relative;
  padding: 56px 64px;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(16,185,129,0.12), transparent 50%),
    linear-gradient(160deg, #0c1324 0%, #0a0f1c 70%);
  flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
@media (min-width: 1024px) { .auth-narrative { display: flex; } }

.auth-narrative::before, .auth-narrative::after {
  content: ''; position: absolute; left: 0; right: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(201,160,102,0.35), transparent);
}
.auth-narrative::before { top: 0; }
.auth-narrative::after  { bottom: 0; opacity: 0.5; }

.auth-narrative .dots {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: radial-gradient(circle at 1px 1px, #c9a066 1px, transparent 0);
  background-size: 28px 28px;
}

.auth-hero-title {
  font-size: 36px; font-weight: 300; letter-spacing: -0.02em;
  line-height: 1.2; color: var(--text-1);
  position: relative; z-index: 1;
}
.auth-hero-title strong { font-weight: 500; color: var(--accent-light); }
.auth-hero-title::before {
  content: ''; display: block; width: 40px; height: 1px;
  background: var(--gold); margin-bottom: 28px;
}

.auth-hero-sub {
  margin-top: 20px; font-size: 14px; color: var(--text-3); line-height: 1.7;
  max-width: 380px; position: relative; z-index: 1;
}

.auth-stats {
  display: flex; gap: 40px; margin-top: 56px;
  position: relative; z-index: 1;
}
.auth-stat-num {
  font-size: 28px; font-weight: 300; color: var(--text-1); letter-spacing: -0.02em;
}
.auth-stat-num strong { color: var(--accent-light); font-weight: 400; }
.auth-stat-label {
  font-size: 11px; color: var(--text-4); margin-top: 4px;
  letter-spacing: 0.12em; text-transform: uppercase;
}

.auth-tagline {
  display: flex; align-items: center; gap: 24px;
  font-size: 11px; color: var(--text-4);
  letter-spacing: 0.28em; text-transform: uppercase; font-weight: 500;
  position: relative; z-index: 1;
}
.auth-tagline span.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); opacity: 0.7; }

/* Right: form panel */
.auth-form-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px;
  position: relative;
}
.auth-form-card {
  width: 100%; max-width: 400px;
  animation: auth-fade-in 0.5s ease-out both;
}
@keyframes auth-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-form-card .mobile-brand {
  display: block; text-align: center; margin-bottom: 48px; padding-top: 8px;
}
@media (min-width: 1024px) { .auth-form-card .mobile-brand { display: none; } }

.auth-h1 {
  font-size: 24px; font-weight: 600; letter-spacing: -0.015em;
  color: var(--text-1); margin-bottom: 8px;
}
.auth-sub {
  font-size: 14px; color: var(--text-3); margin-bottom: 40px;
}

/* Form fields */
.field { margin-bottom: 20px; }
.field-label {
  display: block; font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-4); margin-bottom: 10px;
}
.field-input {
  width: 100%; padding: 12px 0;
  background: transparent;
  border: none; border-bottom: 1px solid var(--border-strong);
  color: var(--text-1); font-size: 15px;
  outline: none; transition: border-color 0.2s;
  font-family: inherit;
}
.field-input::placeholder { color: var(--text-4); }
.field-input:focus { border-bottom-color: var(--accent); }
.field-hint { font-size: 11px; color: var(--text-4); margin-top: 6px; }

/* Message (error / success / info) */
.message {
  font-size: 13px; padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 2px solid;
  display: none;
  margin-top: 4px;
}
.message.error   { color: #fecaca; border-color: #ef4444; background: rgba(239,68,68,0.08); }
.message.success { color: #bbf7d0; border-color: var(--accent); background: var(--accent-soft); }
.message.info    { color: #dbeafe; border-color: var(--info); background: rgba(59,130,246,0.1); }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none; border-radius: var(--radius);
  color: #062620; font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer; transition: all 0.2s ease;
  box-shadow: var(--shadow-emerald);
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -6px rgba(16,185,129,0.45); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.btn-ghost {
  background: transparent; color: var(--text-2); border: 1px solid var(--border-strong);
  box-shadow: none;
}
.btn.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: var(--accent); color: var(--text-1); }

/* Spinner */
.spin {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}
.spin-lg { width: 36px; height: 36px; border-width: 3px; border-top-color: var(--accent); border-color: rgba(255,255,255,0.1); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Secondary footer */
.auth-footer {
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.auth-footer a, .auth-footer button.linklike {
  color: var(--text-3); text-decoration: none; transition: color 0.15s;
  background: none; border: none; cursor: pointer; padding: 0; font: inherit;
}
.auth-footer a:hover, .auth-footer button.linklike:hover { color: var(--accent-light); }

.auth-tiny-note {
  margin-top: 32px; font-size: 11px; color: var(--text-4);
  text-align: center; line-height: 1.7;
}

/* ───── Lang toggle (top-right) ───── */
.lang-toggle {
  position: absolute; top: 20px; right: 20px; z-index: 10;
  padding: 6px 12px; font-size: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-strong);
  border-radius: 6px; color: var(--text-2);
  cursor: pointer; transition: all 0.15s;
  font-family: inherit;
}
.lang-toggle:hover { background: rgba(255,255,255,0.08); color: var(--text-1); }

/* ───── Utility: verify-email centered card ───── */
.verify-card {
  width: 100%; max-width: 420px; text-align: center;
  padding: 48px 40px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.verify-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; margin-bottom: 20px;
  font-size: 28px; font-weight: 700;
}
.verify-icon.success { background: var(--accent-soft); color: var(--accent-light); }
.verify-icon.error   { background: rgba(239,68,68,0.1); color: #fca5a5; }
