:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #10141c;
  --panel-2: #151b25;
  --line: rgba(255,255,255,.10);
  --text: #f5f7fb;
  --muted: #9aa4b5;
  --green: #22d66f;
  --orange: #ffad1f;
  --red: #ff3547;
  --focus: #8bb4ff;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -20%, rgba(98,115,150,.20), transparent 42%),
    linear-gradient(180deg, #0a0d13 0%, var(--bg) 55%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.page-shell {
  width: min(100% - 28px, 1040px);
  margin: 0 auto;
  padding: 42px 0 28px;
}

.brand { text-align: center; }
.brand-line {
  letter-spacing: -.055em;
  font-weight: 900;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  line-height: .95;
}
.brand-accent {
  background: linear-gradient(90deg, #ff7a2f, var(--red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand p {
  margin: 14px 0 0;
  color: #d6dce7;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
}
.brand strong { color: #ff5966; }

.search-card {
  max-width: 820px;
  margin: 32px auto 18px;
  text-align: center;
}
.search-card h1 {
  margin: 0 0 7px;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
}
.intro, .form-help { color: var(--muted); }
.intro { margin: 0 0 18px; }

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17,22,31,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
}
.input-row:focus-within {
  border-color: rgba(139,180,255,.65);
  box-shadow: 0 0 0 4px rgba(139,180,255,.10), 0 18px 60px rgba(0,0,0,.35);
}
input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 0 16px;
}
input::placeholder { color: #798396; }
.input-row button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, #ee3d51, #ff713b);
  box-shadow: 0 8px 26px rgba(255,53,71,.25);
}
.input-row button:hover { transform: translateY(-1px); }
.input-row button:disabled { cursor: wait; opacity: .65; transform: none; }
.form-help { margin: 10px 0 0; font-size: .86rem; }
.honeypot { position: absolute !important; left: -10000px !important; }

.result-zone { margin-top: 18px; }
.traffic-wrap { display: grid; place-items: center; padding: 10px 0 22px; }

.traffic-light {
  width: clamp(190px, 31vw, 270px);
  padding: 20px 17px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 34px;
  background: linear-gradient(145deg, #202630, #090c11 55%, #171b22);
  box-shadow:
    inset 0 2px 1px rgba(255,255,255,.12),
    inset 0 -10px 30px rgba(0,0,0,.55),
    0 25px 70px rgba(0,0,0,.52);
}
.visor {
  position: relative;
  margin: 9px 0;
  padding: 7px 9px 13px;
  border-radius: 50% 50% 44% 44%;
  background: linear-gradient(180deg, #292f39 0%, #0b0d12 58%);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.08), 0 7px 15px rgba(0,0,0,.55);
}
.lamp {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 5px solid #090b0f;
  color: rgba(255,255,255,.18);
  text-align: center;
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -.03em;
  font-size: clamp(1.05rem, 3vw, 1.42rem);
  background-color: #171b21;
  background-image: radial-gradient(circle, rgba(255,255,255,.09) 1px, transparent 1.2px);
  background-size: 7px 7px;
  box-shadow: inset 0 0 36px rgba(0,0,0,.82);
  transition: .35s ease;
}

.traffic-light[data-state="loading"] .lamp {
  animation: breathe 1.35s infinite alternate ease-in-out;
}
.traffic-light[data-state="green"] .lamp-green {
  color: #fff;
  background-color: var(--green);
  box-shadow: inset 0 0 30px rgba(255,255,255,.35), 0 0 20px #22d66f, 0 0 55px rgba(34,214,111,.64);
}
.traffic-light[data-state="orange"] .lamp-orange {
  color: #fff;
  background-color: var(--orange);
  box-shadow: inset 0 0 30px rgba(255,255,255,.30), 0 0 20px #ffad1f, 0 0 55px rgba(255,173,31,.58);
}
.traffic-light[data-state="red"] .lamp-red {
  color: #fff;
  background-color: var(--red);
  box-shadow: inset 0 0 30px rgba(255,255,255,.30), 0 0 20px #ff3547, 0 0 55px rgba(255,53,71,.62);
}

@keyframes breathe {
  from { filter: brightness(.75); }
  to { filter: brightness(1.35); }
}

.result-card, .loading-card, .error-card {
  max-width: 820px;
  margin: 0 auto 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(21,27,37,.96), rgba(13,17,24,.96));
  box-shadow: 0 22px 70px rgba(0,0,0,.28);
}
.result-card { padding: clamp(20px, 4vw, 34px); }
.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .72rem;
  font-weight: 800;
}
.result-heading h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.35rem); }
.confidence-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #dbe2ee;
  background: rgba(255,255,255,.04);
  font-size: .88rem;
  font-weight: 800;
}
.result-summary {
  color: #e7ebf2;
  font-size: 1.08rem;
  line-height: 1.62;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 26px;
}
.result-card h3 { margin: 0 0 10px; font-size: 1rem; }
.result-card ul { margin: 0; padding-left: 20px; color: #cbd2dd; }
.result-card li { margin: 8px 0; line-height: 1.45; }
.payment-section {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.sources-section { margin-top: 25px; }
.sources-list a { color: #9fc0ff; overflow-wrap: anywhere; }
.result-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-top: 27px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.result-footer p { margin: 0; max-width: 570px; color: var(--muted); font-size: .86rem; }
.secondary-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  color: white;
  background: rgba(255,255,255,.04);
}

.loading-card, .error-card {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.loading-card p, .error-card p { margin: 4px 0 0; color: var(--muted); }
.spinner {
  width: 31px; height: 31px; flex: 0 0 auto;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: #ff5966;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-card { border-color: rgba(255,53,71,.30); }

footer {
  text-align: center;
  color: #778194;
  font-size: .78rem;
  line-height: 1.4;
}
footer p { margin: 4px 0; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (max-width: 660px) {
  .page-shell { width: min(100% - 20px, 1040px); padding-top: 28px; }
  .input-row { grid-template-columns: 1fr; border-radius: 22px; }
  input { min-height: 52px; }
  .input-row button { justify-content: center; width: 100%; }
  .result-grid { grid-template-columns: 1fr; }
  .result-footer { align-items: stretch; flex-direction: column; }
  .secondary-button { width: 100%; }
  .traffic-light { width: 205px; }
}
