/* QuizLive design tokens and shared components.
   Brand motif: the four answer shapes (▲ ◆ ● ■) in coral, sky, sun and teal.
   Everything else stays quiet: indigo ink on cool white, one marigold action colour. */
:root {
  --ink: #1B1446;
  --ink-2: #3B3670;
  --muted: #625F86;
  --line: #E1E1EE;
  --paper: #F5F6FA;
  --card: #FFFFFF;
  --stage: #1E1850;
  --stage-2: #2A2369;
  --marigold: #F5B700;
  --marigold-deep: #C99300;
  --coral: #F2545B;
  --sky: #3A86FF;
  --sun: #FFC93C;
  --teal: #19B3A3;
  --good: #128C5E;
  --bad: #C8323A;
  --focus: #3A86FF;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--text); color: var(--ink); background: var(--paper); line-height: 1.5; font-size: 16px; }
h1, h2, h3, .display { font-family: var(--display); line-height: 1.12; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { max-width: 68ch; }
a { color: var(--ink); text-underline-offset: 3px; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- buttons: a little "buzzer" press ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem/1 var(--text); color: var(--ink); background: var(--marigold);
  border: none; border-bottom: 4px solid var(--marigold-deep); border-radius: 12px;
  padding: 13px 22px 11px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .06s, border-bottom-width .06s;
}
.btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.quiet { background: var(--card); border: 1.5px solid var(--line); border-bottom: 3px solid #CFCFE2; color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; border-bottom-color: #0d0a26; }
.btn.danger { background: var(--card); color: var(--bad); border: 1.5px solid #F2C4C6; border-bottom: 3px solid #E8A9AC; }
.btn.small { padding: 9px 14px 7px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: none; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- forms ---------- */
label { font-weight: 600; font-size: .92rem; display: block; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=number], input[type=url], input[type=search], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: var(--card); width: 100%;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(58,134,255,.18); }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ink); }

.error-box { background: #FDECEC; color: var(--bad); border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 12px 0; }
.ok-box { background: #E5F6EE; color: var(--good); border-radius: 10px; padding: 10px 14px; font-weight: 600; margin: 12px 0; }

/* ---------- the shape motif ---------- */
.shape { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 6px; color: #fff; font-size: .8em; line-height: 1; }
.s0 { background: var(--coral); } .s1 { background: var(--sky); } .s2 { background: var(--sun); color: var(--ink); } .s3 { background: var(--teal); }
.shape-row { display: inline-flex; gap: 4px; }
.shape-row i { width: 10px; height: 10px; display: block; }
.shape-row i:nth-child(1) { background: var(--coral); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.shape-row i:nth-child(2) { background: var(--sky); transform: rotate(45deg) scale(.82); }
.shape-row i:nth-child(3) { background: var(--sun); border-radius: 50%; }
.shape-row i:nth-child(4) { background: var(--teal); }

/* ---------- site header / footer ---------- */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px clamp(16px, 4vw, 40px); max-width: 1180px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.site-head nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.site-head nav a:not(.btn) { padding: 8px 12px; text-decoration: none; font-weight: 600; border-radius: 8px; }
.site-head nav a:not(.btn):hover { background: #EBEBF5; }
@media (max-width: 560px) { .site-head { padding-top: 12px; padding-bottom: 12px; } .site-head nav { flex-wrap: nowrap; gap: 2px; } .site-head nav a:not(.btn) { padding: 8px; font-size: .95rem; } .site-head nav a[href="/pricing"] { display: none; } }
.site-foot { border-top: 1px solid var(--line); margin-top: 72px; }
.site-foot .inner { max-width: 1180px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; font-size: .9rem; color: var(--muted); }
.site-foot a { color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 10px 18px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
.side a.nav:hover { background: var(--paper); }
.side a.nav.on { background: var(--ink); color: #fff; }
.side .plan-chip { margin-top: auto; background: var(--paper); border-radius: 12px; padding: 12px; font-size: .88rem; }
.side .plan-chip b { display: block; font-size: 1rem; }
.main { padding: 28px clamp(16px, 3.5vw, 44px) 80px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--line); gap: 2px; }
  .side .brand { padding: 4px 8px; margin-right: auto; }
  .side a.nav { padding: 8px 10px; font-size: .92rem; }
  .side .plan-chip { display: none; }
}

/* ---------- surfaces ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 700; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #EDEDF6; color: var(--ink-2); }
.tag.green { background: #E3F5EC; color: var(--good); }
.tag.amber { background: #FFF4D6; color: #8A6400; }
.tag.red { background: #FDECEC; color: var(--bad); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1.5px solid var(--line); }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data td.r, table.data th.r { text-align: right; }
.table-scroll { overflow-x: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stat { font-family: var(--display); font-size: 2rem; font-weight: 800; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(27,20,70,.45); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { background: var(--card); border-radius: var(--radius-l); padding: 24px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
