/* RadarPanel control centre and seller form.
   The brand's light palette (as radarpanel.top). One signature: in the seller form, a live preview of the seller's own
   store sign-in card, in the store's dark theme, filling in as they type. Everything else stays quiet. */
@font-face {
  font-family: Vazirmatn;
  src: url(../fonts/Vazirmatn-wght.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F2F5F9;
  --surface: #FFFFFF;
  --sunk: #E8EEF5;
  --ink: #0A1A2F;
  --muted: #4F6079;
  --line: #D6DFEA;
  --line-strong: #B9C7D8;
  --green: #047857;
  --green-soft: #E3F2EC;
  --blue: #0369A1;
  --amber: #B54708;
  --amber-soft: #FEF3E6;
  --bad: #B42318;
  --bad-soft: #FDECEA;
  /* the seller's store (panel dark theme) */
  --store-bg: #050B16;
  --store-surface: #0B1628;
  --store-ink: #EAF2FF;
  --store-muted: #9DB0C7;
  --store-primary: #2EF2A0;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.85 Vazirmatn, Tahoma, sans-serif;
}
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.4; font-weight: 800; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
bdi { unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ltr { direction: ltr; text-align: left; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; }
.mark svg { width: 34px; height: 34px; }
.mark span small { display: block; font-weight: 500; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--sunk); }

.page { max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 64px; }

/* buttons, fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 20px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--green); color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #03664A; }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover { background: var(--sunk); }
.btn-quiet { background: none; color: var(--muted); border-color: transparent; }
.btn-quiet:hover { background: var(--sunk); color: var(--ink); }
.btn-bad { background: var(--surface); color: var(--bad); border-color: #F1B7B0; }
.btn-bad:hover { background: var(--bad-soft); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.field { display: grid; gap: 6px; align-content: start; }
.field + .field, .field + .row, .row + .field, .row + .row { margin-top: 18px; }
.row > .field { margin-top: 0; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
label, .label { font-weight: 700; font-size: .95rem; }
.hint { color: var(--muted); font-size: .875rem; line-height: 1.75; }
.error { color: var(--bad); font-size: .875rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(3, 105, 161, .18); }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--bad); }
input[type=file] { font: inherit; font-size: .9rem; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.check input { width: 20px; height: 20px; margin-top: 5px; accent-color: var(--green); flex: none; }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: block; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font-weight: 600; cursor: pointer;
}
.choice input:checked + span { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }

.notice { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: .95rem; }
.notice-ok { background: var(--green-soft); border-color: #A7D7C5; color: #064E3B; }
.notice-bad { background: var(--bad-soft); border-color: #F1B7B0; color: #7A1A12; }
.notice-warn { background: var(--amber-soft); border-color: #F6C894; color: #7A2E05; }
.notice + * { margin-top: 18px; }

/* live check result next to a field */
.live { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.live output { font-size: .9rem; }
.live output[data-state=ok] { color: var(--green); }
.live output[data-state=warn] { color: var(--amber); }
.live output[data-state=fail] { color: var(--bad); }

/* ===== seller form ===== */
.join { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 4vw, 36px); }
.sheet-head { display: grid; gap: 4px; margin-bottom: 26px; }
.sheet-head .count { color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.cards { display: grid; gap: 12px; }
.card-row { display: grid; gap: 10px; grid-template-columns: 2fr 1.4fr 1fr; }

.side { position: sticky; top: 20px; display: grid; gap: 20px; }

/* the signature: the seller's own store, as its customers will see the sign-in */
.preview { border-radius: var(--radius-lg); background: var(--store-bg); padding: 22px; color: var(--store-ink); }
.preview-cap { color: var(--store-muted); font-size: .8rem; margin-bottom: 14px; }
.preview-card { background: var(--store-surface); border: 1px solid rgba(140, 200, 255, .14); border-radius: 16px; padding: 22px 20px; text-align: center; }
.preview-logo {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 16px;
  display: grid; place-items: center; overflow: hidden;
  border: 1px solid rgba(234, 242, 255, .25); font-size: 1.7rem; font-weight: 800;
}
.preview-logo img { width: 100%; height: 100%; object-fit: contain; }
.preview-name { font-size: 1.25rem; font-weight: 800; }
.preview-en { color: var(--store-muted); font-size: .85rem; direction: ltr; }
.preview-tag { color: var(--store-muted); font-size: .9rem; margin-top: 10px; min-height: 1.5em; }
.preview-field { margin-top: 16px; height: 42px; border-radius: 10px; border: 1px solid rgba(140, 200, 255, .2); background: #08111F; }
.preview-btn { margin-top: 10px; height: 42px; border-radius: 10px; background: var(--store-primary); color: #04140D; font-weight: 800; display: grid; place-items: center; font-size: .95rem; }
.preview-domain { margin-top: 12px; color: var(--store-muted); font-size: .8rem; direction: ltr; text-align: center; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: .95rem; }
.steps a:hover { background: var(--sunk); color: var(--ink); }
.steps .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; border: 1px solid var(--line-strong); flex: none; }
.steps .done a { color: var(--ink); }
.steps .done .n { background: var(--green); border-color: var(--green); color: #fff; }
.steps [aria-current=step] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.steps [aria-current=step] .n { border-color: var(--ink); color: var(--ink); }

/* ===== owner console ===== */
.bar { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.bar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 700; color: var(--muted); font-size: .85rem; background: #F7F9FC; }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 700; color: var(--ink); text-decoration: none; }
td a:hover { color: var(--blue); }
.state { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
.state-live::before, .state-ok::before { background: var(--green); }
.state-building::before, .state-running::before, .state-queued::before { background: var(--blue); }
.state-ready::before { background: var(--amber); }
.state-locked::before, .state-failed::before, .state-bad::before { background: var(--bad); }
.empty { padding: 48px 24px; text-align: center; display: grid; gap: 14px; justify-items: center; }

.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.box + .box { margin-top: 20px; }
.box h2 { margin-bottom: 14px; font-size: 1.05rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: .95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.log {
  margin: 0; padding: 16px; max-height: 70vh; overflow: auto;
  background: #0A1A2F; color: #DCE6F2; border-radius: var(--radius-sm);
  font: 13px/1.7 Consolas, "Cascadia Mono", monospace; direction: ltr; text-align: left; white-space: pre-wrap;
}
.ops { list-style: none; margin: 0; padding: 0; display: grid; }
.ops li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ops li:last-child { border-bottom: 0; }
.stack { display: grid; gap: 10px; }
.inline-form { display: inline; }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth .sheet { width: min(420px, 100%); }

@media (max-width: 960px) {
  .join, .split { grid-template-columns: 1fr; }
  .side { position: static; order: -1; }
  .steps { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .steps a { white-space: nowrap; }
  .preview { padding: 16px; }
  .preview-card { display: grid; grid-template-columns: auto 1fr; gap: 0 14px; text-align: right; align-items: center; padding: 14px; }
  .preview-logo { width: 52px; height: 52px; margin: 0; grid-row: span 3; }
  .preview-field, .preview-btn, .preview-domain { display: none; }
  .preview-tag { margin-top: 2px; }
}
@media (max-width: 960px) { .side > .hint { display: none; } }
@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr 1fr; }
  .card-row { grid-template-columns: 1fr 1fr; }
  .card-row > :first-child { grid-column: 1 / -1; }
  .actions .btn { flex: 1; }
  th, td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* small helpers used by the form steps */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
fieldset.plain + .field, .field + fieldset.plain { margin-top: 18px; }
.gap-top { margin-top: 18px; }
.box-sunk { background: var(--sunk); border-color: transparent; margin-bottom: 20px; }
.done-sheet { max-width: 640px; margin: 40px auto; display: grid; gap: 14px; }
