/* RateMyDSP — mobile-first, system fonts, no images.
   Palette: deep blue + white, gold stars. Deliberately far from
   Amazon orange/black trade dress. */

:root {
  --navy: #0e2a54;
  --navy-deep: #0a1f40;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --gold: #f2b01e;
  --ink: #16233b;
  --muted: #5b6b84;
  --line: #dde5f0;
  --bg: #f5f8fc;
  --white: #fff;
  --green: #15803d;
  --red: #b91c1c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: var(--white);
  padding: 28px 0 44px;
  text-align: center;
}
.brand {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  margin-bottom: 36px;
  opacity: 0.95;
}
.brand::before { content: "★ "; color: var(--gold); }
.hero h1 { font-size: clamp(1.9rem, 6.5vw, 2.8rem); font-weight: 800; }
.subhead {
  margin: 14px auto 26px;
  max-width: 34em;
  font-size: 1.05rem;
  color: #ccd9ef;
}

.hero-form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 0 auto; }
.hero-form input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  border: 0;
  border-radius: 10px;
}
.hero-note { margin-top: 14px; font-size: 0.85rem; color: #9fb4d6; }

/* ---------- Buttons / form bits ---------- */
.btn {
  background: var(--blue);
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  padding: 14px 22px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover, .btn:focus-visible { background: var(--blue-dark); }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: default; }

.form-msg { display: none; font-size: 0.95rem; font-weight: 600; }
.form-msg.ok { display: block; color: #7ee2a8; }
.form-msg.err { display: block; color: #ffb4b4; }
.signup .form-msg.ok { color: var(--green); }
.signup .form-msg.err { color: var(--red); }

input:focus-visible, select:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

/* ---------- Problems ---------- */
.problems { padding: 48px 0; background: var(--white); }
.problems h2 { font-size: 1.45rem; text-align: center; margin-bottom: 30px; }
.problem-grid { display: grid; gap: 22px; }
.problem-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--navy); color: var(--gold);
  font-weight: 800; font-size: 1.2rem;
  border-radius: 10px;
  margin-bottom: 10px;
}
.problem h3 { font-size: 1.08rem; margin-bottom: 4px; }
.problem p { color: var(--muted); font-size: 0.97rem; }

/* ---------- Preview card ---------- */
.preview { padding: 48px 0; }
.preview-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  background: #dbe7fa;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.preview h2 { font-size: 1.45rem; margin-bottom: 20px; }

.dsp-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(14, 42, 84, 0.08);
}
.dsp-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.dsp-name { font-size: 1.15rem; }
.dsp-station { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.dsp-overall { text-align: right; }
.dsp-overall-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--navy); }

.dsp-ratings { list-style: none; margin: 14px 0; display: grid; gap: 10px; }
.dsp-ratings li {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.95rem;
}

/* Fractional stars: gray row underneath, gold row clipped to --r/5 width */
.stars {
  position: relative;
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 2px;
}
.stars::before { content: "★★★★★"; color: #cfd8e6; }
.stars::after {
  content: "★★★★★";
  color: var(--gold);
  position: absolute;
  top: 0; left: 0;
  width: calc(var(--r, 0) / 5 * 100%);
  overflow: hidden;
  white-space: nowrap;
}

.dsp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tag {
  font-size: 0.8rem;
  font-weight: 600;
  background: #e8f0fb;
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 12px;
}
.tag-warn { background: #fdeeee; color: var(--red); }

.preview-caption { margin-top: 16px; color: var(--muted); font-size: 0.95rem; }

/* ---------- Signup ---------- */
.signup { padding: 48px 0; background: var(--white); border-top: 1px solid var(--line); }
.signup h2 { font-size: 1.45rem; }
.signup-sub { color: var(--muted); margin: 8px 0 24px; }

.signup-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.95rem; }
.req { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.opt { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.field input, .field select {
  padding: 13px 14px;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  width: 100%;
  color: var(--ink);
}

/* ---------- Trust strip ---------- */
.trust {
  background: var(--navy);
  color: #dbe6f7;
  padding: 26px 0;
  text-align: center;
  font-size: 0.97rem;
}
.trust strong { color: var(--white); }

/* ---------- Footer ---------- */
.footer {
  padding: 28px 0 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.disclaimer { margin-top: 6px; }

/* ---------- Wider screens ---------- */
@media (min-width: 720px) {
  .wrap { max-width: 960px; }
  .hero { padding: 36px 0 64px; }
  .hero-form { flex-direction: row; }
  .hero-form input { flex: 1; }
  .hero-form .btn { white-space: nowrap; }
  .hero-form .form-msg { flex-basis: 100%; }
  .problem-grid { grid-template-columns: repeat(3, 1fr); }
  .dsp-card, .signup-form { max-width: 560px; }
  .preview .wrap, .signup .wrap { max-width: 640px; }
}
