/* ShadeScore — matches the existing shadepath.app site's Daylight tokens exactly:
   dark hero #020617, cream body #faf7f1, brand green #078340/#00b353, Plus Jakarta Sans.
   See index.html, watch.html, privacy/index.html for the shared visual language this mirrors. */

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #faf7f1;
  color: #2d2a26;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.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;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: #020617;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}
.hero-inner { max-width: 560px; margin: 0 auto; }
.brand-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; margin-bottom: 1.75rem;
}
.brand-icon { width: 32px; height: 32px; display: block; }
.brand-word { font-size: 1.05rem; font-weight: 700; color: rgba(250,247,241,0.75); letter-spacing: -0.01em; }
.page-title {
  font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, #00b353, #078340);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 0.75rem;
}
.page-sub {
  font-size: 1.05rem; color: rgba(250,247,241,0.65); line-height: 1.75;
  max-width: 460px; margin: 0 auto 2rem;
}

.search-row {
  display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center;
}
#address-input {
  flex: 1 1 320px; min-width: 0;
  font-family: inherit; font-size: 1rem; font-weight: 500;
  padding: 0.95rem 1.1rem; border-radius: 14px;
  border: 1.5px solid rgba(250,247,241,0.18);
  background: rgba(250,247,241,0.07);
  color: #faf7f1;
}
#address-input::placeholder { color: rgba(250,247,241,0.4); }
#address-input:focus {
  outline: none; border-color: #00b353;
  background: rgba(250,247,241,0.1);
}
#submit-btn {
  flex: 0 0 auto;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  padding: 0.95rem 1.6rem; border-radius: 14px; border: none;
  background: linear-gradient(135deg, #00b353, #078340); color: #ffffff;
  cursor: pointer; transition: transform 0.15s, filter 0.15s;
}
#submit-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
#submit-btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.search-hint {
  font-size: 0.8rem; color: rgba(250,247,241,0.35); margin-top: 0.9rem; line-height: 1.6;
}

/* ── Content ──────────────────────────────────────────────── */
.content { max-width: 640px; margin: 0 auto; padding: 2rem 1.5rem 1rem; }

.status-area:empty { display: none; }
.status-area {
  margin-bottom: 1.25rem; padding: 1rem 1.25rem; border-radius: 14px;
  font-size: 0.95rem; font-weight: 500; line-height: 1.6;
}
.status-area.status-loading { background: rgba(7,131,64,0.08); color: #078340; }
.status-area.status-error { background: rgba(220,38,38,0.08); color: #B91C1C; }

/* ── Result card ──────────────────────────────────────────── */
.result-card {
  background: #ffffff; border: 1px solid rgba(45,42,38,0.07);
  border-radius: 20px; padding: 1.75rem; margin-bottom: 2rem;
  box-shadow: 0 4px 24px rgba(45,42,38,0.06);
}
.result-top {
  display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.1rem;
}
.shield-wrap {
  flex: 0 0 auto; width: 104px;
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.shield-badge { position: relative; width: 88px; height: 94px; display: block; }
.shield-badge svg { width: 88px; height: 94px; display: block; }
.shield-score-num {
  position: absolute; left: 0; right: 0; top: 0; height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.shield-tier-word {
  font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}

/* Tier border + score-number colors as CSS classes (app.js toggles the class, never sets
   .style directly) — a strict CSP with no 'unsafe-inline' on style-src blocks inline style
   attributes/properties entirely, including ones set via element.style.x = ... from JS.
   Colors must stay in sync with SHIELD_COLORS in shadescore-engine.js, ported verbatim from
   src/utils/comparisonMessaging.ts — same 5-tier real design-system source, just expressed
   as CSS instead of inline style so it can be CSP-compliant. */
.shield-wrap.tier-great .shield-score-num, .shield-wrap.tier-great .shield-tier-word { color: #10B981; }
.shield-wrap.tier-good .shield-score-num, .shield-wrap.tier-good .shield-tier-word { color: #3B82F6; }
.shield-wrap.tier-moderate .shield-score-num, .shield-wrap.tier-moderate .shield-tier-word { color: #D97706; }
.shield-wrap.tier-caution .shield-score-num, .shield-wrap.tier-caution .shield-tier-word { color: #EA580C; }
.shield-wrap.tier-warning .shield-score-num, .shield-wrap.tier-warning .shield-tier-word { color: #DC2626; }
.shield-score-num { font-size: 1.85rem; font-weight: 800; line-height: 1; }
.result-headline { flex: 1 1 auto; min-width: 0; }
.result-place {
  font-size: 0.92rem; font-weight: 600; color: #8a7e76;
  margin-bottom: 0.35rem; overflow-wrap: break-word;
}
.result-copy {
  font-size: 1.15rem; font-weight: 700; color: #2d2a26; line-height: 1.4;
}
.result-footer {
  font-size: 0.85rem; color: #8a7e76; padding-top: 1rem;
  border-top: 1px solid rgba(45,42,38,0.06); margin-bottom: 0.4rem;
}
.result-limitation {
  font-size: 0.8rem; color: #a89a8c; font-style: italic; line-height: 1.6; margin-bottom: 1.25rem;
}
.result-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.result-actions.store-actions { margin-bottom: 0.7rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  padding: 0.8rem 1.3rem; border-radius: 12px; text-decoration: none;
  border: none; cursor: pointer; flex: 1 1 auto;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.btn-primary { background: linear-gradient(135deg, #00b353, #078340); color: #ffffff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: rgba(45,42,38,0.05); color: #4a4541; }
.btn-secondary:hover { background: rgba(45,42,38,0.08); }

/* ── Explainer sections ───────────────────────────────────── */
.why-section, .honesty-section {
  padding: 1.5rem 0; border-top: 1px solid rgba(45,42,38,0.07);
}
.why-section h2, .honesty-section h2 {
  font-size: 1.05rem; font-weight: 700; color: #2d2a26; margin-bottom: 0.6rem;
}
.why-section p, .honesty-section p {
  font-size: 0.88rem; color: #6b6560; line-height: 1.75; margin-bottom: 0.75rem;
}
.why-section p:last-child, .honesty-section p:last-child { margin-bottom: 0; }

/* ── Footer ───────────────────────────────────────────────── */
.footer { background: #020617; padding: 1.75rem 1.5rem; text-align: center; margin-top: 1rem; }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.footer-links a { color: rgba(250,247,241,0.45); font-size: 0.82rem; font-weight: 500; text-decoration: none; }
.footer-links a:hover { color: rgba(250,247,241,0.75); }
.footer-copy { font-size: 0.75rem; color: rgba(250,247,241,0.25); }
.footer-copy:first-of-type { margin-bottom: 0.5rem; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero { padding: 2.75rem 1.25rem 2.25rem; }
  .page-title { font-size: 2.1rem; }
  .page-sub { font-size: 0.98rem; }
  .search-row { flex-direction: column; }
  /* Bug found in headless screenshot review: flex-basis is a MAIN-axis size, and the main
     axis just flipped to vertical above — without this reset, the 320px width hint from
     `flex: 1 1 320px` (desktop) becomes a 320px-TALL input box instead. Explicit auto height
     restores normal single-line sizing once stacked. */
  #address-input { flex: 1 1 auto; height: auto; }
  #submit-btn { width: 100%; }
  .result-top { flex-direction: column; text-align: center; }
  .result-actions { flex-direction: column; }
  .shield-wrap { width: 120px; height: 120px; }
}
