/* CAP -> WEA POC. Intentionally neutral, government-credible, accessible.
   Not the Agenius dark brand: a public-alert tool should read as civic and
   restrained. Severity colors follow alert-semantic convention. */

:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --steel: #134074;
  --ink: #1b1f24;
  --muted: #5c6670;
  --line: #d7dce2;
  --bg: #f4f6f9;
  --card: #ffffff;
  --pass: #0a7d3c;
  --pass-bg: #e7f4ec;
  --warn: #9a6700;
  --warn-bg: #fdf3e0;
  --fail: #b3261e;
  --fail-bg: #fbe9e8;
  --accent: #134074;
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

/* Intro splash */
.splash {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(160deg, #0b2545 0%, #13315c 55%, #134074 100%);
  overflow-y: auto;
}
.splash.dismissed { display: none; }
.splash-card {
  max-width: 600px; width: 100%; background: var(--card);
  border-radius: 12px; border-top: 4px solid #c9a227;
  padding: 2rem 2.25rem; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.splash-card .kicker { color: var(--steel); opacity: 1; }
.splash-card h1 { margin: .25rem 0 .15rem; font-size: 1.85rem; color: var(--navy); }
.splash-tagline { margin: 0 0 1rem; font-weight: 700; color: var(--steel); }
.splash-lede { font-size: .95rem; color: var(--ink); margin: 0 0 1.15rem; }
.splash-steps { list-style: none; margin: 0 0 1.15rem; padding: 0; display: grid; gap: .55rem; }
.splash-steps li { font-size: .88rem; display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; }
.splash-step {
  display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem;
  background: var(--navy); color: #fff; border-radius: 50%; font-size: .78rem; font-weight: 700;
}
.splash-boundary {
  font-size: .82rem; background: var(--warn-bg); border: 1px solid #f0d9a8;
  border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: 1.4rem;
}
.splash-boundary strong { color: var(--warn); }
.splash-enter { font-size: 1rem; padding: .7rem 1.5rem; }
.splash-foot { margin: 1rem 0 0; font-size: .76rem; color: var(--muted); }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

/* Masthead */
.masthead { background: var(--navy); color: #fff; border-bottom: 4px solid #c9a227; }
.masthead-inner {
  max-width: 1240px; margin: 0 auto; padding: 1.25rem 1.5rem;
  display: flex; gap: 2rem; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap;
}
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; opacity: .8; }
.masthead h1 { margin: .15rem 0 .1rem; font-size: 1.6rem; }
.tagline { margin: 0; font-weight: 600; color: #f0c14b; }
.boundary {
  max-width: 480px; font-size: .82rem; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius);
  padding: .7rem .9rem;
}
.boundary strong { color: #f0c14b; }

main { max-width: 1240px; margin: 0 auto; padding: 1.5rem; }

/* Controls */
.controls {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.control-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.control-row label { font-weight: 600; font-size: .9rem; }
.hint { margin: .6rem 0 0; color: var(--muted); font-size: .82rem; }

select, input[type=text], textarea {
  font-family: var(--sans); font-size: .92rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: .45rem .55rem;
  background: #fff;
}
textarea { width: 100%; font-family: var(--mono); font-size: .9rem; resize: vertical; }

button {
  font-family: var(--sans); font-size: .9rem; font-weight: 600; cursor: pointer;
  border-radius: 6px; padding: .5rem .95rem; border: 1px solid transparent;
}
button.primary { background: var(--steel); color: #fff; }
button.primary:hover { background: var(--navy-2); }
button.ghost { background: #fff; color: var(--steel); border-color: var(--line); }
button:disabled { opacity: .5; cursor: not-allowed; }
.status { font-size: .85rem; color: var(--muted); margin-left: .25rem; }
.status.err { color: var(--fail); }

/* Grid of panels */
.grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; align-items: start;
}
@media (max-width: 1080px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.15rem;
}
.panel h2 {
  font-size: 1.05rem; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem;
}
.step {
  display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem;
  background: var(--navy); color: #fff; border-radius: 50%; font-size: .85rem;
}
.panel-note { font-size: .8rem; color: var(--muted); margin: 0 0 .8rem; }

.ai-tag, .no-ai-tag, .badge-src, .ai-source {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: .12rem .45rem; border-radius: 999px;
}
.ai-tag { background: #ede7fb; color: #5b21b6; }
.no-ai-tag { background: var(--pass-bg); color: var(--pass); }
.badge-src { background: #e6eef7; color: var(--steel); }

/* CAP fields */
.cap-fields { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: 0; font-size: .86rem; }
.cap-fields dt { font-weight: 700; color: var(--muted); }
.cap-fields dd { margin: 0; word-break: break-word; }
.sev-Extreme, .sev-Severe { color: var(--fail); font-weight: 700; }
.sev-Moderate { color: var(--warn); font-weight: 700; }
.raw { margin-top: .8rem; }
.raw summary { cursor: pointer; font-size: .82rem; color: var(--steel); }
.raw pre {
  background: #0b2545; color: #d7e3f4; padding: .8rem; border-radius: 6px;
  overflow: auto; max-height: 280px; font-size: .76rem;
}

/* Draft fields */
.field-label { display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 600; font-size: .85rem; margin: .7rem 0 .25rem; }
.counter { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.counter.over { color: var(--fail); font-weight: 700; }
.meta-row { display: flex; gap: 1rem; margin-top: .7rem; }
.meta-row label { display: flex; flex-direction: column; font-size: .8rem; font-weight: 600; gap: .2rem; }
.spanish { margin-top: .8rem; border-top: 1px dashed var(--line); padding-top: .7rem; }
.flag-review { font-size: .7rem; background: var(--warn-bg); color: var(--warn);
  padding: .1rem .45rem; border-radius: 999px; font-weight: 700; }

/* Validator */
.verdict { padding: .7rem .9rem; border-radius: 6px; margin-bottom: .8rem; font-weight: 700; }
.verdict.pass { background: var(--pass-bg); color: var(--pass); }
.verdict.fail { background: var(--fail-bg); color: var(--fail); }
.verdict.pending { background: #eef1f5; color: var(--muted); }
.verdict-score { float: right; font-family: var(--mono); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.check { display: grid; grid-template-columns: auto 1fr; gap: .55rem; font-size: .83rem;
  border: 1px solid var(--line); border-radius: 6px; padding: .45rem .6rem; }
.check .dot { width: .85rem; height: .85rem; border-radius: 50%; margin-top: .2rem; }
.check.pass .dot { background: var(--pass); }
.check.warn .dot { background: var(--warn); }
.check.fail .dot { background: var(--fail); }
.check-label { font-weight: 600; }
.check-detail { color: var(--muted); font-size: .78rem; }

/* Approval */
.approval { margin-top: 1.25rem; }
.approval-row { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-bottom: .9rem; }
.approval-row label { font-size: .85rem; font-weight: 600; display: flex; flex-direction: column; gap: .2rem; }
.approval-row .override { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; }
button.approve { background: var(--pass); }
button.approve:hover { background: #086030; }
.audit-result { margin-top: 1rem; background: var(--pass-bg); border: 1px solid #b7e0c5;
  border-radius: 6px; padding: .9rem; font-size: .85rem; }
.audit-result pre { font-family: var(--mono); font-size: .76rem; overflow: auto; }

footer {
  max-width: 1240px; margin: 1.5rem auto; padding: 1rem 1.5rem; color: var(--muted);
  font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  border-top: 1px solid var(--line);
}
