/* Social Breathalyzer — base styles
 * Mobile-first. Sokolove brand palette declared as CSS custom properties at
 * :root so Stage 14 can tighten the palette without touching every selector.
 */

:root {
  /* Sokolove Law brand palette (parent CLAUDE.md → "Web Tools (HTML/JS)") */
  --navy: #113c6e;
  --dark-navy: #081f3a;
  --maroon: #750a0b;
  --deep-red: #8a1f03;
  --gold: #ffbc3e;
  --link-blue: #1377b9;
  --text-gray: #525a60;
  --light-gray: #f9f9f9;
  --white: #ffffff;
  --border: #d8dde2;

  /* Derived */
  --shadow-sm: 0 1px 2px rgba(8, 31, 58, 0.06);
  --shadow-md: 0 4px 12px rgba(8, 31, 58, 0.08);
  --radius: 6px;
  --max-content: 56rem;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--dark-navy);
  background: var(--light-gray);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link-blue); text-decoration: underline; }
a:hover { color: var(--navy); }

h1, h2, h3, h4 {
  color: var(--dark-navy);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

small, .muted { color: var(--text-gray); font-size: 0.875rem; }

/* ---------- Layout ---------- */

.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 0.875rem 1rem;
}
.site-header .brand {
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.site-header .brand-tag {
  font-weight: 400;
  opacity: 0.75;
  margin-left: 0.5rem;
  font-size: 0.875rem;
}

main {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  color: var(--text-gray);
  font-size: 0.85rem;
}
.site-footer a { color: var(--text-gray); margin: 0 0.5rem; }

/* ---------- Cards ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: filter 120ms ease, transform 60ms ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover:not(:disabled) { background: var(--dark-navy); }

.btn-cta {
  background: var(--gold);
  color: var(--dark-navy);
}
.btn-cta:hover:not(:disabled) { filter: brightness(0.95); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--light-gray); }

/* Inline error banner shown by wizard.js after a failed /api/intake submit. */
.inline-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #c0392b;
  background: #fdecea;
  color: #7a1f1c;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* ---------- Forms ---------- */

fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}
legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-navy);
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--dark-navy);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  display: block;
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--dark-navy);
  margin-bottom: 0.875rem;
}
input:focus,
select:focus {
  outline: 2px solid var(--link-blue);
  outline-offset: 1px;
  border-color: var(--link-blue);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin: 0.75rem 0;
}
.checkbox-row input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
}
.checkbox-row label {
  margin: 0;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.35;
}

.field-error {
  color: var(--maroon);
  font-size: 0.825rem;
  margin: -0.5rem 0 0.625rem;
}

/* ---------- Wizard ---------- */

.wizard-progress {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 1.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-gray);
}
.wizard-progress .pill {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.wizard-progress .pill[aria-current="step"] {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.wizard-progress .pill.done {
  background: var(--light-gray);
  color: var(--dark-navy);
  border-color: var(--border);
}

.step { display: none; }
.step.active { display: block; }

.step-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(180deg, var(--white) 0%, var(--light-gray) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: 1.85rem;
  color: var(--navy);
}
.hero .lede {
  font-size: 1.05rem;
  color: var(--dark-navy);
  margin: 0.5rem 0 1rem;
}

.privacy-promise {
  background: var(--light-gray);
  border-left: 3px solid var(--maroon);
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
}

/* ---------- Platform picker ---------- */

.platform-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.platform-option {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  cursor: pointer;
  background: var(--white);
}
.platform-option input[type="checkbox"] {
  margin-top: 0.2rem;
}
.platform-option .pname {
  font-weight: 600;
  color: var(--dark-navy);
}
.platform-option .pdesc {
  display: block;
  font-size: 0.85rem;
  color: var(--text-gray);
}
.platform-option:has(input:checked) {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(17, 60, 110, 0.15);
}

/* ---------- Walkthrough ---------- */

.walkthrough h2 .platform-tag {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-weight: 500;
}

.walkthrough ol {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}
.walkthrough ol li {
  margin-bottom: 0.875rem;
}
.walkthrough .screenshot-placeholder {
  display: block;
  margin-top: 0.5rem;
  background: var(--light-gray);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  color: var(--text-gray);
  font-size: 0.825rem;
}

/* Stage 12: walkthrough step cards (currently used by the TikTok branch). */
.walkthrough-steps {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1rem;
}
.walkthrough-step-card {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.walkthrough-step-num {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  border-radius: 999px;
  font-size: 0.95rem;
}
.walkthrough-step-body {
  flex: 1;
  min-width: 0;
}
.walkthrough-step-text {
  margin: 0 0 0.5rem;
}
.walkthrough-step-img {
  display: block;
  max-width: 280px;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--light-gray);
}
/* Stage 13: YouTube step 1 needs to stand out — if watch history is paused
   the export is empty and the user gets a confusing failure email. The
   maroon left bar + tinted background + label make this visually distinct
   from the other steps. */
.walkthrough-step-warn {
  background: #fdf3f3;
  border-color: var(--maroon);
  border-left-width: 4px;
}
.walkthrough-step-warn .walkthrough-step-num {
  background: var(--maroon);
}
.walkthrough-step-warn-label {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Report page ---------- */

.report-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem;
}
.stat .label {
  font-size: 0.75rem;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 0.15rem;
}
.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.chart-card h3 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--dark-navy);
}
.chart-card .chart-wrap {
  position: relative;
  height: 260px;
}
.methodology {
  font-size: 0.825rem;
  color: var(--text-gray);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1.5rem;
}

/* ---------- Responsive ---------- */

@media (min-width: 768px) {
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.25rem; }
  main { padding: 2rem 1.5rem 4rem; }
  .platform-grid {
    grid-template-columns: 1fr 1fr;
  }
  .report-stats {
    grid-template-columns: repeat(5, 1fr);
  }
  .chart-card .chart-wrap { height: 320px; }
}

@media (min-width: 1024px) {
  main { padding: 2.5rem 2rem 5rem; }
}

/* ---------- 404 ---------- */
.notfound {
  text-align: center;
  padding: 3rem 1rem;
}
.notfound .code {
  font-size: 4rem;
  color: var(--maroon);
  font-weight: 800;
  margin-bottom: 0.5rem;
}
