/* Statebase consumer app — palette and component system.
   Values match docs/statebase-consumer-design.md Section 9 exactly (muted pastel + scattered
   shapes, dark-ink text throughout for verified WCAG contrast). */

:root {
  --ink: #262C3D;
  --ink-soft: #4B5266;
  --bg: #F7F2E9;
  --bg-soft: #F1EADC;
  --navy: #1E2636;

  --yellow: #E8DCAE;       --yellow-deep: #D9C589;
  --mint: #B9D2C3;         --mint-deep: #8EBBA5;
  --peach: #E6C4AE;        --peach-deep: #D7A585;
  --lavender: #CFC6DE;     --lavender-deep: #B3A3CC;
  --blue: #BACCDC;         --blue-deep: #8FADC6;
  --pink: #E3C2CC;         --pink-deep: #CE9EAE;

  --coral: #D98A72;        --coral-deep: #C7704F;
  --card-badge: rgba(255, 255, 255, .6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, sans-serif;
}

h1, h2, h3 { font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif; margin: 0; }
a { color: var(--ink); }
a:hover { color: var(--coral-deep); }
button { font-family: inherit; cursor: pointer; }

.page { position: relative; overflow: hidden; }

/* ---- scattered background shapes (decorative, behind all content) ---- */
.shape-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.shape-layer .shape { position: absolute; opacity: .45; }
.shape-layer .circle { border-radius: 50%; }
.shape-layer .square { border-radius: 8px; }
.shape-layer .triangle {
  width: 0; height: 0;
  background: none !important;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 32px solid currentColor;
}

.content { position: relative; z-index: 1; }

/* ---- header ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; width: 100%; margin: 0 auto; padding: 24px 24px 0; box-sizing: border-box;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
  width: 34px; height: 34px; border-radius: 10px; background: var(--navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 19px; }

.btn {
  font-weight: 800; font-size: 14px; padding: 10px 22px;
  border-radius: 999px; border: 2.5px solid var(--ink);
  background: var(--coral); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.btn:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.btn-ghost { background: #fff; }

/* ---- hero ---- */
.hero { max-width: 1080px; width: 100%; margin: 0 auto; padding: 56px 24px 40px; box-sizing: border-box; }
.hero h1 { font-size: 48px; line-height: 1.1; font-weight: 800; max-width: 640px; }
.highlight { position: relative; white-space: nowrap; }
.highlight::before {
  content: ""; position: absolute; left: -4px; right: -4px; bottom: 4px; top: 38%;
  background: var(--yellow); border-radius: 6px; z-index: -1; transform: rotate(-1.5deg);
}
.hero p.subtitle { margin-top: 16px; font-size: 19px; color: var(--ink-soft); font-weight: 600; }

.category-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 32px;
}
@media (max-width: 640px) { .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.category-card {
  text-align: left; border: 2.5px solid var(--ink); border-radius: 20px; padding: 20px;
  box-shadow: 4px 4px 0 var(--ink); background: var(--bg);
}
.category-card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.category-card .badge {
  width: 46px; height: 46px; border-radius: 50%; background: var(--card-badge);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.category-card .name { font-family: 'Baloo 2'; font-weight: 700; font-size: 19px; }
.category-card .sub { font-size: 13px; color: var(--ink-soft); font-weight: 700; margin-top: 2px; }

/* ---- pick a category (secondary, below the three-taps overview) ---- */
.pick-category { padding: 52px 24px; }
.pick-category .inner { max-width: 1080px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.pick-category h2 { font-size: 26px; font-weight: 800; margin-bottom: 24px; }

/* ---- three taps ---- */
.three-taps { background: var(--navy); margin-top: 48px; padding: 44px 24px; }
.three-taps .inner { max-width: 1080px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.three-taps h2 { color: #fff; font-size: 28px; font-weight: 800; margin-bottom: 28px; }
.three-taps .steps { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.three-taps .step-list { display: flex; flex-wrap: wrap; gap: 36px; }
.three-taps .step { display: flex; align-items: center; gap: 12px; }
.three-taps .num {
  width: 38px; height: 38px; border-radius: 50%; color: var(--ink); font-weight: 800;
  font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.three-taps .label { color: #E7E9F0; font-weight: 700; font-size: 15px; }

/* ---- examples ---- */
.examples { background: var(--bg-soft); padding: 52px 24px; }
.examples .inner { max-width: 1080px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.examples h2 { font-size: 26px; font-weight: 800; margin-bottom: 24px; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 760px) { .example-grid { grid-template-columns: 1fr; } }
.example-card { background: #fff; border: 2.5px solid var(--ink); border-radius: 18px; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); }
.example-card .head { padding: 12px 16px; font-family: 'Baloo 2'; font-weight: 700; font-size: 16px; border-bottom: 2.5px solid var(--ink); }
.example-card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.example-card .row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.example-card .row.total { font-weight: 800; color: var(--ink); border-radius: 8px; padding: 6px 8px; margin-top: 4px; }

/* ---- FAQ ---- */
.faq { padding: 52px 24px 40px; }
.faq .inner { max-width: 720px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.faq h2 { font-size: 24px; font-weight: 800; margin-bottom: 18px; }
.faq details {
  background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px;
}
.faq summary { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.faq p { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }

/* ---- footer ---- */
.site-footer { border-top: 1.5px solid rgba(38, 44, 61, .15); padding: 18px 24px; }
.site-footer .inner {
  max-width: 1080px; width: 100%; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; box-sizing: border-box; flex-wrap: wrap; gap: 8px;
}
.site-footer .links { display: flex; gap: 16px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* ======================= wizard modal ======================= */
.wizard-overlay {
  position: fixed; inset: 0; background: rgba(38, 44, 61, .45); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.wizard-overlay[hidden] { display: none; }

.wizard {
  background: var(--bg); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: 6px 6px 0 var(--ink); max-width: 880px; width: 100%; max-height: 90vh;
  overflow: auto; display: flex;
}
@media (max-width: 720px) { .wizard { flex-direction: column; max-height: 94vh; } }

.wizard-left { flex: 1 1 420px; padding: 28px; min-width: 0; }
.wizard-right {
  flex: 0 0 280px; background: var(--bg-soft); border-left: 3px solid var(--ink);
  padding: 24px; display: flex; flex-direction: column; align-items: center;
}
@media (max-width: 720px) { .wizard-right { border-left: none; border-top: 3px solid var(--ink); flex: none; } }

.wizard-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.wizard-progress { flex: 1; display: flex; gap: 6px; }
.wizard-progress .seg { height: 6px; border-radius: 4px; flex: 1; background: rgba(38,44,61,.15); }
.wizard-progress .seg.done { background: var(--coral); }
.wizard-close {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); background: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0;
}

.wizard-question { font-size: 24px; font-weight: 800; margin-bottom: 18px; }

.wizard-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.wizard-option {
  text-align: left; border: 2.5px solid var(--ink); border-radius: 14px; padding: 14px 16px;
  background: #fff; font-weight: 700; font-size: 14px; box-shadow: 3px 3px 0 var(--ink);
}
.wizard-option.selected { background: var(--coral); }
.wizard-option small { display: block; font-weight: 600; color: var(--ink-soft); margin-top: 3px; }

.wizard-field { margin-bottom: 14px; }
.wizard-field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--ink-soft); }
.wizard-field input[type=text] {
  width: 100%; font-family: inherit; font-size: 15px; padding: 10px 12px;
  border: 2px solid var(--ink); border-radius: 10px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.chip button { background: none; border: none; font-weight: 800; color: var(--ink-soft); padding: 0; line-height: 1; }

.wizard-nav { display: flex; justify-content: space-between; margin-top: 24px; }
.wizard-nav .btn[disabled] { opacity: .45; pointer-events: none; }

/* live preview panel */
.phone {
  width: 180px; background: #fff; border: 3px solid var(--ink); border-radius: 20px;
  padding: 14px 12px; box-shadow: 4px 4px 0 var(--ink);
}
.phone .ph-accent { height: 7px; border-radius: 4px; margin-bottom: 10px; }
.phone .ph-title { font-family: 'Baloo 2'; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.phone .ph-row { font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 3px 0; border-bottom: 1px solid rgba(38,44,61,.1); }
.phone .ph-empty { font-size: 11px; color: var(--ink-soft); font-style: italic; }
.wizard-right .preview-label { font-size: 12px; font-weight: 800; color: var(--ink-soft); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }

/* finished screen */
.wizard-done .prompt-box {
  background: var(--navy); color: #E7E9F0; border-radius: 14px; padding: 16px;
  font-family: ui-monospace, monospace; font-size: 11px; line-height: 1.5; white-space: pre-wrap;
  max-height: 260px; overflow: auto; margin: 16px 0;
}
.wizard-done .copy-status { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-left: 10px; }

/* done screen: the raw-prompt edit is a secondary, low-emphasis link, not a default-visible
   mode toggle — it sits quietly below the primary prompt/copy flow until someone wants it */
.link-btn {
  background: none; border: none; padding: 0; margin-top: 10px;
  font-weight: 700; font-size: 12.5px; color: var(--ink-soft); text-decoration: underline;
}
.link-btn:hover { color: var(--coral-deep); }

.advanced-warning {
  font-size: 12.5px; font-weight: 700; color: var(--coral-deep); margin: 0 0 10px;
  line-height: 1.4;
}

/* advanced mode: editable "ask" box, styled distinctly from the readonly navy prompt-box so it
   reads as something you can type into, not just view */
textarea.ask-edit {
  width: 100%; font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.5;
  padding: 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fff;
  color: var(--ink); resize: vertical;
}

/* theme step: color swatches, not text buttons — picking a color is a visual choice */
.theme-swatches { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.theme-swatch {
  width: 48px; height: 48px; border-radius: 50%; border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); display: flex; align-items: center; justify-content: center;
}
.theme-swatch.selected { outline: 3px solid var(--ink); outline-offset: 3px; }
.theme-swatch .swatch-check { font-weight: 900; font-size: 18px; color: var(--ink); }

/* done screen: paste-it-in copy + giant launch buttons — the primary action on this screen is
   "go do it," not "read the prompt," so these outsize every other button in the wizard */
.done-byline { font-weight: 800; font-size: 18px; margin: -8px 0 16px; color: var(--ink); }

.btn-giant { font-size: 16px; padding: 16px 18px; width: 100%; box-shadow: 4px 4px 0 var(--ink); }

.provider-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px;
}
.provider-hint { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; margin: 8px 0 0; }
.btn-copy-giant { margin-top: 14px; }
