/* ==========================================================================
   آزمایشگاه عامل گهواره — سیستم طراحی
   tokenها همان مقادیر تأییدشدهٔ prototype و قرارداد docs/ux/09 هستند.
   ========================================================================== */

@font-face { font-family: "Yekan Bakh"; src: url("../fonts/YekanBakhFaNum-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Yekan Bakh"; src: url("../fonts/YekanBakhFaNum-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Yekan Bakh"; src: url("../fonts/YekanBakhFaNum-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/Switzer-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("../fonts/Switzer-Semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* رنگ */
  --canvas: #f7f6f1;
  --surface: #ffffff;
  --surface-soft: #fafaf8;
  --surface-tint: #e8f8fa;
  --ink: #192f33;
  --muted: #585858;
  --subtle: #858585;
  --border: #dfe7e5;
  --border-strong: #c4d3d1;
  --brand: #0dbdd0;
  --action-primary: #087783;
  --action-primary-hover: #05636d;
  --action-primary-soft: #e5f8fa;
  --teal: #009983;
  --teal-soft: #e3f5f1;
  --success: #237a23;
  --success-soft: #e9f6e9;
  --warning: #8a6100;
  --warning-soft: #fff4d5;
  --danger: #b63d28;
  --danger-soft: #feebe7;
  --info: #006fae;
  --info-soft: #e7f4fc;
  --accent-yellow: #ffb600;

  /* شکل و فاصله */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --shadow-sm: 0 1px 2px rgba(19, 65, 71, .04), 0 7px 18px rgba(19, 65, 71, .04);
  --shadow-lg: 0 24px 60px rgba(19, 65, 71, .14);
  --sidebar: 248px;
  --touch: 44px;

  font-family: "Yekan Bakh", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); color: var(--ink); }
body { margin: 0; min-width: 320px; font-size: 14px; line-height: 1.7; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid rgba(13, 189, 208, .38); outline-offset: 2px; }
[hidden] { display: none !important; }
code, .mono, .ltr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; unicode-bidi: embed; }
bdi, .ltr-value { direction: ltr; unicode-bidi: isolate; font-family: "Switzer", ui-monospace, monospace; }

.skip-link {
  position: fixed; inset: 8px auto auto 50%; z-index: 1000;
  transform: translate(-50%, -160%);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-md);
}
.skip-link:focus { transform: translate(-50%, 0); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- shell --- */

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; padding: var(--space-5) 14px 14px; z-index: 60;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 10px 18px; border-bottom: 1px solid var(--border); }
.brand img { width: 72px; height: 30px; object-fit: contain; object-position: right center; }
.brand strong { display: block; font-size: 13px; }
.brand small { display: block; color: var(--subtle); font-size: 10px; }

.nav-section { margin-top: var(--space-5); }
.nav-label { padding: 0 12px 7px; color: var(--subtle); font-size: 10px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; min-height: var(--touch);
  padding: 10px 12px; margin: 2px 0; border-radius: 7px;
  color: var(--muted); background: transparent; border: 0; width: 100%;
  text-align: right; cursor: pointer;
}
.nav-link:hover { background: #f3f8f7; color: var(--ink); }
.nav-link.active { color: #075c65; background: var(--action-primary-soft); box-shadow: inset -3px 0 var(--brand); font-weight: 600; }
.nav-icon { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 7px; font-size: 12px; }
.nav-badge {
  margin-right: auto; background: var(--accent-yellow); color: #553e00;
  min-width: 21px; height: 21px; border-radius: 11px; display: grid; place-items: center;
  padding: 0 6px; font-size: 11px; font-weight: 700;
}
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: var(--space-3); }
.user-card {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center;
  width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent;
  text-align: right; cursor: pointer;
}
.user-card:hover { background: #f3f8f7; }
.user-card strong { display: block; font-size: 12px; }
.user-card small { display: block; color: var(--subtle); font-size: 10px; }
.avatar {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: var(--action-primary-soft); color: var(--action-primary); font-weight: 700;
}

.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; min-height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 0 clamp(14px, 3vw, 28px);
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.environment { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.environment .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-yellow); box-shadow: 0 0 0 4px var(--warning-soft); }
.environment .dot.ok { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-button {
  width: var(--touch); height: var(--touch); display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; cursor: pointer;
}
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.mobile-menu { display: none; }
.main {
  min-height: calc(100vh - 62px); width: 100%; max-width: 1540px; margin-inline: auto;
  padding: var(--space-6) clamp(18px, 3vw, 42px) 56px;
  background-image: linear-gradient(rgba(247, 246, 241, .965), rgba(247, 246, 241, .965)), url("../img/gahvare-pattern.png");
  background-size: auto, 920px auto; background-attachment: fixed;
}

/* ------------------------------------------------------------- headings --- */

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-5); flex-wrap: wrap; }
.breadcrumbs { color: var(--muted); font-size: 12px; margin-bottom: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.breadcrumbs span { color: var(--subtle); }
h1 { font-size: clamp(24px, 3vw, 31px); line-height: 1.45; margin: 0 0 7px; }
h2 { font-size: 18px; line-height: 1.5; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0; max-width: 760px; }
.head-actions, .row-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); font-size: 12px; }

/* -------------------------------------------------------------- buttons --- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 8px 16px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); font-weight: 600; cursor: pointer;
}
.button:hover { background: var(--surface-soft); }
.button.primary { background: var(--action-primary); border-color: var(--action-primary); color: #fff; }
.button.primary:hover { background: var(--action-primary-hover); }
.button.ghost { border-color: transparent; background: transparent; color: var(--action-primary); }
.button.ghost:hover { background: var(--action-primary-soft); }
.button.danger { color: var(--danger); border-color: #edc7cb; }
.button.danger:hover { background: var(--danger-soft); }
.button.small { min-height: 34px; padding: 5px 12px; font-size: 12px; }
.button[disabled], .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.button[aria-busy="true"] { cursor: progress; }

/* --------------------------------------------------------------- layout --- */

.grid { display: grid; gap: var(--space-4); }
.grid.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack { display: grid; gap: var(--space-4); }
.stack.tight { gap: var(--space-2); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { margin-top: auto; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: var(--space-5); min-width: 0;
}
.card.flat { box-shadow: none; }
.card.interactive:hover { border-color: var(--border-strong); box-shadow: 0 10px 26px rgba(19, 65, 71, .08); }
.card-title { display: flex; justify-content: space-between; gap: var(--space-3); align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.card-title h2, .card-title h3 { margin: 0; }

.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { display: block; font-size: 25px; font-weight: 700; margin-top: 8px; }
.metric-note { display: block; font-size: 11px; color: var(--success); margin-top: 5px; }
.metric-note.warn { color: var(--warning); }
.metric-note.danger { color: var(--danger); }

/* -------------------------------------------------------------- status ---- */

.status {
  display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 2px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.neutral { background: #f1f4f3; color: var(--muted); }
.status.info { background: var(--info-soft); color: var(--info); }
.status.success { background: var(--success-soft); color: var(--success); }
.status.warning { background: var(--warning-soft); color: var(--warning); }
.status.danger { background: var(--danger-soft); color: var(--danger); }

/* -------------------------------------------------------------- banner ---- */

.banner {
  display: grid; grid-template-columns: 22px 1fr auto; gap: var(--space-3); align-items: start;
  padding: 14px var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface-soft);
}
.banner .banner-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 700; }
.banner strong { display: block; margin-bottom: 2px; }
.banner.info { background: var(--info-soft); border-color: #cbe4f4; color: #08415f; }
.banner.info .banner-icon { background: var(--info); color: #fff; }
.banner.success { background: var(--success-soft); border-color: #cbe8cb; color: #14501a; }
.banner.success .banner-icon { background: var(--success); color: #fff; }
.banner.warning { background: var(--warning-soft); border-color: #f2e0a8; color: #5b4000; }
.banner.warning .banner-icon { background: var(--warning); color: #fff; }
.banner.danger { background: var(--danger-soft); border-color: #f4cdc6; color: #7a2416; }
.banner.danger .banner-icon { background: var(--danger); color: #fff; }

/* --------------------------------------------------------------- meter ---- */

.meter { display: grid; gap: 6px; }
.meter-track { height: 9px; border-radius: 999px; background: #eef2f1; overflow: hidden; }
.meter-fill { height: 100%; background: var(--action-primary); border-radius: 999px; }
.meter-fill.soft { background: var(--warning); }
.meter-fill.hard { background: var(--danger); }
.meter-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* -------------------------------------------------------------- tables ---- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; min-width: 720px; }
table.data caption { text-align: right; padding: 12px var(--space-4); color: var(--muted); font-size: 12px; }
table.data th, table.data td { padding: 12px var(--space-4); text-align: right; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data thead th { background: var(--surface-soft); font-size: 12px; color: var(--muted); white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcfb; }
table.data td.numeric { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- forms --- */

.field { display: grid; gap: 6px; }
.field > label, .field .field-label { font-weight: 600; font-size: 13px; }
.field .help { color: var(--muted); font-size: 11px; }
.field .error { color: var(--danger); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; min-height: var(--touch); padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(13, 189, 208, .18); }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: var(--danger); }
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
legend { font-weight: 600; padding: 0 6px; }

.choice-card {
  display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: var(--space-4);
  background: var(--surface); cursor: pointer;
}
.choice-card:hover { border-color: var(--brand); }
.choice-card.selected { border-color: var(--action-primary); background: var(--action-primary-soft); }
.choice-card.disabled { opacity: .6; cursor: not-allowed; background: var(--surface-soft); }
.choice-card strong { display: block; }
.choice-card .meta { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- tabs ---- */

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  min-height: 42px; padding: 8px 14px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--action-primary); border-bottom-color: var(--brand); font-weight: 600; }

/* ------------------------------------------------------------- stepper ---- */

.stepper { display: flex; gap: var(--space-2); flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.stepper li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 12px; }
.stepper li .num { width: 20px; height: 20px; border-radius: 50%; background: var(--border); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.stepper li[aria-current="step"] { background: var(--action-primary-soft); border-color: var(--brand); color: #075c65; }
.stepper li[aria-current="step"] .num { background: var(--action-primary); color: #fff; }
.stepper li.complete .num { background: var(--success); color: #fff; }

/* -------------------------------------------------------------- checks ---- */

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.check-item { display: grid; grid-template-columns: 22px 1fr auto; gap: var(--space-3); align-items: start; padding: 12px var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.check-item .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.check-item.pass .mark { background: var(--success-soft); color: var(--success); }
.check-item.warning .mark { background: var(--warning-soft); color: var(--warning); }
.check-item.block .mark { background: var(--danger-soft); color: var(--danger); }
.check-item strong { display: block; }
.check-item .safe-message { color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------ timeline ---- */

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr; gap: var(--space-3); padding-bottom: var(--space-4); position: relative; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 10px; top: 22px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); z-index: 1; }
.timeline li.succeeded .dot { border-color: var(--success); background: var(--success-soft); }
.timeline li.failed .dot { border-color: var(--danger); background: var(--danger-soft); }
.timeline li.running .dot { border-color: var(--info); background: var(--info-soft); }
.timeline .stage-head { display: flex; gap: var(--space-2); align-items: baseline; justify-content: space-between; flex-wrap: wrap; }

/* ------------------------------------------------------------ messages ---- */

.chat { display: grid; gap: var(--space-3); }
.chat .bubble { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); background: var(--surface); max-width: 92%; }
.chat .bubble.user { background: var(--action-primary-soft); border-color: #bfe7ec; margin-inline-start: auto; }
.chat .bubble.instance { margin-inline-end: auto; }
.chat .bubble-meta { display: flex; gap: var(--space-3); flex-wrap: wrap; color: var(--muted); font-size: 11px; margin-top: var(--space-2); }

/* ------------------------------------------------------------- dialogs ---- */

dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 0; max-width: 620px; width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(25, 47, 51, .45); }
.modal-head { padding: var(--space-5) var(--space-5) 0; }
.modal-body { padding: var(--space-4) var(--space-5); display: grid; gap: var(--space-4); }
.modal-foot { padding: var(--space-4) var(--space-5) var(--space-5); display: flex; gap: var(--space-2); justify-content: flex-start; flex-wrap: wrap; }

/* --------------------------------------------------------------- misc ----- */

.empty { text-align: center; padding: var(--space-6) var(--space-4); display: grid; gap: var(--space-3); justify-items: center; }
.empty .empty-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-tint); display: grid; place-items: center; color: var(--action-primary); }
.empty p { color: var(--muted); margin: 0; max-width: 520px; }
.toolbar { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { min-width: 160px; flex: 1 1 160px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-4); font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.disclosure summary { cursor: pointer; color: var(--action-primary); font-weight: 600; }
.pill-list { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.pill { border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 11px; color: var(--muted); background: var(--surface-soft); }
.offset-note { font-size: 11px; color: var(--muted); }
.skeleton { background: linear-gradient(90deg, #eef2f1 25%, #f7f9f8 50%, #eef2f1 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); min-height: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------- responsive ---- */

@media (max-width: 1180px) {
  .grid.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split, .grid.three { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 880px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-end: 0; width: min(320px, 86vw);
    transform: translateX(105%); transition: transform .22s ease; z-index: 90;
    box-shadow: var(--shadow-lg);
  }
  html[dir="rtl"] .sidebar { transform: translateX(-105%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(25, 47, 51, .4); z-index: 80; }
  .mobile-menu { display: grid; }
  .grid.two, .form-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 660px) {
  .grid.metrics, .grid.three, .grid.two { grid-template-columns: minmax(0, 1fr); }
  .main { padding: var(--space-4) 14px var(--space-7); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .card { padding: var(--space-4); }
}

/* --------------------------------------------------------- auth landing --- */

.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(247, 246, 241, .94), rgba(247, 246, 241, .97)),
    url("../img/gahvare-pattern.png") center / 920px auto fixed;
}

.auth-page {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 64px);
  display: flex;
  flex-direction: column;
}

.auth-masthead {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  border-bottom: 1px solid rgba(196, 211, 209, .72);
}

.auth-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.auth-identity img {
  width: 112px;
  height: 48px;
  object-fit: contain;
  object-position: right center;
}

.auth-product-name {
  padding-inline-start: var(--space-4);
  border-inline-start: 1px solid var(--border-strong);
}

.auth-product-name strong,
.auth-product-name small { display: block; }

.auth-product-name strong {
  font-family: "Switzer", "Yekan Bakh", sans-serif;
  font-size: 16px;
  line-height: 1.35;
}

.auth-product-name small {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 11px;
}

.auth-environment {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
}

.auth-environment::before {
  width: 8px;
  height: 8px;
  content: "";
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(35, 122, 35, .1);
}

.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .72fr);
  gap: clamp(44px, 7vw, 112px);
  align-items: center;
  padding-block: clamp(38px, 6vh, 76px);
}

.auth-story,
.auth-panel { min-width: 0; }

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--action-primary);
  font-size: 12px;
  font-weight: 600;
}

.auth-eyebrow::before {
  width: 23px;
  height: 3px;
  content: "";
  background: var(--brand);
  border-radius: 2px;
}

.auth-story h1 {
  max-width: 720px;
  margin: 18px 0 var(--space-4);
  font-size: clamp(36px, 4.2vw, 66px);
  line-height: 1.38;
  letter-spacing: -.035em;
}

.auth-intro {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 2;
}

.engine-map {
  position: relative;
  min-height: 306px;
  margin-top: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 83% 22%, rgba(13, 189, 208, .18), transparent 27%),
    radial-gradient(circle at 18% 86%, rgba(255, 182, 0, .14), transparent 28%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.engine-map-grid {
  position: absolute;
  inset: 0;
  opacity: .34;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 94%);
}

.engine-flow {
  position: relative;
  z-index: 1;
  min-height: 306px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: var(--space-3);
  padding: 38px 30px 30px;
}

.engine-flow-step {
  position: relative;
  min-height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(25, 47, 51, .05);
}

.engine-flow-step:not(:last-child)::after {
  position: absolute;
  top: 50%;
  left: -20px;
  width: 27px;
  height: 2px;
  content: "";
  background: var(--brand);
  transform: translateY(-50%);
}

.engine-step-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--action-primary);
  background: var(--action-primary-soft);
  border-radius: 10px;
  font-family: "Switzer", sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.engine-flow-step strong {
  display: block;
  margin-top: 18px;
  font-size: 14px;
}

.engine-flow-step small {
  display: block;
  margin-top: 3px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.6;
}

.engine-map-caption {
  position: absolute;
  z-index: 2;
  inset: auto 30px 16px auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--subtle);
  font-size: 10px;
}

.engine-map-caption::before {
  width: 6px;
  height: 6px;
  content: "";
  background: var(--brand);
  border-radius: 50%;
}

.auth-card {
  padding: clamp(28px, 3.5vw, 42px);
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(19, 65, 71, .12);
}

.auth-card h2 {
  margin: 13px 0 var(--space-2);
  font-size: clamp(25px, 2.3vw, 32px);
  line-height: 1.45;
}

.auth-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.auth-form .input {
  min-height: 50px;
  border-radius: 11px;
}

.auth-email {
  direction: ltr;
  text-align: left;
  font-family: "Switzer", sans-serif;
}

.auth-password-wrap { position: relative; }
.auth-password-input { padding-inline-end: 52px; }

.auth-visibility {
  position: absolute;
  inset: 5px auto 5px 5px;
  width: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--space-2);
  cursor: pointer;
}

.auth-visibility:hover {
  color: var(--action-primary);
  background: var(--action-primary-soft);
}

.auth-visibility svg { width: 20px; height: 20px; }

.auth-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 12px;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
}

.auth-remember input {
  width: 18px;
  height: 18px;
  accent-color: var(--action-primary);
}

.auth-text-link {
  color: var(--action-primary);
  text-decoration: underline;
  text-decoration-color: rgba(8, 119, 131, .28);
  text-underline-offset: 4px;
  font-weight: 600;
}

.auth-primary {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  color: #fff;
  background: var(--action-primary);
  border: 1px solid var(--action-primary);
  border-radius: 11px;
  font-weight: 600;
  cursor: pointer;
}

.auth-primary:hover { background: var(--action-primary-hover); }

.auth-primary svg {
  width: 19px;
  height: 19px;
  transform: rotate(180deg);
}

.auth-trust-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.auth-trust-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 11px;
}

.auth-trust-list li span {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
}

.auth-footer {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  color: var(--subtle);
  border-top: 1px solid rgba(196, 211, 209, .72);
  font-size: 11px;
}

.auth-footer bdi { font-family: "Switzer", sans-serif; }

@media (max-width: 1050px) {
  .auth-main {
    grid-template-columns: minmax(0, 1fr) minmax(330px, .78fr);
    gap: 36px;
  }

  .engine-flow { padding-inline: 20px; gap: var(--space-2); }
  .engine-flow-step { padding: 13px; }
  .engine-flow-step:not(:last-child)::after { left: -15px; width: 20px; }
}

@media (max-width: 850px) {
  .auth-page { padding-inline: clamp(18px, 5vw, 42px); }
  .auth-main { grid-template-columns: 1fr; align-items: start; padding-block: 44px 56px; }
  .auth-story { text-align: center; }
  .auth-eyebrow { justify-content: center; }
  .auth-story h1,
  .auth-intro { margin-inline: auto; }
  .auth-story h1 { max-width: 660px; font-size: clamp(34px, 7vw, 52px); }
  .engine-map { text-align: right; }
  .auth-panel { width: min(560px, 100%); margin-inline: auto; }
}

@media (max-width: 600px) {
  .auth-masthead { min-height: 78px; }
  .auth-identity { gap: 10px; }
  .auth-identity img { width: 84px; }
  .auth-product-name { padding-inline-start: 10px; }
  .auth-product-name strong { font-size: 13px; }
  .auth-product-name small { display: none; }
  .auth-environment { padding-inline: 10px; font-size: 10px; }
  .auth-main { gap: var(--space-6); padding-block: 34px 42px; }
  .auth-story h1 { margin-top: 14px; font-size: 33px; line-height: 1.46; }
  .auth-intro { font-size: 14px; }
  .engine-map { min-height: auto; margin-top: 26px; }
  .engine-flow { min-height: auto; grid-template-columns: 1fr; gap: 10px; padding: 20px 20px 45px; }
  .engine-flow-step { min-height: 0; display: grid; grid-template-columns: 34px 1fr; align-items: center; column-gap: var(--space-3); }
  .engine-flow-step strong { margin: 0; }
  .engine-flow-step small { grid-column: 2; }
  .engine-flow-step:not(:last-child)::after { top: auto; right: 29px; bottom: -13px; left: auto; width: 2px; height: 15px; transform: none; }
  .engine-map-caption { right: 20px; bottom: 14px; }
  .auth-card { padding: 26px 20px; border-radius: 18px; }
  .auth-form-meta { align-items: flex-start; flex-direction: column; }
  .auth-trust-list { grid-template-columns: 1fr; }
  .auth-footer { min-height: 82px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 2px; padding-block: 18px; }
}
