/* =========================================================================
 * Black Friday Deal Checker — styles. Animated modern UI.
 * All motion disabled under prefers-reduced-motion.
 * Accent: deep sale red #8c1d18 (unused across all tools, verified
 * 18 Nov 2026 by grep over src/static/tools/*/styles.css + index.html).
 * ========================================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --ink: #141a2e;
  --ink-soft: #4b5573;
  --ink-faint: #8a93ad;
  --line: #e2e7f2;
  --brand: #8c1d18;
  --brand-2: #6b1410;
  --brand-soft: #fdf0ef;
  --ok: #0f9d58;
  --ok-soft: #e5f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --err: #dc2626;
  --err-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
  --shadow-lg: 0 18px 50px rgba(140, 29, 24, 0.16);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 700; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 10px; transition: background 0.18s, color 0.18s;
}
.nav a:hover, .nav a:focus-visible { background: var(--surface-2); color: var(--ink); outline: none; }

/* ---------------- hero ----------------
   Compact by design: one line of headline + one line of promise, so the
   checker itself is on the first screen. */
.hero {
  padding: 26px 0 10px;
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(140, 29, 24, 0.10), transparent 60%),
    radial-gradient(700px 320px at 90% 10%, rgba(107, 20, 16, 0.10), transparent 60%);
}
.hero h1 {
  font-size: clamp(1.65rem, 3.4vw, 2.25rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 6px; max-width: none;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: 1rem; color: var(--ink-soft); max-width: none; margin: 0 0 12px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trust-row li {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft);
  box-shadow: 0 2px 8px rgba(20, 26, 46, 0.05);
}
.trust-row .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

/* ---------------- tool card ---------------- */
.tool-section { padding: 8px 0 32px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: clamp(18px, 3vw, 28px);
}
.tool-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 24px; align-items: start; }
.tool-main { min-width: 0; }
.tool-side { min-width: 0; }
.step-title { font-weight: 800; margin: 0 0 10px; font-size: 1rem; }

/* form fields */
.field { margin: 0 0 14px; }
.field label { font-weight: 700; display: block; margin-bottom: 6px; }
.field label .req { color: var(--brand); }
.field input[type="number"], .field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  min-width: 0;
}
.field input[type="number"]:focus, .field select:focus {
  outline: 3px solid rgba(140, 29, 24, 0.35); outline-offset: 1px; border-color: var(--brand);
}
.field .hint { font-size: 0.85rem; color: var(--ink-soft); margin: 4px 0 0; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
.fieldset { border: 0; margin: 0; padding: 0; }
.fieldset legend { font-weight: 800; margin-bottom: 10px; padding: 0; }
.opt-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 6px; margin: 4px 0 14px; background: #fdfcfc; }
.opt-group legend { font-weight: 800; font-size: 0.95rem; padding: 0 6px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  padding: 10px 18px; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 18px rgba(140, 29, 24, 0.35); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-small { padding: 7px 13px; font-size: 0.85rem; border-radius: 10px; }
.btn:focus-visible { outline: 3px solid rgba(140, 29, 24, 0.4); outline-offset: 2px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.form-errors {
  background: var(--err-soft); color: var(--err); border: 1px solid #f3c1c1;
  border-radius: 12px; padding: 12px 16px; margin: 14px 0 0; font-size: 0.92rem;
}
.form-errors[hidden] { display: none; }
.form-errors ul { margin: 6px 0 0; padding-left: 20px; }

/* examples */
.examples { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.examples h3 { font-size: 0.95rem; margin: 0 0 4px; }
.examples p { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 10px; }
.example-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip {
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  padding: 7px 14px; font: inherit; font-size: 0.88rem; font-weight: 700; cursor: pointer;
  color: var(--ink);
}
.example-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.example-chip:focus-visible { outline: 3px solid rgba(140, 29, 24, 0.4); outline-offset: 2px; }

/* ---------------- verdict + results ---------------- */
.result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; animation: card-in 0.35s ease both; }
.result[hidden] { display: none; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.verdict-badge {
  display: inline-block; border-radius: 999px; padding: 8px 18px;
  font-weight: 800; font-size: 1.05rem; color: #fff; margin: 0 0 8px;
}
.v-bargain { background: linear-gradient(135deg, #0f9d58, #065f46); }
.v-deal { background: linear-gradient(135deg, #0d9488, #0f766e); }
.v-same { background: linear-gradient(135deg, #b45309, #92400e); }
.v-worse { background: linear-gradient(135deg, #dc2626, #991b1b); }
.v-unknown { background: linear-gradient(135deg, #4b5573, #141a2e); }
.verdict-short { font-weight: 800; font-size: 1.15rem; margin: 0 0 6px; }
.verdict-text { color: var(--ink-soft); margin: 0 0 8px; }
.verdict-note {
  background: var(--warn-soft); color: var(--warn); border-radius: 10px;
  font-size: 0.88rem; padding: 9px 12px; margin: 0 0 14px;
}
.verdict-note[hidden] { display: none; }
.numbers { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 0.95rem; }
.numbers th, .numbers td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top; overflow-wrap: anywhere;
}
.numbers th { font-weight: 700; width: 46%; min-width: 0; }
.numbers td { font-weight: 600; min-width: 0; }
.numbers tr:last-child th, .numbers tr:last-child td { border-bottom: 0; }
.result h3 { font-size: 1rem; margin: 16px 0 8px; }
.flags-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.flag { border-radius: 10px; padding: 10px 12px; font-size: 0.92rem; }
.flag-bad { background: var(--err-soft); color: #7f1d1d; }
.flag-warn { background: var(--warn-soft); color: var(--warn); }
.flag-good { background: var(--ok-soft); color: var(--ok); }
.flag-info { background: var(--surface-2); color: var(--ink-soft); }
.checks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-row {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 4px 14px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 0.92rem;
}
.check-row .check-label { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.check-row .check-text { color: var(--ink-soft); min-width: 0; overflow-wrap: anywhere; }
.check-pass { border-left: 4px solid var(--ok); }
.check-fail { border-left: 4px solid var(--err); }
.check-warn { border-left: 4px solid var(--warn); }
.check-info { border-left: 4px solid var(--ink-faint); }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* side panel */
.side-card {
  background: #fdfcfc; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 14px;
}
.side-card h3 { margin: 0 0 8px; font-size: 1rem; }
.side-card p, .side-card li { font-size: 0.92rem; color: var(--ink-soft); margin: 6px 0; }
.side-card ol, .side-card ul { padding-left: 20px; margin: 6px 0; }
.side-card .stat { font-weight: 800; color: var(--brand); }
.side-card kbd {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 7px; font: inherit; font-size: 0.85em;
}

/* privacy */
.privacy { padding: 8px 0 44px; }
.privacy-card {
  background: linear-gradient(135deg, #2b0f0d, #4a1210);
  color: #fbe9e7; border-radius: 22px; padding: clamp(22px, 3vw, 36px);
  box-shadow: var(--shadow-lg);
}
.privacy-card h2 { color: #fff; margin: 0 0 10px; font-size: 1.4rem; }
.privacy-card p { margin: 0 0 16px; }
.net-meter {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px; padding: 9px 16px; font-weight: 700; color: #fff;
}
.net-meter b { font-size: 1.15rem; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #34d399; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
.verify-steps { margin: 16px 0 0; padding-left: 20px; }
.verify-steps li { margin: 6px 0; }
.privacy-card kbd, .tool-card kbd, .content kbd {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 0.85em;
}
.tool-card kbd, .content kbd {
  background: var(--surface-2); border-color: var(--line); color: var(--ink);
}

/* content */
.content { padding: 20px 0 44px; }
.content h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 12px; }
.content h3 { font-size: 1.08rem; margin: 26px 0 8px; }
.content p, .content li { color: var(--ink-soft); }
.content ol, .content ul { padding-left: 22px; }
.content li { margin: 6px 0; }
.prose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.prose-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.prose-card h3 { margin: 0 0 6px; }
.prose-card p { margin: 0; font-size: 0.93rem; }

.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; margin: 10px 0;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq summary:focus-visible { outline: 3px solid rgba(140, 29, 24, 0.35); outline-offset: 2px; border-radius: 6px; }
.faq details p { margin: 10px 0 2px; }

/* footer — one small, quiet line */
.site-footer { border-top: 1px solid var(--line); padding: 18px 0 26px; color: var(--ink-faint); font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer .footer-note { color: var(--ink-faint); }

/* responsive */
@media (max-width: 860px) {
  .tool-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 20px 0 8px; }
  .field-grid { grid-template-columns: 1fr; }
  .check-row { grid-template-columns: 1fr; gap: 2px; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  .form-actions .btn { width: 100%; }
  .result-actions { display: grid; grid-template-columns: 1fr; }
  .result-actions .btn { width: 100%; }
  .numbers th { width: 44%; }
  .site-footer .wrap { flex-direction: column; gap: 2px; }
}

/* reduced motion: kill every animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
