/* ==========================================================================
   GEIDA design system
   Follows the Terra learning platform: Outfit, ink on paper, light grey
   bands, square edges, full-bleed photography. IsDB green marks the
   active state; Terra teal carries the dark data band.
   ========================================================================== */
:root {
  --ink: #121114;
  --ink-2: #2A2A2E;
  --muted: #5C5C60;
  --paper: #FFFFFF;
  --sand: #F5F5F5;
  --line: #E4E4E4;
  --teal: #0B3B47;
  --teal-2: #134B59;
  --green: #2F8F4E;
  --gold: #C9A25B;
  --danger: #C62828;

  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 6vw;
  --header-h: 79px;
  --shadow: 0 18px 40px rgba(18, 17, 20, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { margin: 0; min-height: 100vh; font-family: var(--font); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.lucide, [data-lucide] { width: 18px; height: 18px; stroke-width: 1.8; flex: none; }

.wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding: 88px 0; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--teal); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--sand); }
.btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: var(--paper); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.text-link { font-weight: 600; text-decoration: none; box-shadow: inset 0 -2px 0 currentColor; }
.text-link:hover { color: var(--teal); }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 24px; padding: 0 var(--gutter);
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 20px; text-decoration: none; flex: none; }
.mark-isdb { height: 48px; width: auto; }
.mark-rule { width: 1px; height: 34px; background: var(--line); }
.mark-terra { height: 30px; width: auto; }

.primary-nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; height: var(--header-h); padding: 0 10px;
  border: 0; background: none; text-decoration: none; font-size: .95rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
  position: relative;
}
.nav-link::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: transparent; }
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { background: var(--line); }
.nav-link.is-active { color: var(--ink); }
.nav-link.is-active::after { background: var(--green); }
.chev { width: 15px !important; height: 15px !important; transition: transform .15s; }
[aria-expanded="true"] > .chev { transform: rotate(180deg); }

.has-menu { position: relative; }
.menu {
  position: absolute; top: calc(100% + 1px); right: 0; z-index: 60; display: none;
  min-width: 200px; padding: 6px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.menu.is-open { display: block; }
.menu-hub { width: 360px; }
.nav-actions .menu { top: calc(100% + 10px); }
.menu-item {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px 12px;
  border: 0; background: transparent; text-align: left; text-decoration: none; font-size: .95rem; font-weight: 600; color: var(--ink); cursor: pointer;
}
.menu-item:hover, .menu-item.is-active { background: var(--sand); }
.menu-item .lucide, .menu-item [data-lucide] { margin-top: 2px; color: var(--teal); }
.menu-title { display: block; }
.menu-desc { display: block; font-weight: 400; font-size: .85rem; line-height: 1.4; color: var(--muted); margin-top: 2px; }
.menu-user { margin: 0; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); font-weight: 700; }
.menu form { margin: 0; }
.menu-logout { color: var(--danger); }
.menu-logout:hover { background: #FDECEC; }

.nav-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.round-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.round-btn:hover, .round-btn[aria-expanded="true"], .round-btn.is-in { background: var(--ink); color: #fff; }
.initial { font-weight: 700; }
.nav-toggle { display: none; }
.nav-toggle .when-open { display: none; }
.nav-toggle[aria-expanded="true"] .when-open { display: block; }
.nav-toggle[aria-expanded="true"] .when-closed { display: none; }

@media (max-width: 1180px) {
  .mark-terra, .mark-rule { display: none; }
}
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .primary-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    display: none; padding: 8px var(--gutter) 24px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .primary-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { width: 100%; height: 52px; padding: 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav-link::after { display: none; }
  .nav-link.is-active { color: var(--green); }
  .menu-hub { position: static; width: auto; box-shadow: none; border: 0; padding: 4px 0 8px; }
}
@media (max-width: 560px) {
  .mark-isdb { height: 40px; }
}

/* Hero -------------------------------------------------------------------- */
.hero {
  position: relative; color: #fff;
  min-height: calc(100vh - var(--header-h)); min-height: calc(100dvh - var(--header-h));
  display: flex; flex-direction: column; justify-content: flex-end; padding: 72px var(--gutter);
  background:
    linear-gradient(100deg, rgba(8,14,12,.86) 0%, rgba(8,14,12,.5) 48%, rgba(8,14,12,.12) 100%),
    linear-gradient(0deg, rgba(8,14,12,.55) 0%, rgba(8,14,12,0) 40%),
    var(--hero-img) left 40% / max(135%, 1100px) auto no-repeat, var(--teal);
}
.hero-grid { display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; }
.hero-copy { max-width: 760px; }
.hero h1 { margin: 0 0 18px; }
.h1-main { display: block; font-size: clamp(4rem, 11vw, 8.5rem); line-height: .9; letter-spacing: -.045em; }
.h1-sub { display: block; margin-top: 14px; font-size: clamp(1.45rem, 2.8vw, 2.35rem); font-weight: 400; letter-spacing: -.015em; color: rgba(255,255,255,.95); }
.hero-tagline { max-width: 40rem; font-size: 1.2rem; line-height: 1.45; color: rgba(255,255,255,.85); padding-left: 16px; border-left: 2px solid var(--gold); margin-bottom: 32px; }
.hero-search { display: flex; align-items: center; gap: 10px; max-width: 580px; padding: 5px 5px 5px 16px; background: #fff; color: var(--muted); }
.hero-search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; font-size: 1rem; color: var(--ink); }
.hero-search:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.hero-facts { margin: 0; min-width: 240px; border-left: 1px solid rgba(255,255,255,.3); padding-left: 24px; }
.hero-facts div + div { margin-top: 18px; }
.hero-facts dt { font-size: .82rem; color: rgba(255,255,255,.65); }
.hero-facts dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 600; }

/* Section heads ----------------------------------------------------------- */
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { font-size: 1.1rem; color: var(--muted); margin: 0; }

/* Components -------------------------------------------------------------- */
.components { background: var(--sand); }
.comp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.comp-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.comp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.comp-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.comp-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.comp-card:hover .comp-thumb img { transform: scale(1.05); }
.comp-chip { position: absolute; left: 14px; bottom: 14px; padding: 6px 10px; background: #fff; font-size: .82rem; font-weight: 700; }
.comp-body { display: flex; flex-direction: column; padding: 20px 20px 22px; flex: 1; }
.comp-body h3 { font-size: 1.5rem; margin-bottom: 2px; }
.comp-title { color: var(--teal); font-weight: 600; font-size: .95rem; margin-bottom: 12px; }
.comp-body > p:not(.comp-title) { color: var(--ink-2); }
.comp-items { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.comp-items li { position: relative; padding-left: 16px; font-size: .92rem; color: var(--muted); font-weight: 500; }
.comp-items li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--green); }

/* Project cycle ----------------------------------------------------------- */
.cycle-tabs { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); }
.cycle-tab {
  display: flex; align-items: center; gap: 12px; padding: 16px; text-align: left; cursor: pointer;
  background: var(--paper); border: 0; border-right: 1px solid var(--line); transition: background-color .15s;
}
.cycle-tab:last-child { border-right: 0; }
.cycle-tab:hover { background: var(--sand); }
.cycle-num { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); font-size: .85rem; font-weight: 700; color: var(--muted); }
.cycle-inst { display: block; font-weight: 700; }
.cycle-stage { display: block; font-size: .82rem; line-height: 1.3; color: var(--muted); }
.cycle-tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.cycle-tab[aria-selected="true"] .cycle-num { background: var(--green); border-color: var(--green); color: #fff; }
.cycle-tab[aria-selected="true"] .cycle-stage { color: rgba(255,255,255,.72); }

.cycle-body { display: grid; grid-template-columns: 5fr 7fr; border: 1px solid var(--line); border-top: 0; }
.cycle-panel { padding: 36px; height: 100%; }
.cycle-panel h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 1.6rem; margin-bottom: 22px; }
.tag { padding: 4px 9px; background: var(--sand); font-size: .8rem; font-weight: 700; letter-spacing: 0; }
.panel-label { margin-bottom: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.panel-value { margin: 0; font-size: 1.05rem; }
.check-list { margin-bottom: 24px; }
.check-list li { position: relative; padding: 8px 0 8px 28px; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 0; }
.check-list li::before { content: ""; position: absolute; left: 3px; top: 15px; width: 12px; height: 7px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }
.cycle-map { margin: 0; padding: 16px; background: var(--sand); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.cycle-map svg { width: 100%; height: auto; }
.cycle-map .layer { opacity: 0; transition: opacity .35s ease; }
.cycle-map[data-active="pcn"] .layer[data-stage="pcn"],
.cycle-map[data-active="pprr"] .layer[data-stage="pprr"],
.cycle-map[data-active="pad"] .layer[data-stage="pad"],
.cycle-map[data-active="piasr"] .layer[data-stage="piasr"],
.cycle-map[data-active="pcr"] .layer[data-stage="pcr"],
.cycle-map[data-active="pper"] .layer[data-stage="pper"] { opacity: 1; }
.cycle-map figcaption { display: flex; justify-content: space-between; gap: 16px; padding: 12px 2px 0; font-size: .88rem; color: var(--ink-2); }
.map-note { color: var(--muted); white-space: nowrap; }

/* Modules ----------------------------------------------------------------- */
.modules { background: var(--sand); }
.modules-grid { display: grid; grid-template-columns: 4fr 7fr; gap: 64px; align-items: start; }
.modules-intro { position: sticky; top: calc(var(--header-h) + 32px); }
.modules-intro p { font-size: 1.1rem; color: var(--muted); }
.module-list { border-top: 1px solid var(--ink); }
.module-row { display: flex; align-items: center; gap: 20px; padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.module-icon { width: 50px; height: 50px; display: grid; place-items: center; flex: none; background: var(--paper); border: 1px solid var(--line); color: var(--teal); transition: background-color .15s, color .15s; }
.module-icon .lucide, .module-icon [data-lucide] { width: 22px; height: 22px; }
.module-text { flex: 1; }
.module-name { display: block; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.module-sum { display: block; color: var(--muted); }
.module-go { color: var(--muted); transition: transform .15s; }
.module-row:hover .module-icon { background: var(--ink); color: #fff; border-color: var(--ink); }
.module-row:hover .module-go { transform: translateX(4px); color: var(--ink); }

/* Data band --------------------------------------------------------------- */
.data-band { background: var(--teal); color: #fff; }
.data-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 64px; align-items: start; }
.data-band p { font-size: 1.1rem; color: rgba(255,255,255,.8); }
.format-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.format-list li { padding: 5px 12px; border: 1px solid rgba(255,255,255,.35); font-size: .85rem; font-weight: 600; }
.layer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.16); }
.layer-cols > div { padding: 24px; background: var(--teal-2); }
.layer-cols h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 1.05rem; color: var(--gold); }
.layer-cols li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.layer-cols li:last-child { border-bottom: 0; }

/* Inner pages ------------------------------------------------------------- */
.page-head { padding: 40px 0 56px; background: var(--sand); border-bottom: 1px solid var(--line); }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 28px; font-size: .92rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }
.page-title { display: flex; align-items: flex-start; gap: 20px; }
.page-title h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.03em; margin-bottom: 8px; }
.page-title p { max-width: 40rem; font-size: 1.15rem; color: var(--muted); margin: 0; }
.page-icon { width: 60px; height: 60px; display: grid; place-items: center; flex: none; background: var(--paper); border: 1px solid var(--line); color: var(--teal); }
.page-icon .lucide, .page-icon [data-lucide] { width: 28px; height: 28px; }
.placeholder { max-width: calc(760px + 2 * var(--gutter)); }
.placeholder h2 { font-size: 1.5rem; margin-top: 28px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--sand); font-size: .9rem; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

/* Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); font-size: .95rem; }
.footer-top { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; padding: 56px var(--gutter) 40px; }
.footer-name { margin-bottom: 8px; font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; }
.footer-brand p:last-child { max-width: 42ch; color: var(--muted); }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-cols h2 { margin-bottom: 12px; font-size: .95rem; letter-spacing: 0; }
.footer-cols li { margin-bottom: 8px; }
.footer-cols a { color: var(--muted); text-decoration: none; }
.footer-cols a:hover { color: var(--ink); box-shadow: inset 0 -1px 0 currentColor; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 18px var(--gutter); border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero { background-position: 0 0, 0 0, 62% 30%; background-size: auto, auto, cover; }
  .section { padding: 64px 0; }
  .hero-grid { flex-direction: column; align-items: flex-start; }
  .hero-facts { display: flex; flex-wrap: wrap; gap: 24px; border-left: 0; padding-left: 0; border-top: 1px solid rgba(255,255,255,.3); padding-top: 18px; width: 100%; }
  .hero-facts div + div { margin-top: 0; }
  .comp-grid { grid-template-columns: 1fr 1fr; }
  .cycle-tabs { grid-template-columns: repeat(3, 1fr); }
  .cycle-tab:nth-child(3n) { border-right: 0; }
  .cycle-tab:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .cycle-body, .modules-grid, .data-grid, .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .cycle-body { gap: 0; }
  .cycle-map { border-left: 0; border-top: 1px solid var(--line); }
  .modules-intro { position: static; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; --header-h: 68px; }
  .hero { padding-top: 56px; padding-bottom: 48px; }
  .hero-search .btn { padding: 0 14px; }
  .comp-grid, .layer-cols, .footer-cols { grid-template-columns: 1fr; }
  .cycle-tabs { grid-template-columns: repeat(2, 1fr); }
  .cycle-tab { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .cycle-tab:nth-child(2n) { border-right: 0 !important; }
  .cycle-panel { padding: 24px; }
  .cycle-map figcaption { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ==========================================================================
   Toasts
   ========================================================================== */
.toasts { position: fixed; top: calc(var(--header-h) + 16px); right: 16px; z-index: 80; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.page-auth .toasts { top: 16px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 14px 16px; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--teal); box-shadow: var(--shadow); font-size: .95rem; animation: toast-in .25s ease; }
.toast > .lucide { margin-top: 2px; color: var(--teal); }
.toast span { flex: 1; }
.toast-success { border-left-color: var(--green); }
.toast-success > .lucide { color: var(--green); }
.toast-error { border-left-color: var(--danger); }
.toast-error > .lucide { color: var(--danger); }
.toast-close { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--muted); }
.toast-close:hover { color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Auth layout
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; min-height: 100vh; }
.auth-visual {
  position: relative; display: flex; align-items: flex-end; padding: 56px; color: #fff;
  background:
    linear-gradient(180deg, rgba(8,14,12,.25) 0%, rgba(8,14,12,.85) 100%),
    var(--hero-img) 30% center / cover no-repeat, var(--teal);
  position: sticky; top: 0; height: 100vh;
}
.auth-brand { margin: 0 0 18px; font-size: 1.15rem; font-weight: 400; color: rgba(255,255,255,.9); }
.auth-brand span { display: block; font-size: clamp(3rem, 5vw, 4.5rem); font-weight: 700; letter-spacing: -.045em; line-height: .95; color: #fff; margin-bottom: 8px; }
.auth-quote { max-width: 26rem; padding-left: 14px; border-left: 2px solid var(--gold); font-size: 1.1rem; color: rgba(255,255,255,.85); }
.auth-points { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.25); display: grid; gap: 8px; }
.auth-points li { position: relative; padding-left: 18px; color: rgba(255,255,255,.85); }
.auth-points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--green); }

.auth-main { display: flex; flex-direction: column; min-height: 100vh; padding: 28px clamp(24px, 5vw, 72px); background: var(--paper); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-top .back-link { margin: 0; }
.auth-card { width: 100%; max-width: 440px; margin: auto; padding: 48px 0; }
.auth-card h1 { font-size: clamp(2rem, 3.2vw, 2.6rem); letter-spacing: -.03em; margin-bottom: 10px; }
.auth-lead { color: var(--muted); font-size: 1.05rem; margin-bottom: 28px; }
.auth-lead strong { color: var(--ink); }
.auth-switch { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.auth-switch a, .field-link { color: var(--ink); font-weight: 600; text-decoration: none; box-shadow: inset 0 -1px 0 currentColor; }
.auth-switch a:hover, .field-link:hover { color: var(--teal); }
.auth-foot { margin: 0; font-size: .82rem; color: var(--muted); text-align: center; }
.auth-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 22px; background: var(--sand); color: var(--teal); }
.auth-icon .lucide { width: 26px; height: 26px; }
.auth-icon.is-good { background: #E8F3EC; color: var(--green); }
.auth-icon.is-warn { background: #FDF3E4; color: #A86A12; }

.steps { display: flex; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; counter-reset: none; }
.steps li { flex: 1; display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 3px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--muted); }
.steps li span { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); font-size: .8rem; }
.steps li span .lucide { width: 14px; height: 14px; }
.steps .is-current { border-top-color: var(--ink); color: var(--ink); }
.steps .is-current span { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps .is-done { border-top-color: var(--green); color: var(--ink); }
.steps .is-done span { background: var(--green); border-color: var(--green); color: #fff; }

/* Forms ------------------------------------------------------------------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field label, .otp legend { font-size: .92rem; font-weight: 600; }
.field-link { font-size: .88rem; }
.input {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid #CFCFD3; border-radius: 0; background: var(--paper);
  font-size: 1rem; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #A1A1A6; }
.input:hover { border-color: var(--muted); }
.input:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(201,162,91,.35); }
.has-error .input, .input[aria-invalid="true"] { border-color: var(--danger); }
.field-help { margin: 0; font-size: .84rem; color: var(--muted); }
.field-error { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: .86rem; color: var(--danger); }
.field-error .lucide { width: 15px; height: 15px; margin-top: 2px; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 48px; }
.pw-toggle { position: absolute; top: 0; right: 0; width: 48px; height: 48px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--ink); }
.pw-toggle .when-shown { display: none; }
.pw-toggle[aria-pressed="true"] .when-shown { display: block; }
.pw-toggle[aria-pressed="true"] .when-hidden { display: none; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .95rem; cursor: pointer; }
.checkbox { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.check.has-error { color: var(--danger); }
.btn-block { width: 100%; min-height: 50px; font-size: 1rem; }
.link-btn { border: 0; background: none; padding: 0; font-weight: 600; color: var(--ink); cursor: pointer; box-shadow: inset 0 -1px 0 currentColor; }
.link-btn:disabled { color: var(--muted); box-shadow: none; cursor: default; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 20px; font-size: .95rem; border: 1px solid var(--line); background: var(--sand); }
.alert .lucide { margin-top: 2px; }
.alert-error { background: #FDECEC; border-color: #F5C2C2; color: #8E1B1B; }
.alert-info { background: #EAF2F4; border-color: #C8DDE2; color: var(--teal); }
.tips { margin: 0 0 24px; display: grid; gap: 6px; }
.tips li { position: relative; padding-left: 18px; color: var(--ink-2); }
.tips li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--gold); }

.otp { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.otp-box { width: 100%; height: 60px; border: 1px solid #CFCFD3; background: var(--paper); text-align: center; font-size: 1.6rem; font-weight: 600; color: var(--ink); }
.otp-box:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(201,162,91,.35); }
.otp.has-error .otp-box { border-color: var(--danger); }
.resend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; color: var(--muted); font-size: .95rem; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .otp-boxes { gap: 6px; }
  .otp-box { height: 52px; font-size: 1.35rem; }
  .auth-top .back-link { display: none; }
}

/* ==========================================================================
   404
   ========================================================================== */
.nf { display: grid; grid-template-columns: 6fr 5fr; gap: 56px; align-items: center; min-height: calc(100vh - var(--header-h) - 1px); padding: 64px var(--gutter); background: var(--sand); }
.nf-code { margin-bottom: 12px; font-weight: 600; color: var(--muted); }
.nf h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -.04em; line-height: 1; max-width: 12ch; margin-bottom: 18px; }
.nf-lead { max-width: 36rem; font-size: 1.15rem; color: var(--muted); }
.nf-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 36px; }
.nf-links { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.nf-links a { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.nf-links a:hover { color: var(--teal); }
.nf-links .lucide { color: var(--teal); }
.nf-map { margin: 0; background: var(--paper); border: 1px solid var(--line); padding: 16px; }
.nf-pin { animation: nf-bob 2.4s ease-in-out infinite; transform-origin: 338px 140px; }
@keyframes nf-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (max-width: 900px) { .nf { grid-template-columns: 1fr; } .nf-map { max-width: 480px; } }
@media (prefers-reduced-motion: reduce) { .nf-pin, .toast { animation: none; } }
.menu-user span { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
