/* The Missing Project: shared styles for the public site, sign-in, dashboard and case pages. */
:root {
  --red: #d7192f;
  --red-dark: #b0101f;
  --red-soft: #fdecee;
  --green: #12804a;
  --green-soft: #e3f5ec;
  --amber: #a35a00;
  --amber-soft: #fff3dc;
  --ink: #0e1116;
  --ink-2: #2a2f38;
  --muted: #646b77;
  --line: #e5e6ea;
  --line-strong: #d4d6dc;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f1f1ef;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(14, 17, 22, 0.05);
  --shadow: 0 1px 2px rgba(14, 17, 22, 0.04), 0 8px 24px -8px rgba(14, 17, 22, 0.10);
  --shadow-lg: 0 24px 64px -16px rgba(14, 17, 22, 0.28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); line-height: 1.55; font-size: 15px; }
a { color: var(--red); text-underline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
[hidden] { display: none !important; }

.config-warning {
  background: var(--amber-soft); color: #6b4b00; padding: 10px 16px; font-size: 14px;
  border-bottom: 1px solid #f0d58a; text-align: center;
}

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--red); color: #fff;
  display: grid; place-items: center; flex: none;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.brand-mark svg { width: 18px; height: 18px; }

/* ---------- Buttons and inputs ---------- */
button, .button {
  font: inherit; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 10px 16px; cursor: pointer; background: var(--ink); color: #fff; line-height: 1.2;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
button:active:not(:disabled), .button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: progress; }
button:hover:not(:disabled), .button:hover { background: var(--ink-2); }
button.primary, .button.primary { background: var(--red); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 6px 16px -6px rgba(215, 25, 47, 0.55); }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--red-dark); }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
button.secondary:hover:not(:disabled), .button.secondary:hover { background: var(--surface-2); }
button.success { background: var(--green); }
button.success:hover:not(:disabled) { background: #0d6b3d; }
button.ghost, .button.ghost { background: transparent; color: var(--ink); }
button.ghost:hover:not(:disabled), .button.ghost:hover { background: rgba(14, 17, 22, 0.06); }
button.link { background: none; color: var(--red); padding: 0; font-weight: 500; box-shadow: none; }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
.button.lg, button.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.button.block, button.block { width: 100%; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input, select, textarea {
  font: inherit; font-size: 15px; width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #9aa0aa; }
input:hover, select:hover, textarea:hover { border-color: #bfc2ca; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(215, 25, 47, 0.15);
}
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--ink); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); flex: none; }
.error-text { color: var(--red); font-size: 14px; min-height: 1.2em; margin: 4px 0 10px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 24px; }
.card > h2:first-child { margin-top: 0; }

/* Segmented control (tabs, toggles) */
.tabs, .segmented { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tabs { margin-bottom: 22px; }
.tabs button, .segmented button { flex: 1; background: none; color: var(--muted); padding: 8px 12px; box-shadow: none; border: 0; }
.tabs button:hover:not(:disabled), .segmented button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.tabs button[aria-selected="true"], .segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Sign-in page ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side {
  background: radial-gradient(1200px 600px at -10% -10%, #3a0a12 0%, transparent 60%), var(--ink);
  color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-side .brand { color: #fff; }
.auth-side h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 800; letter-spacing: -0.03em; max-width: 14ch; }
.auth-side p { color: #b9bec7; max-width: 42ch; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #d9dce1; font-size: 14px; }
.auth-side li { display: flex; gap: 10px; align-items: flex-start; }
.auth-side li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-top: 7px; flex: none; }
.auth-main { display: grid; place-items: center; padding: 40px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { margin-bottom: 4px; }
.auth-box > .hint { display: block; margin-bottom: 24px; }
.back-link { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 28px; }
.back-link:hover { color: var(--ink); }

/* ---------- Dashboard ---------- */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 64px;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav button { background: none; color: var(--muted); padding: 8px 12px; box-shadow: none; white-space: nowrap; }
.nav button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.nav button[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.count { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; line-height: 1.5; }
.me { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.me .who { line-height: 1.3; text-align: right; }
.me .who strong { display: block; color: var(--ink); font-weight: 600; }
main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.new-case { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.new-case fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.new-case fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 6px; }
.new-case legend { font-weight: 700; font-size: 15px; margin-bottom: 14px; padding: 0; letter-spacing: -0.01em; }
.preview { position: sticky; top: 88px; }
.preview canvas { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); background: #fff; display: block; border: 1px solid var(--line); }
.preview-toggle { margin-bottom: 12px; }
.photo-drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 28px 18px; text-align: center;
  color: var(--muted); cursor: pointer; background: var(--surface-2); font-weight: 500; font-size: 14px;
  transition: border-color 0.15s, background-color 0.15s; margin: 0;
}
.photo-drop:hover { border-color: var(--red); background: var(--red-soft); color: var(--ink); }
.photo-drop img { max-height: 180px; max-width: 100%; border-radius: 10px; display: block; margin: 0 auto 10px; }
.new-case fieldset.private-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 4px; margin: 14px 0 18px; }
.private-box legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; }

.filters { margin-bottom: 20px; display: inline-flex; flex-wrap: wrap; }
.filters button { flex: none; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.case-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: var(--ink); font-weight: 400;
  display: block; width: 100%; transition: box-shadow 0.2s, transform 0.2s; text-decoration: none;
}
.case-card:hover:not(:disabled) { background: var(--surface); box-shadow: var(--shadow); transform: translateY(-2px); }
.case-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; display: block; background: #e6e8eb; }
.case-card .body { padding: 14px 16px 16px; }
.case-card strong { display: block; font-size: 16px; letter-spacing: -0.01em; }
.case-card .meta { color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; margin-top: 8px; background: var(--surface-2); color: var(--muted); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pending_review, .chip.new { background: var(--amber-soft); color: var(--amber); }
.chip.live, .chip.tip { background: var(--red-soft); color: var(--red); }
.chip.resolved, .chip.handled { background: var(--green-soft); color: var(--green); }
.chip.contact { background: #e8eefb; color: #2b4fae; }
.chip.billboard { background: #efe8fb; color: #6a3bb5; }
.empty { color: var(--muted); padding: 48px 0; text-align: center; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(1000px, calc(100% - 32px)); max-height: calc(100vh - 40px); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog::backdrop { background: rgba(14, 17, 22, 0.55); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); z-index: 1; }
.dialog-head h2 { margin: 0; }
.dialog-head .chip { margin-top: 4px; }
.dialog-body { padding: 24px; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; }
.flyer-thumbs { display: grid; gap: 12px; align-content: start; }
.flyer-thumbs img { width: 100%; border-radius: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); display: block; }
.details { margin: 0; }
.details dt { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 14px; }
.details dt:first-child { margin-top: 0; }
.details dd { margin: 3px 0 0; }
.caption { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.results { list-style: none; padding: 0; margin: 8px 0 0; }
.results li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.results li:last-child { border-bottom: 0; }
.results .ok { color: var(--green); font-weight: 700; }
.results .fail { color: var(--red); font-weight: 700; }
.notice { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-top: 14px; }
.notice.warn { background: var(--amber-soft); color: #6b4b00; }
.notice.info { background: #edf1f7; color: #2c3a4b; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.table td.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table button { padding: 7px 11px; font-size: 13px; }
.card.flush { padding: 6px 14px; }
.stack > * + * { margin-top: 20px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

/* Inbox */
.inbox-list { display: grid; gap: 12px; }
.inbox-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.inbox-item.is-new { border-left: 3px solid var(--red); }
.inbox-item header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.inbox-item header .chip { margin: 0; }
.inbox-item header time { color: var(--muted); font-size: 13px; margin-left: auto; }
.inbox-item .msg { white-space: pre-wrap; margin: 8px 0; }
.inbox-item .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.inbox-item .facts b { color: var(--ink); font-weight: 600; }
.inbox-item .actions { margin-top: 12px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }

#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 50; max-width: calc(100% - 40px); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 400px; animation: toast-in 0.25s ease; }
.toast-error { background: var(--red); }
.toast-success { background: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Public site ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20; background: rgba(246, 246, 244, 0.85);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 68px; display: flex; align-items: center; gap: 24px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { background: rgba(14, 17, 22, 0.05); }
.menu-btn { display: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--red); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.hero { padding: 72px 0 88px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 900px; height: 900px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(215, 25, 47, 0.12), transparent); pointer-events: none;
}
.hero .container { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; align-items: center; position: relative; }
.hero h1 { font-size: clamp(38px, 5.6vw, 66px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero .lede { font-size: 19px; color: var(--ink-2); max-width: 54ch; margin: 0 0 32px; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 10px; font-size: 13px; font-weight: 600; margin-bottom: 22px; box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; }
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(215, 25, 47, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(215, 25, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(215, 25, 47, 0); } }

/* Hero illustration: one alert fanning out to every channel */
.broadcast { position: relative; display: grid; gap: 14px; }
.broadcast .alert-card {
  background: var(--surface); border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  overflow: hidden; display: grid; grid-template-columns: 140px 1fr;
}
.alert-card .ph { background: linear-gradient(160deg, #d9dbe0, #b8bcc4); display: grid; place-items: end center; }
.alert-card .ph svg { width: 86%; display: block; }
.alert-card .tx { padding: 18px 20px; }
.alert-card .tag { display: inline-block; background: var(--red); color: #fff; font-weight: 800; letter-spacing: 0.06em; font-size: 13px; padding: 4px 10px; border-radius: 6px; }
.alert-card .nm { font-weight: 800; font-size: 20px; margin: 10px 0 2px; letter-spacing: -0.02em; }
.alert-card .ln { height: 8px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; }
.channels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.channel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.channel svg { width: 22px; height: 22px; display: block; margin: 0 auto 8px; color: var(--ink); }
.channel .ok { display: block; color: var(--green); font-size: 11px; margin-top: 2px; }

.notice-bar { background: var(--ink); color: #fff; font-size: 14px; }
.notice-bar .container { display: flex; gap: 10px; align-items: center; justify-content: center; padding-top: 12px; padding-bottom: 12px; text-align: center; }
.notice-bar strong { color: #fff; }
.notice-bar a { color: #fff; font-weight: 700; }

.alerts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.alerts-grid .case-card .tag { display: inline-block; background: var(--red); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 5px; margin-bottom: 8px; }
.empty-card { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.step::before { counter-increment: step; content: counter(step); width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.value { padding: 4px 0; }
.value h3 { font-size: 16px; margin-bottom: 4px; display: flex; gap: 10px; align-items: center; }
.value h3 svg { width: 20px; height: 20px; color: var(--red); flex: none; }
.value p { margin: 0; color: var(--muted); font-size: 14px; }

.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.team-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); }
.team-card h3 { font-size: 17px; margin: 0; }
.team-card .region { color: var(--muted); font-size: 13px; font-weight: 500; }
.team-card p { margin: 6px 0; font-size: 14px; color: var(--ink-2); }
.team-card .links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; margin-top: auto; padding-top: 10px; }
.team-card .links a { text-decoration: none; font-weight: 600; }
.team-card .links a:hover { text-decoration: underline; }
.team-card button { margin-top: 12px; align-self: flex-start; }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.split .section-head { margin-bottom: 24px; }
.checklist { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 14px; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; }
.checklist li::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312804a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat; margin-top: 1px; }
.checklist strong { display: block; }
.checklist span { color: var(--muted); font-size: 14px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.section.alt .form-card { background: var(--bg); box-shadow: none; }
.form-card h3 { font-size: 18px; margin-bottom: 4px; }
.form-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.form-done { text-align: center; padding: 28px 8px; }
.form-done .icon { width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; }
.form-done .icon svg { width: 26px; height: 26px; }
.callout { display: flex; gap: 12px; background: var(--red-soft); color: #7a0d19; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

.join-band { background: var(--ink); color: #fff; border-radius: 24px; padding: 48px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; position: relative; overflow: hidden; }
.join-band::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(closest-side, rgba(215, 25, 47, 0.45), transparent); }
.join-band h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.join-band p { color: #b9bec7; margin: 0; max-width: 60ch; }
.join-band .ctas { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.join-band .button.secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); box-shadow: none; }
.join-band .button.secondary:hover { background: rgba(255, 255, 255, 0.08); }

.site-footer { padding: 48px 0 56px; color: var(--muted); font-size: 14px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Public case page ---------- */
.case-page { max-width: 760px; margin: 0 auto; padding: 32px 20px 72px; }
.case-hero { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.case-banner { background: var(--red); color: #fff; font-weight: 900; font-size: clamp(30px, 8vw, 56px); text-align: center; letter-spacing: 0.08em; padding: 10px; line-height: 1.1; }
.case-hero .inner { padding: 28px; }
.case-hero h1 { font-size: clamp(28px, 5vw, 40px); margin: 0 0 18px; }
.case-photo { width: 100%; max-height: 600px; object-fit: cover; object-position: 50% 25%; display: block; background: #e6e8eb; }
.tip { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 20px 22px; margin-top: 24px; }
.tip a { color: #fff; font-size: clamp(26px, 6vw, 34px); font-weight: 800; text-decoration: none; letter-spacing: -0.02em; display: inline-block; margin-top: 4px; }

@media (max-width: 980px) {
  .hero .container, .split { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .values { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; gap: 20px; }
  .auth-side ul, .auth-side p { display: none; }
  .join-band { grid-template-columns: 1fr; padding: 36px 28px; }
}
@media (max-width: 860px) {
  .new-case { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 380px; }
  .dialog-body { grid-template-columns: 1fr; }
  .flyer-thumbs { grid-template-columns: 1fr 1fr; }
  .site-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .menu-btn { display: inline-flex; margin-left: auto; }
  .site-header .signin { display: none; }
  .site-nav.open + .signin { display: none; }
}
@media (max-width: 600px) {
  .container, main, .site-header .inner { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .topbar .brand-name, .me .who { display: none; }
  .table .hide-sm { display: none; }
  .section { padding: 64px 0; }
  .hero { padding: 40px 0 64px; }
  .steps { grid-template-columns: 1fr; }
  .channels { grid-template-columns: repeat(2, 1fr); }
  .broadcast .alert-card { grid-template-columns: 110px 1fr; }
  .card, .form-card { padding: 20px; }
  .case-hero .inner { padding: 20px; }
  .filters { display: flex; overflow-x: auto; }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-80px, 60px) scale(1.12); } }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(220%) skewX(-20deg); } }
@keyframes glow { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }

/* Hero entrance */
.hero .live-pill, .hero h1, .hero .lede, .hero .ctas { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero h1 { animation-delay: 0.08s; }
.hero .lede { animation-delay: 0.18s; }
.hero .ctas { animation-delay: 0.28s; }
.broadcast { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s both; }
.hero::before { animation: drift 16s ease-in-out infinite alternate; }
.broadcast .alert-card { animation: float 6s ease-in-out 1.3s infinite; }

/* The illustration: each channel goes from "Sending…" to "Posted" in turn, on a loop. */
.channel { transition: none; animation: ch-card 8s ease-in-out var(--d, 0s) infinite both; }
.channel .status { position: relative; display: block; height: 16px; margin-top: 2px; }
.channel .status > span { position: absolute; inset: 0; font-size: 11px; }
.channel .sending { color: var(--muted); animation: ch-sending 8s linear var(--d, 0s) infinite both; }
.channel .ok { margin: 0; animation: ch-ok 8s linear var(--d, 0s) infinite both; }
.channel:nth-child(1) { --d: 1.2s; }
.channel:nth-child(2) { --d: 1.6s; }
.channel:nth-child(3) { --d: 2s; }
.channel:nth-child(4) { --d: 2.4s; }
@keyframes ch-sending { 0%, 9% { opacity: 1; } 11%, 90% { opacity: 0; } 94%, 100% { opacity: 1; } }
@keyframes ch-ok { 0%, 9% { opacity: 0; transform: translateY(4px); } 12%, 90% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; } }
@keyframes ch-card {
  0%, 8% { transform: none; border-color: var(--line); box-shadow: var(--shadow-sm); }
  12% { transform: translateY(-4px) scale(1.05); border-color: #9fd9bb; box-shadow: 0 10px 24px -10px rgba(18, 128, 74, 0.45); }
  18%, 88% { transform: none; border-color: #c9ebd8; box-shadow: var(--shadow-sm); }
  94%, 100% { transform: none; border-color: var(--line); box-shadow: var(--shadow-sm); }
}

/* Scroll reveal (only when JavaScript is running; see the inline script in index.html) */
.anim [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s), transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s); }
.anim [data-reveal].in { opacity: 1; transform: none; }

/* Hover lift */
.step, .team-card, .value { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.step:hover, .team-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.step::before { transition: background-color 0.25s ease, transform 0.25s ease; }
.step:hover::before { background: var(--red); transform: rotate(-6deg); }
.alerts-grid .case-card img { transition: transform 0.5s ease; }
.alerts-grid .case-card:hover img { transform: scale(1.04); }
.alerts-grid .case-card { overflow: hidden; }

/* Shine across red buttons on hover */
button.primary, .button.primary { position: relative; overflow: hidden; isolation: isolate; }
button.primary::after, .button.primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: translateX(-120%) skewX(-20deg); pointer-events: none; }
button.primary:hover:not(:disabled)::after, .button.primary:hover::after { animation: shine 0.8s ease; }
.button.lg:hover, button.lg:hover:not(:disabled) { transform: translateY(-1px); }

/* Active menu item while scrolling */
.site-nav a { position: relative; transition: color 0.2s, background-color 0.2s; }
.site-nav a[aria-current="true"] { color: var(--red); }
.site-nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--red); transform: scaleX(0); transition: transform 0.3s ease; }
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }

.join-band::after { animation: glow 7s ease-in-out infinite; }
.form-done { animation: fade 0.4s ease both; }
.form-done .icon { animation: pop 0.55s cubic-bezier(0.2, 0.7, 0.2, 1.4) 0.1s both; }
.auth-box, .case-hero { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.auth-side > * { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.auth-side > *:nth-child(2) { animation-delay: 0.1s; }
.auth-side > *:nth-child(3) { animation-delay: 0.2s; }
.tabs button, .segmented button { transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .anim [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Social links and footer details ---------- */
.socials { display: flex; gap: 8px; }
.socials a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: color 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.socials a:hover { color: var(--red); border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.socials svg { width: 19px; height: 19px; }
.socials.labeled a { width: auto; padding: 0 16px 0 12px; gap: 8px; display: inline-flex; align-items: center; font-weight: 600; font-size: 14px; }
.follow-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.follow-row > span { font-weight: 600; }
.footer-meta { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }
.footer-meta a { font-weight: 600; }
.site-nav .nav-signin { display: none; }
@media (max-width: 860px) {
  .site-nav .nav-signin { display: block; color: var(--red); font-weight: 600; border-top: 1px solid var(--line); margin-top: 6px; border-radius: 0; }
}
