/* ============================================================
   BANCOBU — Design System
   ============================================================ */

/* ---- Tokens ---- */
:root {
  /* New editorial palette */
  --paper:      #FAFAFA;
  --paper-2:    #F3F4F6;
  --paper-3:    #E8EAED;
  --ink:        #1A2820;
  --ink-2:      #2A3A30;
  --ink-3:      #4A5A50;
  --muted:      #6F7A70;
  --line:       #D1D5DB;
  --line-soft:  #E5E7EB;
  --terra:      #B5532A;
  --terra-deep: #8E3F1F;
  --forest:     #2D4A2F;
  --gold:       #C89B3C;
  --white:      #FFFFFF;
  --shadow:     0 1px 0 rgba(26,40,32,0.06), 0 18px 40px -28px rgba(26,40,32,0.35);

  /* Typography stacks */
  --serif: "Instrument Serif", "Cormorant Garamond", "Times New Roman", serif;
  --sans:  "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono:  "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Legacy variables kept for dashboard compatibility */
  --primary:       #0052cc;
  --secondary:     #00a859;
  --background:    #f5f7fa;
  --text:          #1a1a1a;
  --danger:        #dc2626;
  --danger-light:  #fef2f2;
  --warning:       #f59e0b;
  --warning-light: #fffbeb;
  --success:       #16a34a;
  --success-light: #f0fdf4;
  --disabled-bg:   #e5e7eb;
  --disabled-fg:   #9ca3af;
  --focus-ring:    rgba(0, 82, 204, .25);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }

/* ---- Shell / container ---- */
.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ============================================================
   Topbar / Navigation
   ============================================================ */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.brand .seal {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  flex-shrink: 0;
}
.brand-stack { display: flex; flex-direction: column; gap: 2px; }
.brand-stack .name { font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--ink); }
.brand-stack .sub {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1;
}

/* Nav links (desktop pill nav) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-links a:hover { background: var(--paper-2); color: var(--ink); }
.nav-links a.active { background: var(--ink); color: var(--paper); }

/* Btn-link for logout inside nav */
.btn-link {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  display: inline-flex;
  align-items: center;
}
.btn-link:hover { background: var(--paper-2); color: var(--ink); }

/* Nav actions (CTA button area) */
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Hamburger toggle (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Language switcher (kept for dashboard compat) */
.lang-switcher { position: relative; margin-left: 4px; }
.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  transition: background .15s, border-color .15s;
}
.lang-switcher__btn:hover,
.lang-switcher__btn[aria-expanded="true"] {
  background: var(--paper-2);
  border-color: var(--line);
}
.lang-switcher__dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 150px;
  z-index: 300;
  overflow: hidden;
}
.lang-switcher__dropdown.open { display: block; }
.lang-switcher__dropdown form { display: flex; flex-direction: column; margin: 0; padding: 4px 0; }
.lang-switcher__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  font-family: inherit;
  transition: background .1s;
}
.lang-switcher__option:hover { background: var(--paper-2); }
.lang-switcher__option--active { color: var(--terra); font-weight: 600; }
.lang-switcher__check { color: var(--terra); font-size: 13px; flex-shrink: 0; }

/* Dashboard topbar override for lang-switcher */
.db-topbar .lang-switcher { margin-left: 0; }
.db-topbar .lang-switcher__btn {
  color: #374151;
  border-color: #d1d5db;
}
.db-topbar .lang-switcher__btn:hover,
.db-topbar .lang-switcher__btn[aria-expanded="true"] {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--sans);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--terra); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn-terra { background: var(--terra); color: var(--white); }
.btn-terra:hover { background: var(--terra-deep); }
.btn-lg { padding: 16px 26px; font-size: 15px; }

.btn .arrow {
  width: 16px; height: 16px;
  transition: transform 0.18s ease;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   Footer
   ============================================================ */

.foot {
  border-top: 1px solid var(--line-soft);
  padding: 56px 0 48px;
  margin-top: 80px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.foot h6 {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 16px;
  color: var(--ink-3);
  font-weight: 500;
}
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 13.5px; }
.foot ul a { color: var(--ink-2); }
.foot ul a:hover { color: var(--terra); }
.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

/* ============================================================
   Form atoms
   ============================================================ */

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.field input, .field select {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input:focus, .field select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(26,40,32,0.08);
}

/* ============================================================
   Shared UI components
   ============================================================ */

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.display { font-family: var(--serif); font-weight: 400; line-height: 0.95; letter-spacing: -0.02em; }
.mono-text { font-family: var(--mono); font-feature-settings: "tnum"; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper-2);
}
.chip .pulse, .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 0 rgba(181,83,42,0.45);
  animation: pulse 2.2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(181,83,42,0.45); }
  100% { box-shadow: 0 0 0 10px rgba(181,83,42,0); }
}

.rule {
  display: flex; align-items: center; gap: 14px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.sec-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 56px;
  align-items: end;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 48px;
}
.sec-head h2 {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 400;
}
.sec-head p { color: var(--ink-3); font-size: 16px; max-width: 46ch; margin: 0; }

/* ============================================================
   Messages / Alerts
   ============================================================ */

.messages-container {
  padding: 16px 0 0;
}
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 8px;
  border-left: 3px solid transparent;
}
.alert.success { background: #f0fdf4; color: #14532d; border-color: var(--secondary); }
.alert.error   { background: #fef2f2; color: #7f1d1d; border-color: var(--danger); border-left-width: 3px; }
.alert.info    { background: #eff6ff; color: #1e3a5f; border-color: var(--primary); }
.alert.warning { background: #fffbeb; color: #78350f; border-color: var(--warning); }

/* ============================================================
   Homepage
   ============================================================ */

/* Hero */
.hero {
  padding: 64px 0 96px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
}
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(64px, 8vw, 124px);
  line-height: 0.9;
  letter-spacing: -0.028em;
  margin: 0;
  font-weight: 400;
}
.hero h1 .italic { font-style: italic; }
.hero h1 .terra { color: var(--terra); }
.hero .lede {
  margin-top: 28px;
  max-width: 48ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
}
.hero-cta { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.hero-meta {
  display: flex;
  gap: 28px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.hero-meta .v {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--ink);
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}

/* Hero ticket card */
.ticket {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
}
.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}
.ticket-head .ref {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.ticket-head .stamp {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--terra);
  transform: rotate(-3deg);
  border: 1.5px solid var(--terra);
  padding: 4px 14px;
  border-radius: 999px;
}
.ticket-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--paper-2);
}
.ticket-row:last-of-type { border-bottom: none; }
.ticket-row .k {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ticket-row .v {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--ink);
  font-weight: 500;
}
.ticket-row .v .unit { color: var(--muted); font-size: 12px; margin-left: 6px; }
.ticket-progress {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}
.ticket-progress .steps {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.ticket-progress .steps span.done { color: var(--terra); }
.ticket-progress .bar { height: 4px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.ticket-progress .bar > i {
  display: block; height: 100%; width: 78%;
  background: linear-gradient(90deg, var(--ink), var(--terra));
  border-radius: 999px;
}
.glyph-stack {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.06;
  font-family: var(--serif);
  font-style: italic;
  font-size: 380px;
  color: var(--ink);
  line-height: 1;
  z-index: 0;
}

/* Marquee strip */
.strip {
  background: var(--ink);
  color: var(--paper);
  border-radius: 200px;
  padding: 22px 40px;
  margin: 48px 0 0;
  overflow: hidden;
}
.strip-track {
  display: flex; gap: 56px;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
  animation: scroll 38s linear infinite;
  align-items: center;
}
.strip-track .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--terra); flex-shrink: 0;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* How it works */
.how { padding: 120px 0 80px; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  overflow: hidden;
}
.step-card {
  background: var(--paper);
  padding: 36px 28px 32px;
  position: relative;
  transition: background 0.25s ease;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.step-card:hover { background: var(--paper-2); }
.step-no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 56px;
  color: var(--terra);
  line-height: 1;
  margin-bottom: 32px;
}
.step-card h3 {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.step-card p { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; margin: 0; }
.step-connector {
  position: absolute; top: 56px; right: -8px;
  width: 16px; height: 2px;
  background: var(--terra);
  z-index: 2;
}
.step-card:last-child .step-connector { display: none; }

/* Why us */
.why { padding: 80px 0; }
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--line-soft);
}
.why-card {
  padding: 48px 0;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: start;
}
.why-card:nth-child(odd)  { padding-right: 56px; border-right: 1px solid var(--line-soft); }
.why-card:nth-child(even) { padding-left: 56px; }
.why-card .ic {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  display: grid; place-items: center;
  color: var(--terra);
}
.why-card h3 {
  font-family: var(--serif);
  font-size: 30px;
  margin: 0 0 10px;
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.why-card p { color: var(--ink-3); font-size: 15px; line-height: 1.55; margin: 0; max-width: 44ch; }

/* CTA band */
.cta-band {
  background: var(--ink);
  color: var(--paper);
  border-radius: 32px;
  padding: 96px 64px;
  margin: 80px 0 0;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: end;
}
.cta-band::before {
  content: "₣";
  position: absolute;
  right: -40px; top: -80px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 520px;
  color: rgba(244,239,227,0.05);
  line-height: 1;
  pointer-events: none;
}
.cta-band .eyebrow { color: var(--terra); margin-bottom: 24px; display: block; }
.cta-band h2 {
  font-family: var(--serif);
  font-size: clamp(56px, 6vw, 92px);
  line-height: 0.94;
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.025em;
  max-width: 14ch;
}
.cta-band h2 em { color: var(--terra); font-style: italic; }
.cta-side { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.cta-side p { color: rgba(244,239,227,0.7); max-width: 36ch; font-size: 15px; margin: 0 0 8px; }
.cta-band .btn-primary { background: var(--paper); color: var(--ink); border: none; }
.cta-band .btn-primary:hover { background: var(--terra); color: var(--paper); }
.cta-band .btn-ghost { border-color: rgba(244,239,227,0.3); color: var(--paper); }
.cta-band .btn-ghost:hover { background: rgba(244,239,227,0.1); border-color: var(--paper); }

/* ============================================================
   Auth — Login (standalone split-pane)
   ============================================================ */

.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.visual {
  background: var(--ink);
  color: var(--paper);
  padding: 40px 56px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.visual::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(181,83,42,0.22), transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(200,155,60,0.12), transparent 55%);
  pointer-events: none;
}
.visual .brand { color: var(--paper); position: relative; z-index: 1; }
.visual .brand .seal { background: var(--paper); color: var(--ink); }
.visual .brand-stack .name { color: var(--paper); }
.visual .brand-stack .sub { color: rgba(244,239,227,0.5); }

.visual-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 38vw;
  line-height: 0.8;
  color: rgba(244,239,227,0.06);
  position: absolute;
  bottom: -8vw; left: -4vw;
  pointer-events: none;
  z-index: 0;
}
.visual-quote { position: relative; z-index: 1; max-width: 36ch; }
.visual-quote .q {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
  font-weight: 400;
}
.visual-quote .q em { color: var(--terra); font-style: italic; }
.visual-quote .sig {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: rgba(244,239,227,0.6);
  padding-top: 18px;
  border-top: 1px solid rgba(244,239,227,0.15);
  display: flex;
  justify-content: space-between;
}
.visual-feat {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(244,239,227,0.15);
}
.visual-feat .item .n {
  font-family: var(--serif);
  font-size: 28px; line-height: 1;
  color: var(--paper);
  display: block; margin-bottom: 6px;
}
.visual-feat .item .l {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.12em;
  color: rgba(244,239,227,0.55);
  text-transform: uppercase;
}
.status-card {
  position: relative; z-index: 1;
  background: rgba(244,239,227,0.06);
  border: 1px solid rgba(244,239,227,0.12);
  border-radius: 16px;
  padding: 20px;
  margin: 32px 0 40px;
}
.status-card .s-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(244,239,227,0.08);
}
.status-card .s-row:last-child { border-bottom: none; padding-bottom: 0; }
.status-card .s-row:first-child { padding-top: 0; }
.status-card .s-row .k {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: rgba(244,239,227,0.55); text-transform: uppercase;
}
.status-card .s-row .v {
  font-family: var(--mono); font-size: 12px;
  color: var(--paper); letter-spacing: 0.04em;
}
.status-card .s-row .v.live::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: #6BAA6B;
  margin-right: 8px;
  box-shadow: 0 0 8px #6BAA6B;
}

/* Form pane (login right side) */
.form-pane {
  padding: 40px 8vw;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.form-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px;
  color: var(--ink-3);
}
.form-top a {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
.form-top a:hover { color: var(--terra); border-color: var(--terra); }
.form-body {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 460px; width: 100%;
  margin: 0 auto;
  padding: 48px 0;
}
.form-body .eyebrow { display: block; margin-bottom: 24px; }
.form-body h1 {
  font-family: var(--serif);
  font-size: 80px; line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 16px; font-weight: 400;
}
.form-body h1 em { font-style: italic; color: var(--terra); }
.form-body .sub { color: var(--ink-3); font-size: 16px; margin: 0 0 40px; }

/* Input row (login form fields) */
.input-row {
  display: flex; align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--white);
  padding: 0 16px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input-row:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(26,40,32,0.08);
}
.input-row .ic { color: var(--ink-3); margin-right: 12px; flex-shrink: 0; }
.input-row input {
  flex: 1; border: none; background: transparent; outline: none;
  padding: 16px 0; font-family: inherit; font-size: 15px; color: var(--ink);
}
.input-row .reveal {
  background: transparent; border: none;
  color: var(--ink-3); font-size: 11px; letter-spacing: 0.1em; cursor: pointer;
  font-family: var(--mono);
}
.input-row .reveal:hover { color: var(--terra); }

.login-form { display: flex; flex-direction: column; gap: 18px; }
.form-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin: 6px 0 18px;
}
.form-meta .check-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-3); cursor: pointer;
}
.check-box {
  width: 16px; height: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  display: grid; place-items: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.form-meta a { color: var(--ink); font-size: 13px; border-bottom: 1px solid var(--line); }
.form-meta a:hover { color: var(--terra); border-color: var(--terra); }
.login-form .btn-primary { justify-content: center; padding: 18px; font-size: 15px; }

.form-foot {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted);
  display: flex; justify-content: space-between;
  letter-spacing: 0.06em;
}

/* Auth field error (reused from old system, adapted) */
.auth-field { display: flex; flex-direction: column; gap: 8px; }
.auth-field--error .input-row {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.auth-field__error { font-size: 12px; color: var(--danger); }
.auth-alert {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  border-left: 4px solid #e53e3e;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #c53030;
}

/* ============================================================
   Auth — Signup (stepper rail)
   ============================================================ */

.signup-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  min-height: calc(100vh - 88px);
  margin: 0 -48px;
}
.rail {
  padding: 56px 48px;
  border-right: 1px solid var(--line-soft);
  background: var(--paper-2);
  display: flex; flex-direction: column; justify-content: space-between;
}
.rail h2 {
  font-family: var(--serif);
  font-size: 44px; line-height: 0.95;
  letter-spacing: -0.02em; font-weight: 400;
  margin: 0 0 12px;
}
.rail h2 em { font-style: italic; color: var(--terra); }
.rail .lede { color: var(--ink-3); font-size: 15px; max-width: 32ch; margin: 0 0 48px; }

.stepper { display: flex; flex-direction: column; gap: 4px; }
.stepper .s-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  position: relative;
}
.stepper .s-step .num {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: transparent;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.04em;
  transition: all 0.2s ease;
}
.stepper .s-step.active .num { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.stepper .s-step.done .num   { background: var(--terra); border-color: var(--terra); color: var(--white); }
.stepper .s-step .meta h4 {
  font-family: var(--sans);
  font-size: 14px; font-weight: 500;
  margin: 4px 0 4px; color: var(--ink);
}
.stepper .s-step .meta p { color: var(--ink-3); font-size: 12.5px; margin: 0; line-height: 1.5; }
.stepper .s-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 14px; top: 44px; bottom: -10px;
  width: 1px; background: var(--line-soft);
}
.stepper .s-step.done:not(:last-child)::before { background: var(--terra); }
.rail-foot {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--ink-3);
}
.rail-foot p { margin: 0 0 10px; }
.rail-foot strong { color: var(--ink); font-weight: 500; }

.form-area {
  padding: 56px 80px 56px;
  background: var(--paper);
  display: flex; flex-direction: column;
}
.form-area-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; color: var(--ink-3);
  margin-bottom: 48px;
}
.form-area-top a { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 1px; }
.form-area-top a:hover { color: var(--terra); border-color: var(--terra); }
.form-area h1 {
  font-family: var(--serif);
  font-size: 76px; line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 16px; font-weight: 400;
}
.form-area h1 em { font-style: italic; color: var(--terra); }
.form-area .sub { color: var(--ink-3); font-size: 16px; max-width: 48ch; margin: 0 0 40px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.form-grid .field.full { grid-column: 1 / -1; }

/* Signup field uses .field atoms but with auth-field error class */
.form-grid .auth-field--error .field input,
.form-grid .auth-field--error .field select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

/* Password strength */
.strength { margin-top: 10px; }
.strength-bars { display: flex; gap: 5px; margin-bottom: 6px; }
.strength-bars span {
  flex: 1; height: 3px;
  background: var(--paper-3);
  border-radius: 999px;
  transition: background 0.25s ease;
}
.strength-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; color: var(--muted);
  text-transform: uppercase;
}

/* Consent checkboxes */
.consent { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 32px; }
.consent-label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px; align-items: start;
  font-size: 13.5px; color: var(--ink-2);
  cursor: pointer; line-height: 1.5;
}
.consent-label input[type=checkbox] { display: none; }
.consent-check {
  width: 16px; height: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  display: grid; place-items: center;
  transition: all 0.18s ease;
  margin-top: 2px;
}
.consent-label input[type=checkbox]:checked + .consent-check {
  background: var(--ink);
  border-color: var(--ink);
}
.consent-label input[type=checkbox]:checked + .consent-check::after {
  content: "";
  width: 9px; height: 5px;
  border-left: 1.5px solid var(--paper);
  border-bottom: 1.5px solid var(--paper);
  transform: rotate(-45deg) translate(1px, -1px);
}
.consent-label a { color: var(--ink); border-bottom: 1px solid var(--line); }
.consent-label a:hover { color: var(--terra); border-color: var(--terra); }

.submit-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.submit-row .small {
  color: var(--muted); font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.06em; max-width: 32ch;
}
.submit-row .btn-primary { padding: 18px 28px; font-size: 15px; }

/* Legacy auth classes kept for backward compatibility */
.auth-container {
  display: flex; justify-content: center; align-items: center;
  min-height: calc(100vh - 64px);
  padding: 32px 16px;
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px 36px;
  border: 1px solid var(--line-soft);
}
.auth-box--wide { max-width: 520px; }
.auth-box__header { text-align: center; margin-bottom: 32px; }
.auth-box__title { font-family: var(--serif); font-size: 32px; font-weight: 400; color: var(--ink); margin: 0 0 6px; }
.auth-box__sub { font-size: 14px; color: var(--ink-3); margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.auth-field__label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.auth-field__label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-field__forgot { font-size: 12px; color: var(--terra); text-decoration: none; }
.auth-field__forgot:hover { text-decoration: underline; }
.auth-field__wrap {
  position: relative; display: flex; align-items: center;
  border: 1px solid var(--line-soft); border-radius: 12px;
  background: var(--white); padding: 0 14px;
  transition: border-color .18s, box-shadow .18s;
}
.auth-field__wrap:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(26,40,32,0.08); }
.auth-field--error .auth-field__wrap { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.auth-field__icon { position: absolute; left: 14px; width: 16px; height: 16px; stroke: var(--muted); pointer-events: none; flex-shrink: 0; }
.auth-field__input {
  width: 100%; padding: 14px 40px 14px 36px;
  border: none; background: transparent; outline: none;
  font-family: var(--sans); font-size: 15px; color: var(--ink);
}
.auth-field__toggle {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  padding: 4px; opacity: .5; transition: opacity .2s;
  display: flex; align-items: center;
}
.auth-field__toggle:hover { opacity: 1; }
.auth-field__toggle svg { width: 16px; height: 16px; stroke: var(--muted); }
.auth-submit {
  width: 100%; padding: 16px;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 999px;
  font-size: 15px; font-weight: 500; cursor: pointer;
  font-family: var(--sans);
  transition: background .18s, transform .15s;
}
.auth-submit:hover { background: var(--terra); }
.auth-submit:disabled { background: var(--disabled-bg); color: var(--disabled-fg); cursor: not-allowed; transform: none; }
.auth-box__footer { text-align: center; font-size: 13px; color: var(--ink-3); margin: 20px 0 0; }
.auth-box__footer a { color: var(--terra); font-weight: 500; text-decoration: none; }
.auth-box__footer a:hover { text-decoration: underline; }

/* ============================================================
   Simulator (new design, public + dashboard embed)
   ============================================================ */

.sim-page { padding: 0; }

.sim-hero-section {
  padding: 56px 0 32px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: end;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
}
.sim-hero-section h1 {
  font-family: var(--serif);
  font-size: clamp(56px, 7vw, 104px);
  line-height: 0.9; letter-spacing: -0.025em;
  margin: 16px 0 0; font-weight: 400;
}
.sim-hero-section h1 em { font-style: italic; color: var(--terra); }
.sim-hero-section .lede { color: var(--ink-3); font-size: 16px; max-width: 38ch; padding-bottom: 8px; margin: 0; }

/* Main app grid */
.sim-app {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  overflow: hidden;
  background: var(--white);
}
.pane-left {
  padding: 48px 48px 56px;
  border-right: 1px solid var(--line-soft);
  background: var(--paper);
}
.pane-right {
  padding: 48px 48px 56px;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.pane-right::before {
  content: "";
  position: absolute; inset: -2px;
  background: radial-gradient(circle at 90% 10%, rgba(181,83,42,0.18), transparent 50%);
  pointer-events: none;
}

.pane-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
}
.pane-head h2 {
  font-family: var(--serif);
  font-size: 26px; margin: 0;
  font-weight: 400; letter-spacing: -0.01em;
}
.pane-right .pane-head { border-color: rgba(244,239,227,0.15); }

/* Type selector buttons */
.type-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 36px;
}
.type-btn {
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 14px 12px;
  text-align: left; cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit; color: var(--ink);
}
.type-btn:hover { border-color: var(--ink-3); }
.type-btn.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.type-btn .t-lbl { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }
.type-btn .t-rate { font-family: var(--mono); font-size: 11px; opacity: 0.7; letter-spacing: 0.06em; }

/* Slider blocks */
.slider-block { margin-bottom: 32px; }
.slider-label {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.slider-label .l {
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500;
}
.slider-label .v {
  font-family: var(--serif);
  font-size: 38px; line-height: 1;
  color: var(--ink); letter-spacing: -0.01em;
}
.slider-label .v .unit {
  font-family: var(--mono); font-size: 13px;
  color: var(--muted); margin-left: 8px; letter-spacing: 0.06em;
}

/* Custom range */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; background: transparent; height: 32px; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 2px; background: var(--line); border-radius: 999px;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--terra); border: 3px solid var(--paper);
  box-shadow: 0 2px 8px rgba(181,83,42,0.4);
  margin-top: -10px; cursor: grab;
}
input[type=range]::-moz-range-track { height: 2px; background: var(--line); border-radius: 999px; }
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--terra); border: 3px solid var(--paper);
  box-shadow: 0 2px 8px rgba(181,83,42,0.4); cursor: grab;
}
.slider-min-max {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); letter-spacing: 0.06em; margin-top: 10px;
}

/* Income grid */
.income-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-top: 8px;
}

/* Results (right pane) */
.big-result {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(244,239,227,0.15);
}
.big-result .label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(244,239,227,0.6); margin-bottom: 16px; display: block;
}
.big-result .amt {
  font-family: var(--serif);
  font-size: 80px; line-height: 0.92;
  letter-spacing: -0.025em; color: var(--paper);
  display: flex; align-items: baseline; gap: 14px;
}
.big-result .amt .unit {
  font-family: var(--mono); font-size: 18px;
  color: var(--terra); letter-spacing: 0.06em;
}
.big-result .sub {
  font-size: 13px; color: rgba(244,239,227,0.55);
  margin-top: 14px; font-family: var(--mono); letter-spacing: 0.06em;
}

.metrics {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(244,239,227,0.15);
  border: 1px solid rgba(244,239,227,0.15);
  border-radius: 16px; overflow: hidden;
}
.metric { padding: 22px 20px; background: var(--ink); }
.metric .l {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(244,239,227,0.55); margin-bottom: 12px;
}
.metric .v {
  font-family: var(--serif);
  font-size: 28px; line-height: 1;
  color: var(--paper); letter-spacing: -0.01em;
}
.metric .v .unit { font-family: var(--mono); font-size: 11px; color: rgba(244,239,227,0.5); margin-left: 6px; letter-spacing: 0.06em; }

/* Debt gauge */
.gauge {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid rgba(244,239,227,0.15);
  border-radius: 16px;
}
.gauge-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
.gauge-head .l { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(244,239,227,0.6); }
.gauge-head .pct { font-family: var(--serif); font-size: 36px; line-height: 1; letter-spacing: -0.01em; }
.gauge-bar {
  height: 6px; background: rgba(244,239,227,0.12);
  border-radius: 999px; overflow: hidden;
  margin-bottom: 14px; position: relative;
}
.gauge-bar .fill { height: 100%; border-radius: 999px; transition: width 0.35s ease, background 0.35s ease; }
.gauge-bar .marker {
  position: absolute; top: -4px; width: 1px; height: 14px;
  background: rgba(244,239,227,0.4);
}
.gauge-bar .marker.m33 { left: 33%; }
.gauge-scale {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px;
  color: rgba(244,239,227,0.5); letter-spacing: 0.06em;
}
.gauge-verdict {
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid rgba(244,239,227,0.12);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: rgba(244,239,227,0.85);
}
.gauge-verdict .pill {
  font-family: var(--mono); font-size: 10px;
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.08em;
}
.gauge-verdict.ok   .pill { background: rgba(107,170,107,0.2); color: #B9E5B9; }
.gauge-verdict.warn .pill { background: rgba(200,155,60,0.25); color: #F2D58A; }
.gauge-verdict.bad  .pill { background: rgba(220,80,60,0.25); color: #F5B6A6; }

/* Pane CTA */
.pane-cta {
  margin-top: 32px; display: flex; flex-direction: column; gap: 12px;
}
.pane-cta .btn-terra { justify-content: center; }
.pane-cta .fineprint {
  text-align: center; font-size: 11px;
  color: rgba(244,239,227,0.45); font-family: var(--mono); letter-spacing: 0.06em; margin-top: 6px;
}

/* Amortization schedule */
.schedule {
  margin-top: 48px; padding: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 24px; background: var(--white);
}
.schedule-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}
.schedule-head h3 {
  font-family: var(--serif); font-size: 28px;
  margin: 0; font-weight: 400; letter-spacing: -0.01em;
  color: var(--ink);
}
.schedule-head p { color: var(--muted); font-size: 13px; margin: 0; }
table.amort {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.amort th, table.amort td {
  text-align: right;
  padding: 12px 14px;
  border-bottom: 1px solid var(--paper-2);
  font-family: var(--mono);
  color: var(--ink);
}
table.amort th {
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
  font-weight: 500;
}
table.amort th:first-child, table.amort td:first-child { text-align: left; }
table.amort tr:last-child td { border-bottom: none; }
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin: 24px 0 0;
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.06em;
}

/* Reassurance band */
.reassure {
  margin-top: 64px; padding: 48px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}
.reassure .item h4 {
  font-family: var(--serif); font-size: 22px;
  margin: 0 0 8px; font-weight: 400; letter-spacing: -0.01em;
  color: var(--ink);
}
.reassure .item p { color: var(--ink-3); font-size: 13.5px; margin: 0; line-height: 1.55; }
.reassure .item .n {
  font-family: var(--mono); font-size: 10px;
  color: var(--terra); letter-spacing: 0.14em;
  margin-bottom: 16px; display: block;
}

/* ============================================================
   Utilities / legacy
   ============================================================ */

.container { max-width: 1000px; margin: auto; padding: 30px; background: transparent; }
.card {
  background: var(--white);
  border-radius: 12px; padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line-soft);
}
.page-header { margin-bottom: 20px; }

.table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
table { width: 100%; background: var(--white); border-radius: 10px; overflow: hidden; min-width: 480px; }
th { background: var(--ink); color: var(--paper); }
td, th { padding: 12px; }

.status { padding: 5px 10px; border-radius: 20px; font-size: 12px; }
.status.draft        { background: #f3f4f6; color: #6b7280; }
.status.submitted    { background: var(--warning-light); color: #92400e; }
.status.under_review { background: #eff6ff; color: #1e40af; }
.status.approved     { background: var(--success-light); color: #14532d; }
.status.rejected     { background: var(--danger-light); color: #7f1d1d; }
.status.needs_info   { background: #fff7ed; color: #7c2d12; }

button:disabled, input[type="submit"]:disabled {
  background: var(--disabled-bg) !important;
  color: var(--disabled-fg) !important;
  border-color: var(--disabled-bg) !important;
  cursor: not-allowed; opacity: 1;
  transform: none !important; box-shadow: none !important;
}

#drop-zone, .drop-zone {
  border: 2px dashed var(--terra);
  padding: 40px; text-align: center;
  border-radius: 10px; cursor: pointer;
  background: var(--paper); margin-bottom: 20px;
  transition: background .2s;
}
#drop-zone.dragover, .drop-zone:hover { background: var(--paper-2); }

#preview-container { margin-bottom: 20px; }
#preview-container img, #preview-container iframe { border-radius: 10px; margin-top: 10px; }

.doc-list { list-style: none; padding: 0; }
.doc-item { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid var(--line-soft); }

.btn-delete {
  background: var(--danger); color: white; border: none;
  padding: 6px 10px; border-radius: 5px; cursor: pointer;
}
.btn-delete:hover { opacity: .85; }

.input { width: 100%; padding: 8px; margin: 10px 0; }

.profile-container { max-width: 800px; margin: auto; }

/* Legacy home buttons (kept in case of cache) */
.home-btn { display: inline-block; padding: 13px 28px; border-radius: 999px; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; transition: opacity .2s, transform .15s; }
.home-btn:hover { opacity: .88; transform: translateY(-1px); }
.home-btn--primary { background: var(--ink); color: var(--paper); }
.home-btn--primary:hover { background: var(--terra); }
.home-btn--outline { background: transparent; border: 2px solid rgba(255,255,255,.7); color: #fff; }
.home-btn--ghost   { background: transparent; border: 2px solid var(--line); color: var(--ink); }
.home-btn--ghost:hover { border-color: var(--ink); background: var(--paper-2); }
.home-btn--lg { padding: 16px 36px; font-size: 16px; }

/* ============================================================
   Dashboard — db-* styles (preserved intact)
   ============================================================ */

.db-body { overflow: hidden; height: 100vh; margin: 0; }
.db-layout { display: flex; height: 100vh; overflow: hidden; }

.db-sidebar {
  width: 260px; flex-shrink: 0;
  background: #0a2540;
  display: flex; flex-direction: column;
  height: 100vh; z-index: 200;
  transition: transform .3s ease;
}
.db-sidebar__header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.db-sidebar__logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff;
  font-size: 17px; font-weight: 800; margin-bottom: 12px;
}
.db-sidebar__logo img { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; }
.db-sidebar__role-badge {
  display: inline-block;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.85);
  font-size: 10px; font-weight: 600;
  padding: 3px 10px; border-radius: 12px;
  text-transform: uppercase; letter-spacing: .8px;
  border: 1px solid rgba(255,255,255,.15);
}
.db-nav {
  flex: 1; padding: 16px 10px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
}
.db-nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: rgba(255,255,255,.65); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.db-nav__link:hover { background: rgba(255,255,255,.08); color: #fff; }
.db-nav__link--active { background: var(--role-accent) !important; color: #fff !important; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.db-nav__icon { width: 18px; height: 18px; flex-shrink: 0; }
.db-nav__section {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: 14px 14px 4px; margin-top: 4px; user-select: none;
}
.db-sidebar__footer {
  padding: 14px 10px; border-top: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.db-logout {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; background: none; border: none; border-radius: 10px;
  color: rgba(255,255,255,.5); font-size: 14px; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.db-logout:hover { background: rgba(229,62,62,.15); color: #fc8181; }

.db-main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.db-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; height: 60px;
  background: #fff; border-bottom: 1px solid #e8ecf0;
  flex-shrink: 0; box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.db-topbar__toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: #555; flex-shrink: 0; }
.db-topbar__toggle svg { width: 22px; height: 22px; stroke: currentColor; }
.db-topbar__title { font-size: 17px; font-weight: 700; color: #0a2540; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-topbar__user { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.db-topbar__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--role-accent); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.db-topbar__name { display: flex; flex-direction: column; line-height: 1.3; }
.db-topbar__name span { font-size: 14px; font-weight: 600; color: #0a2540; }
.db-topbar__name small { font-size: 12px; color: #888; }

.db-messages { padding: 16px 28px 0; }
.db-alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 8px; border-left: 4px solid transparent; }
.db-alert--success { background: #d4f8e4; color: #1a7a45; border-color: #00a859; }
.db-alert--error   { background: #fff5f5; color: #c53030; border-color: #e53e3e; }
.db-alert--info    { background: #ebf4ff; color: #1a56db; border-color: #0052cc; }
.db-alert--warning { background: #fffbeb; color: #92400e; border-color: #f59e0b; }

.db-content { flex: 1; overflow-y: auto; padding: 28px; background: #f0f2f6; }

.db-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.db-stats--2col { grid-template-columns: repeat(2, 1fr); }
.db-stat-card {
  background: #fff; border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  display: flex; align-items: center; gap: 16px;
  border: 1px solid rgba(0,0,0,.05);
}
.db-stat-card__icon-wrap { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.db-stat-card__icon-wrap svg { width: 22px; height: 22px; }
.db-stat-card--primary .db-stat-card__icon-wrap { background: color-mix(in srgb, var(--role-accent) 14%, transparent); }
.db-stat-card--primary .db-stat-card__icon-wrap svg { stroke: var(--role-accent); }
.db-stat-card--warning .db-stat-card__icon-wrap { background: rgba(245,158,11,.12); }
.db-stat-card--warning .db-stat-card__icon-wrap svg { stroke: #d97706; }
.db-stat-card--success .db-stat-card__icon-wrap { background: rgba(0,168,89,.12); }
.db-stat-card--success .db-stat-card__icon-wrap svg { stroke: #00a859; }
.db-stat-card--danger  .db-stat-card__icon-wrap { background: rgba(220,38,38,.10); }
.db-stat-card--danger  .db-stat-card__icon-wrap svg { stroke: #dc2626; }
.db-stat-card--info    .db-stat-card__icon-wrap { background: rgba(0,82,204,.10); }
.db-stat-card--info    .db-stat-card__icon-wrap svg { stroke: #0052cc; }
.db-stat-card--purple  .db-stat-card__icon-wrap { background: rgba(112,72,232,.10); }
.db-stat-card--purple  .db-stat-card__icon-wrap svg { stroke: #7048e8; }
.db-stat-card__value { font-size: 30px; font-weight: 800; color: #0a2540; line-height: 1; margin-bottom: 5px; letter-spacing: -.5px; }
.db-stat-card__label { font-size: 12px; color: #999; font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }

.db-section { margin-bottom: 28px; }
.db-section__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.db-section__title { font-size: 15px; font-weight: 700; color: #1e2d3d; margin: 0 0 12px; letter-spacing: -.1px; }
.db-section__link { font-size: 13px; color: var(--role-accent); text-decoration: none; font-weight: 600; }
.db-section__link:hover { text-decoration: underline; }

.db-card { background: #fff; border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.05); overflow: hidden; }
.db-card__header { padding: 20px 28px 0; border-bottom: 1px solid #f0f0f0; padding-bottom: 16px; margin-bottom: 0; }
.db-card__title { font-size: 16px; font-weight: 700; color: #0a2540; margin: 0 0 4px; }
.db-card__sub { font-size: 13px; color: #6b7280; margin: 0; }

.db-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.db-action-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  border: 2px solid #e5e7eb; color: #374151; background: #f9fafb;
  transition: opacity .2s, transform .15s; cursor: pointer;
}
.db-action-btn:disabled { background: var(--disabled-bg); color: var(--disabled-fg); border-color: var(--disabled-bg); opacity: 1; transform: none; cursor: not-allowed; }
.db-action-btn--primary { background: var(--role-accent); color: #fff; border-color: var(--role-accent); box-shadow: 0 2px 8px color-mix(in srgb, var(--role-accent) 35%, transparent); }
.db-action-btn--primary:hover:not(:disabled) { opacity: 1; background: color-mix(in srgb, var(--role-accent) 85%, #000); box-shadow: 0 4px 14px color-mix(in srgb, var(--role-accent) 45%, transparent); transform: translateY(-2px); }
.db-action-btn--outline { background: color-mix(in srgb, var(--role-accent) 8%, #fff); border-color: color-mix(in srgb, var(--role-accent) 40%, transparent); color: var(--role-accent); }
.db-action-btn--outline:hover:not(:disabled) { opacity: 1; background: color-mix(in srgb, var(--role-accent) 15%, #fff); border-color: var(--role-accent); transform: translateY(-2px); }
.db-action-btn svg { width: 16px; height: 16px; }

.db-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.db-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.db-table th { background: #f8faff; color: #777; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 12px 16px; text-align: left; border-bottom: 1px solid #edf0f5; white-space: nowrap; }
.db-table td { padding: 14px 16px; font-size: 14px; color: #0a2540; border-bottom: 1px solid #f5f7fa; vertical-align: middle; }
.db-table tbody tr:last-child td { border-bottom: none; }
.db-table tbody tr:hover { background: #f8faff; }
.db-table__id   { color: #888; font-size: 13px; }
.db-table__name { display: block; font-weight: 600; }
.db-table__sub  { display: block; font-size: 12px; color: #999; }
.db-table__date { color: #888; font-size: 13px; white-space: nowrap; }
.db-amount { font-weight: 700; }

.db-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.db-badge--draft            { background: #f0f0f0; color: #666; }
.db-badge--submitted        { background: #fff3cd; color: #856404; }
.db-badge--under-review,
.db-badge--under_review     { background: #cce5ff; color: #0052cc; }
.db-badge--needs-info,
.db-badge--needs_info       { background: #ffedd5; color: #c2410c; }
.db-badge--pending-manager,
.db-badge--pending_manager  { background: #ede9fe; color: #6d28d9; }
.db-badge--approved         { background: #d4f8e4; color: #1a7a45; }
.db-badge--rejected         { background: #fff5f5; color: #c53030; }
.db-badge--client   { background: #dbeafe; color: #1d4ed8; }
.db-badge--agent    { background: #dcfce7; color: #15803d; }
.db-badge--manager  { background: #ede9fe; color: #6d28d9; }
.db-badge--owner    { background: #ffedd5; color: #c2410c; }

.db-log-transition { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.db-link-plain { color: var(--role-accent); text-decoration: none; font-weight: 600; }
.db-link-plain:hover { text-decoration: underline; }
.db-link-btn {
  font-size: 13px; font-weight: 600; color: var(--role-accent); text-decoration: none;
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--role-accent);
  transition: background .15s, color .15s; white-space: nowrap;
}
.db-link-btn:hover { background: var(--role-accent); color: #fff; }
.db-link-btn--muted  { color: #9ca3af; border-color: #e5e7eb; }
.db-link-btn--muted:hover  { background: #f3f4f6; color: #374151; }
.db-link-btn--purple { color: #6d28d9; border-color: #6d28d9; }
.db-link-btn--purple:hover { background: #6d28d9; color: #fff; }
.db-link-btn--green  { color: #16a34a; border-color: #16a34a; }
.db-link-btn--green:hover  { background: #16a34a; color: #fff; }
.db-link-btn--red    { color: #dc2626; border-color: #dc2626; }
.db-link-btn--red:hover    { background: #dc2626; color: #fff; }

.db-sla { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.db-sla--ok      { background: #d4f8e4; color: #1a7a45; }
.db-sla--overdue { background: #fff5f5; color: #c53030; }

.db-type-select { font-size: 13px; padding: 4px 8px; border: 1px solid #d0d7de; border-radius: 6px; background: #fff; color: #0a2540; cursor: pointer; height: 32px; }
.db-type-select:focus { outline: 2px solid var(--role-accent); border-color: transparent; }

.db-btn-danger { font-size: 13px; font-weight: 600; color: #dc2626; background: #fff5f5; border: 1px solid #fca5a5; padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.db-btn-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.db-btn-activate { font-size: 13px; font-weight: 600; color: #15803d; background: #f0fdf4; border: 1px solid #86efac; padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.db-btn-activate:hover { background: #15803d; color: #fff; border-color: #15803d; }
.db-btn-ban { font-size: 13px; font-weight: 600; color: #7c3aed; background: #f5f3ff; border: 1px solid #c4b5fd; padding: 5px 12px; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.db-btn-ban:hover { background: #7c3aed; color: #fff; border-color: #7c3aed; }

.db-form p { margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.db-form label { font-size: 13px; font-weight: 600; color: #374151; }
.db-form input[type="text"],
.db-form input[type="email"],
.db-form input[type="number"],
.db-form input[type="date"],
.db-form input[type="password"],
.db-form textarea,
.db-form select {
  width: 100%; padding: 10px 14px;
  border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; color: #0a2540; background: #fff;
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
}
.db-form input:focus, .db-form textarea:focus, .db-form select:focus { outline: none; border-color: var(--role-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--role-accent) 15%, transparent); }
.db-form textarea { resize: vertical; min-height: 100px; }
.db-form .helptext, .db-form ul { font-size: 12px; color: #9ca3af; margin: 4px 0 0; padding-left: 16px; }
.db-form .errorlist { color: #dc2626; font-size: 12px; list-style: none; padding: 0; margin: 4px 0 0; }

.db-empty { text-align: center; padding: 40px 20px; color: #aaa; }
.db-empty svg { width: 40px; height: 40px; display: block; margin: 0 auto 10px; stroke: #ddd; }
.db-empty p { font-size: 14px; margin: 0; }

.db-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150; }
.db-overlay--visible { display: block; }

/* ============================================================
   Interaction states
   ============================================================ */

.btn:active:not(:disabled),
.home-btn:active:not(:disabled),
.db-action-btn:active:not(:disabled),
.db-link-btn:active:not(:disabled),
.db-btn-danger:active:not(:disabled),
.db-btn-activate:active:not(:disabled),
.db-btn-ban:active:not(:disabled),
.auth-submit:active:not(:disabled),
.db-logout:active:not(:disabled) {
  transform: translateY(1px) scale(0.97) !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.12) !important;
}

.btn:focus-visible,
.home-btn:focus-visible,
.auth-submit:focus-visible,
.db-action-btn:focus-visible,
.db-link-btn:focus-visible {
  outline: 3px solid rgba(26,40,32,0.25);
  outline-offset: 2px;
}

.db-link-btn, .db-btn-danger, .db-btn-activate, .db-btn-ban {
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .1s;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
  .signup-grid { margin: 0 -24px; }
}

@media (max-width: 980px) {
  .shell { padding: 0 24px; }
  .hero { grid-template-columns: 1fr; gap: 48px; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .why-card:nth-child(odd)  { padding-right: 0; border-right: none; }
  .why-card:nth-child(even) { padding-left: 0; }
  .cta-band { grid-template-columns: 1fr; padding: 56px 32px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .sec-head { grid-template-columns: 1fr; gap: 24px; }
  .login-wrap { grid-template-columns: 1fr; }
  .visual { padding: 32px 24px; min-height: 360px; }
  .form-pane { padding: 24px; }
  .form-body h1 { font-size: 56px; }
  .visual-quote .q { font-size: 38px; }
  .sim-hero-section { grid-template-columns: 1fr; }
  .sim-app { grid-template-columns: 1fr; }
  .pane-left { border-right: none; border-bottom: 1px solid var(--line-soft); padding: 32px; }
  .pane-right { padding: 32px; }
  .big-result .amt { font-size: 56px; }
  .reassure { grid-template-columns: 1fr; gap: 24px; }
  .signup-grid { grid-template-columns: 1fr; margin: 0; }
  .rail { border-right: none; border-bottom: 1px solid var(--line-soft); padding: 32px 24px; }
  .form-area { padding: 40px 24px; }
  .form-area h1 { font-size: 52px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--ink);
    padding: 16px 24px 24px;
    z-index: 100;
    border-radius: 0 0 16px 16px;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a, .btn-link {
    color: rgba(244,239,227,.85);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    width: 100%;
    border-radius: 0;
  }
  .nav-links a:hover, .btn-link:hover { background: transparent; color: var(--terra); }
  .nav-links .lang-switcher { margin-left: 0; width: 100%; border-top: 1px solid rgba(255,255,255,.07); padding-top: 10px; }
  .nav-links .lang-switcher__btn { color: rgba(244,239,227,.7); border-color: rgba(255,255,255,.2); width: 100%; justify-content: flex-start; padding: 8px 0; border: none; border-radius: 0; }
  .nav-actions { display: none; }

  .db-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); }
  .db-sidebar--open { transform: translateX(0); }
  .db-topbar__toggle { display: flex; }
  .db-topbar { padding: 0 16px; }
  .db-topbar__name { display: none; }
  .db-content { padding: 20px 16px; }
  .db-messages { padding: 12px 16px 0; }
  .db-stats { grid-template-columns: repeat(2, 1fr); }
  .db-stats--2col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .topbar { padding: 16px 0; }
  .hero h1 { font-size: clamp(48px, 12vw, 64px); }
  .strip-track { font-size: 20px; }
  .steps-grid { grid-template-columns: 1fr; }
  .auth-row { grid-template-columns: 1fr; }
  .income-grid { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .db-stats, .db-stats--2col { grid-template-columns: 1fr 1fr; }
  .db-stat-card { padding: 14px; gap: 10px; }
  .db-stat-card__value { font-size: 22px; }
  .db-stat-card__icon-wrap { width: 40px; height: 40px; }
  .db-actions { flex-direction: column; }
  .db-action-btn { width: 100%; justify-content: center; }
}
