/* ═══════════════════════════════════════════
   SIFF client app – shell styles
   Colours match the calculator pages.
   ═══════════════════════════════════════════ */
:root {
  --navy: #0c1f3d;
  --navy-mid: #163260;
  --navy-light: #1e4a8a;
  --sky: #aecef5;
  --sky-pale: #e8f2fd;
  --gold: #b8892a;
  --gold-bright: #d4a43a;
  --green: #156b42;
  --green-pale: #e6f4ed;
  --red: #a62318;
  --red-pale: #fdf0ee;
  --slate: #5a6880;
  --slate-light: #8a97aa;
  --border: #d8e2f0;
  --bg: #eef2f8;
  --white: #fff;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow-lg: 0 18px 50px rgba(12, 31, 61, .16);
  --topbar-h: 60px;
  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--navy); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }

/* ── Brand ── */
.brand { display: flex; align-items: center; flex: none; background: var(--white); border-radius: 8px; padding: 4px 10px; align-self: flex-start; }
.brand-logo { display: block; height: 36px; width: auto; }
.topbar .brand { align-self: center; }
.brand-lg { padding: 8px 16px; border-radius: var(--radius); }
.brand-lg .brand-logo { height: 64px; }

/* ── Gate (details + verify) ── */
.gate { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.gate-intro {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, var(--navy-light) 0%, var(--navy-mid) 35%, var(--navy) 75%);
  color: var(--white); padding: 56px clamp(28px, 6vw, 84px);
  display: flex; flex-direction: column; justify-content: center; gap: 26px;
}
.gate-intro::after {
  content: ''; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%;
  border: 1px solid rgba(212, 164, 58, .25); box-shadow: 0 0 0 60px rgba(212, 164, 58, .04), 0 0 0 120px rgba(212, 164, 58, .03);
  pointer-events: none;
}
.gate-intro h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.2; max-width: 16ch; }
.gate-intro h1 em { color: var(--gold-bright); }
.lead { color: #c9d8ee; font-size: 16px; line-height: 1.7; max-width: 52ch; }
.feature-list { list-style: none; display: grid; gap: 16px; max-width: 52ch; }
.feature-list li { display: flex; gap: 16px; align-items: flex-start; font-size: 14px; color: #c9d8ee; line-height: 1.55; }
.feature-list li > span { font-family: var(--serif); color: var(--gold-bright); font-size: 13px; padding-top: 2px; min-width: 22px; }
.feature-list strong { display: block; color: var(--white); font-size: 15px; margin-bottom: 2px; }
.fine { font-size: 11.5px; color: var(--slate-light); }

.gate-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 48px 24px; gap: 22px; }
.steps { list-style: none; display: flex; gap: 8px; width: 100%; max-width: 460px; }
.step { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--slate-light); }
.step span {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--border); background: var(--white); font-size: 11px; font-weight: 700;
}
.step.active { color: var(--navy); }
.step.active span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.step.done span { background: var(--green); border-color: var(--green); color: var(--white); }

.card {
  width: 100%; max-width: 460px; background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 34px 32px; display: grid; gap: 16px;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card h2 { font-family: var(--serif); font-size: 24px; font-weight: 400; }
.muted { color: var(--slate); font-size: 14px; line-height: 1.6; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--slate); }
.field input {
  font: 500 15px var(--sans); color: var(--navy); text-transform: none; letter-spacing: normal;
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: #fbfcfe;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--navy-light); box-shadow: 0 0 0 4px var(--sky-pale); background: var(--white); }
.field input.invalid { border-color: var(--red); background: var(--red-pale); }
.code-input { font-size: 28px !important; letter-spacing: 14px !important; text-align: center; font-weight: 700 !important; }
.err { min-height: 0; color: var(--red); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: normal; }
.err:empty { display: none; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--slate); line-height: 1.5; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--navy); flex: none; }

.form-error, .form-success { font-size: 13px; border-radius: var(--radius); padding: 10px 12px; line-height: 1.5; }
.form-error { color: var(--red); background: var(--red-pale); }
.form-success { color: var(--green); background: var(--green-pale); }
.form-error:empty, .form-success:empty { display: none; }
.dev-hint { font-size: 12px; color: var(--gold); background: #fdf4e3; border-radius: var(--radius); padding: 8px 12px; }

.btn {
  border: none; border-radius: var(--radius); padding: 13px 18px; font-weight: 700; font-size: 14.5px;
  transition: transform .1s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--navy-light); }
.btn-ghost { background: transparent; color: var(--slate); border: 1.5px solid var(--border); }
.btn-ghost:hover:not(:disabled) { color: var(--navy); border-color: var(--slate-light); }
.link { background: none; border: none; color: var(--navy-light); font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.link.light { color: var(--sky); }
.verify-links { display: flex; justify-content: space-between; }

/* ── Workspace ── */
.workspace { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none; background: var(--navy); color: var(--white);
  display: flex; align-items: center; gap: 28px; padding: 0 22px;
  box-shadow: 0 2px 12px rgba(12, 31, 61, .25); position: relative; z-index: 2;
}
.tabs { display: flex; gap: 4px; align-self: stretch; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tab {
  position: relative; background: none; border: none; color: #9fb5d6; font-weight: 500; font-size: 14px;
  padding: 0 18px; white-space: nowrap; transition: color .15s;
}
.tab:hover { color: var(--white); }
.tab[aria-selected="true"] { color: var(--white); }
.tab[aria-selected="true"]::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold-bright);
}
.user { display: flex; align-items: center; gap: 14px; font-size: 13px; white-space: nowrap; }
.user-name { color: #c9d8ee; }
.frames { flex: 1; position: relative; }
.frames iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--bg); }

/* ── Dialog ── */
.dialog { margin: auto; border: none; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(480px, calc(100% - 32px)); padding: 0; color: var(--navy); }
.dialog::backdrop { background: rgba(12, 31, 61, .55); backdrop-filter: blur(3px); }
.dialog-body { padding: 30px; display: grid; gap: 16px; }
.dialog-body h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.dialog-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--sky-pale); color: var(--navy-light); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; }
  .gate-intro { padding: 40px 24px; gap: 18px; }
  .feature-list, .fine { display: none; }
  .gate-panel { padding: 28px 16px 48px; justify-content: flex-start; }
}
@media (max-width: 720px) {
  :root { --topbar-h: 104px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 6px 12px; }
  .topbar .brand { margin-right: auto; }
  .tabs { order: 3; flex-basis: 100%; height: 44px; }
  .tab { padding: 0 12px; font-size: 13px; }
  .user-name { display: none; }
  .row { grid-template-columns: 1fr; }
  .card { padding: 26px 20px; }
  .dialog-actions .btn { flex: 1; }
}
