/* Design tokens. Swap these for Thrive brand values once confirmed. */
:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --text: #1c2321;
  --muted: #5a6662;
  --line: #d8ddda;
  --accent: #0b6b5d;
  --accent-hover: #08574b;
  --on-accent: #ffffff;
  --error: #b42318;
  --focus: #1a73e8;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --surface: #1b211f;
    --text: #e6ebe9;
    --muted: #9eaaa6;
    --line: #2d3532;
    --accent: #4fc2ad;
    --accent-hover: #6fd3c0;
    --on-accent: #0b1513;
    --error: #ff8a80;
    --focus: #8ab4f8;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus { outline: none; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 880px; margin: 0 auto; padding: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-divider { width: 1px; height: 20px; background: var(--line); }
.brand-sub { color: var(--muted); font-size: 0.95rem; }

.site-footer { margin-top: auto; padding: 24px 16px 32px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.contact { user-select: all; font-weight: 600; color: var(--text); }

/* Layout */
.app { flex: 1; }
.page { max-width: 880px; margin: 0 auto; padding: 32px 16px 48px; display: grid; gap: 24px; }

.intro h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.2; margin: 0 0 12px; text-wrap: balance; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lede { margin: 0; color: var(--muted); max-width: 68ch; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; }
.panel h2 { margin: 0; font-size: 1.25rem; }
.panel > p { margin: 0; max-width: 68ch; }
.hint { color: var(--muted); margin: 0; }

/* Fields */
.location-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 0.95rem; }
.optional { font-weight: 400; color: var(--muted); }
.help { margin: 0; color: var(--muted); font-size: 0.88rem; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--error); }
.error { margin: 0; color: var(--error); font-size: 0.88rem; font-weight: 500; }

/* Request cards */
.requests { margin-top: 4px; }
.request-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.request-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.request-text { flex: 1 1 320px; min-width: 0; }
.request-text h3 { margin: 0 0 4px; font-size: 1.05rem; }
.request-text p { margin: 0; color: var(--muted); font-size: 0.93rem; }

.notice { border: 1px solid var(--line); border-left: 4px solid var(--error); border-radius: var(--radius); padding: 14px 16px; }
.notice h3 { margin: 0 0 4px; font-size: 1rem; }
.notice p { margin: 0; color: var(--muted); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button.secondary { background: transparent; color: var(--accent); }
.button.secondary:hover { background: transparent; color: var(--accent-hover); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Form + review */
.location-line { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.location-line .label { color: var(--muted); }
.summary { margin: 0; display: grid; gap: 0; }
.summary > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.summary dd.empty { color: var(--muted); font-style: italic; }
.edit-link { justify-self: start; }
.captcha { min-height: 65px; }

/* Success */
.success { justify-items: start; }
.success h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.success p { margin: 0; }
.success-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); position: relative; }
.success-mark::after {
  content: ""; position: absolute; left: 15px; top: 9px; width: 10px; height: 20px;
  border: solid var(--on-accent); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.reference code { font-size: 0.95rem; }

.noscript { max-width: 880px; margin: 16px auto; padding: 0 16px; }

@media (max-width: 560px) {
  .panel { padding: 18px; }
  .summary > div { grid-template-columns: 1fr; gap: 2px; }
  .request-card .button { width: 100%; }
}

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