/*
 * Shared design system for every environment in this repo.
 *
 * One stylesheet, one visual language, six different brands. An environment
 * changes only the theme variables (from site.json) and can append its own rules
 * in brand.css. Nothing here is Squiryl-specific: these are the primitives a
 * normal marketing site and a normal account area both need.
 */

:root {
  color-scheme: light;
  /* Theme — every environment overrides these five. */
  --brand: #0b1f3a;
  --brand-2: #123a63;
  --accent: #0f9d76;
  --accent-soft: #e6f6ef;
  --bg: #f6f7fb;

  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --border: rgba(11, 31, 58, 0.1);
  --text: #17233d;
  --muted: #5b6b85;
  --danger: #c0392b;
  --danger-soft: #fbeaea;
  --warn: #b7791f;
  --warn-soft: #fdf6e3;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 31, 58, 0.08);
  --shadow-sm: 0 2px 8px rgba(11, 31, 58, 0.06);
  --container: 1120px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--brand); line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.95rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
h4 { font-size: .95rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
code, .mono { font-family: var(--mono); font-size: .86em; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; }
.section-head { max-width: 640px; margin: 0 auto 2.2rem; text-align: center; }
.row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-size: .95rem; font-weight: 600; padding: .65rem 1.3rem; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); border-color: var(--brand-2); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(192, 57, 43, .25); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-lg { padding: .85rem 1.7rem; font-size: 1.02rem; }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Header / nav ────────────────────────────────────────────────────── */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 2rem; padding: 14px 24px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.05rem; color: var(--brand); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--brand); color: #fff; font-size: .95rem; }
.brand-name-accent { color: var(--accent); }
.site-nav { display: flex; gap: 1.6rem; flex: 1; }
.site-nav a { color: var(--muted); font-weight: 600; font-size: .92rem; padding: .3rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.active { color: var(--brand); border-color: var(--accent); text-decoration: none; }
.btn-nav-cta { margin-left: auto; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: var(--brand); cursor: pointer; }
.site-nav-mobile { display: none; flex-direction: column; gap: .25rem; padding: 8px 24px 16px; border-top: 1px solid var(--border); }
.site-nav-mobile a { padding: .6rem 0; color: var(--text); font-weight: 600; }

@media (max-width: 780px) {
  .site-nav, .btn-nav-cta { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .site-nav-mobile:not([hidden]) { display: flex; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { background: var(--brand); color: #cfd8e8; margin-top: 64px; }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; padding: 44px 24px 24px; }
.site-footer .brand { color: #fff; }
.site-footer .brand-mark { background: rgba(255,255,255,.15); }
.footer-col h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .7rem; }
.footer-col a, .site-footer address { display: block; color: #b7c2d9; padding: .22rem 0; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 24px 26px; font-size: .8rem; color: #93a1bf; }
.footer-bottom p { margin: 0 0 .3rem; }
@media (max-width: 780px) { .footer-inner { grid-template-columns: 1fr; } }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero { padding: 60px 0 44px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.hero-actions { display: flex; gap: .8rem; margin-top: 1.6rem; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .6rem; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.card-flat { box-shadow: none; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 1.25rem; margin-bottom: .9rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── Status pills ────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; padding: .25rem .7rem; letter-spacing: .01em;
  background: var(--border); color: var(--brand);
}
.pill-ok { background: var(--accent-soft); color: var(--accent); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-live::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ── Key/value data panels — the "what the partner holds" view ────────── */
.kv { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: .1rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .86rem; padding: .42rem 0; border-bottom: 1px dashed var(--border); }
.kv dd { margin: 0; font-weight: 600; font-size: .92rem; padding: .42rem 0; border-bottom: 1px dashed var(--border); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: none; }
.kv .changed { color: var(--accent); }
.kv .empty { color: var(--muted); font-weight: 400; font-style: italic; }

.field-list li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.field-list li:last-child { border-bottom: none; }
.field-list .tick { color: var(--accent); font-weight: 700; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
table.data tr:last-child td { border-bottom: none; }
table.data td.mono { font-family: var(--mono); font-size: .82rem; color: var(--muted); }

/* ── Timeline — a sequence of events with a status each ───────────────── */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ''; position: absolute; left: .35rem; top: .4rem; bottom: .4rem; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: .5rem 0; font-size: .92rem; }
.timeline li::before { content: ''; position: absolute; left: -1.6rem; top: .95rem; width: 10px; height: 10px; border-radius: 999px; background: var(--border); border: 2px solid var(--surface); }
.timeline li.done::before { background: var(--accent); }
.timeline li.now::before { background: var(--brand); }
.timeline time { display: block; color: var(--muted); font-size: .78rem; }

/* ── Notices ─────────────────────────────────────────────────────────── */
.notice { border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-size: .9rem; margin: 1rem 0; border: 1px solid transparent; }
.notice-ok { background: var(--accent-soft); color: var(--accent); border-color: rgba(15, 157, 118, .2); }
.notice-warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(183, 121, 31, .2); }
.notice-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(192, 57, 43, .2); }
.notice-info { background: var(--surface-2); color: var(--muted); border-color: var(--border); }

/* ── Forms ───────────────────────────────────────────────────────────── */
form label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 1.1rem; color: var(--brand); }
form input, form select, form textarea {
  display: block; width: 100%; margin-top: .4rem; padding: .65rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: .95rem; font-family: inherit; background: var(--surface); color: var(--text);
}
form input:focus, form select:focus, form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-inline { display: flex; gap: .6rem; align-items: flex-end; }
.field-inline label { flex: 1; margin-bottom: 0; }
.checkbox-row { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .9rem; color: var(--text); margin-bottom: .6rem; }
.checkbox-row input { width: auto; margin: .2rem 0 0; }

/* ── The Squiryl consent card (the page that holds <squiryl-button>) ──── */
.squiryl-card { text-align: center; padding: 2rem 1.6rem; }
.squiryl-card .status-line { margin-top: 1rem; min-height: 1.4rem; }
.consent-scope { text-align: left; max-width: 380px; margin: 1.2rem auto 0; }
.consent-scope h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .8rem 0 .3rem; }

/* ── Empty states ────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .card-icon { margin: 0 auto .9rem; }

/* ── Log / raw output blocks ─────────────────────────────────────────── */
pre.block {
  background: var(--brand); color: #d9e2f2; border-radius: var(--radius-sm); padding: 1rem 1.1rem;
  overflow-x: auto; font-family: var(--mono); font-size: .8rem; line-height: 1.5; margin: 0;
}
pre.block .k { color: #8fd0b6; }
