/* ScoutBrief — shared styles */

:root {
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent2: #0d9488;
  --accent-soft: #eeecfd;
  --ink: #14151a;
  --ink-soft: #55575f;
  --ink-faint: #8b8d96;
  --line: #e7e7ec;
  --surface: #fafafb;
  --card: #ffffff;
  --good-bg: #e7f6ec;
  --good-ink: #157a3d;
  --warn-bg: #fdf1e0;
  --warn-ink: #a1650f;
  --bad-bg: #fdeceb;
  --bad-ink: #c02b26;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 21, 26, 0.04), 0 1px 12px rgba(20, 21, 26, 0.04);
}

:root[data-theme="dark"] {
  --accent: #8583f5;
  --accent-dark: #a5a3ff;
  --accent2: #2dd4c4;
  --accent-soft: #232244;
  --ink: #f0f0f4;
  --ink-soft: #b7b8c2;
  --ink-faint: #7d7e8a;
  --line: #2c2d38;
  --surface: #131319;
  --card: #1a1b23;
  --good-bg: #123321;
  --good-ink: #4ade80;
  --warn-bg: #3a2c12;
  --warn-ink: #f0b649;
  --bad-bg: #3a1817;
  --bad-ink: #f28b85;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 12px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  margin: 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(560px 300px at 12% -8%, rgba(79, 70, 229, 0.10), transparent 60%),
    radial-gradient(480px 260px at 100% 0%, rgba(13, 148, 136, 0.08), transparent 55%),
    var(--surface);
  background-attachment: fixed;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* Top nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 8px;
  flex-wrap: wrap;
  gap: 10px;
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav .brand .mark {
  width: 22px; height: 22px;
  display: inline-block;
  flex-shrink: 0;
}
.nav .back-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav .back-link:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 14px; }

/* Account menu (nav dropdown) */
.account-menu { position: relative; }
.account-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  max-width: 160px;
}
.account-trigger:hover { background: var(--accent-soft); }
.account-trigger .account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-trigger .caret {
  font-size: 0.6rem;
  color: var(--ink-faint);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.account-menu[data-open="true"] .caret { transform: rotate(180deg); }
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 190px;
  padding: 6px;
  z-index: 20;
  display: none;
}
.account-menu[data-open="true"] .account-dropdown { display: block; }
.account-dropdown a,
.account-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.87rem;
  font-family: inherit;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.account-dropdown a:hover,
.account-dropdown button:hover { background: var(--accent-soft); }
.account-dropdown .dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 2px;
}
.account-dropdown form { margin: 0; }
@media (max-width: 480px) {
  .nav-right { gap: 10px; }
}

/* Header block */
.hero { margin: 18px 0 36px; }
.hero h1 { font-size: 1.75rem; letter-spacing: -0.02em; margin: 0 0 6px; }
.hero .tagline, .hero .subject { color: var(--ink-soft); margin: 0; font-size: 1rem; }
.hero .kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

/* Section headings */
h2.section {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin: 40px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* Form */
.card-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
}
label { display: block; font-weight: 600; font-size: 0.88rem; margin: 18px 0 7px; color: var(--ink); }
label:first-child { margin-top: 0; }
textarea, input[type="text"], input:not([type]) {
  width: 100%;
  padding: 11px 13px;
  font-size: 0.96rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
textarea:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
textarea { min-height: 92px; resize: vertical; }
.hint { color: var(--ink-faint); font-size: 0.82rem; margin: 6px 0 0; }

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
button.ghost:hover, .btn.ghost:hover { background: var(--accent-soft); color: var(--ink); }
button.danger-text {
  background: none;
  color: var(--bad-ink);
  padding: 0;
  font-weight: 500;
  font-size: 0.85rem;
}
button.danger-text:hover { text-decoration: underline; background: none; }
button.recheck { background: var(--accent2); }
button.recheck:hover { background: #0b7c72; }

.form-submit { margin-top: 22px; }

/* Error / info banners */
.error {
  background: var(--bad-bg);
  color: var(--bad-ink);
  padding: 13px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

/* Saved businesses list */
.biz-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.biz-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.biz-list li:hover { border-color: #d6d4f5; box-shadow: var(--shadow); }
.biz-list a { color: var(--ink); font-weight: 600; text-decoration: none; font-size: 0.98rem; }
.biz-list a:hover { color: var(--accent); }
.biz-list .desc { color: var(--ink-soft); font-size: 0.87rem; margin-top: 4px; }
.empty { color: var(--ink-faint); font-size: 0.9rem; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }

/* Business detail toolbar */
.toolbar { display: flex; align-items: center; gap: 16px; margin: 20px 0 4px; flex-wrap: wrap; }
.report-count { color: var(--ink-faint); font-size: 0.85rem; margin: 0 0 20px; }

/* Diff card */
.diff {
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0 8px;
  border: 1px solid var(--line);
}
.diff.changed { background: var(--warn-bg); border-color: #f2ddb8; }
.diff.unchanged { background: var(--card); }
.diff h3 { margin: 0 0 8px; font-size: 0.98rem; }
.diff p { margin: 6px 0; font-size: 0.92rem; }
.diff ul { margin: 8px 0 0; padding-left: 20px; font-size: 0.92rem; }

.type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.watchlist {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 14px;
}
.watchlist h3 { margin: 0 0 6px; font-size: 0.95rem; color: var(--accent-dark); }
.watchlist ul { margin: 0; padding-left: 20px; }
.watchlist li { font-size: 0.92rem; margin-bottom: 4px; }

.verdict {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent2);
  margin: 6px 0 4px;
}

/* Summary */
.summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent2);
  padding: 18px 20px;
  border-radius: var(--radius);
  font-size: 1rem;
  box-shadow: var(--shadow);
}

/* Competitor cards */
.competitor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}
.competitor h3 { margin: 0 0 8px; font-size: 1.02rem; display: flex; align-items: center; gap: 9px; }
.badge { font-size: 0.66rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge.verified { background: var(--good-bg); color: var(--good-ink); }
.badge.unverified { background: var(--warn-bg); color: var(--warn-ink); }
.source-link { font-size: 0.82rem; margin-top: 6px; }
.source-link a { color: var(--ink-faint); }
.source-link a:hover { color: var(--accent); }
.competitor .meta { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 10px; }
.social-presence { color: var(--ink-soft); font-size: 0.88rem; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.social-presence strong { color: var(--ink); }
.cols { display: flex; gap: 24px; margin-top: 12px; }
.cols div { flex: 1; }
.cols h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); margin: 0 0 6px; }

ul { margin: 4px 0; padding-left: 20px; }
ul li { margin-bottom: 3px; }

.caveats {
  margin-top: 28px;
  font-size: 0.87rem;
  color: var(--ink-faint);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.report-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.report-brand .mark {
  width: 16px; height: 16px;
  display: inline-block;
  flex-shrink: 0;
}
.report-brand strong { color: var(--ink-soft); }

.history { color: var(--ink-faint); font-size: 0.85rem; margin: 6px 0 0; padding-left: 20px; }
.history li { margin-bottom: 5px; }

.back { display: inline-block; margin-top: 40px; color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.back:hover { color: var(--ink); }

/* Theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 20px;
}
.theme-toggle:hover { background: var(--accent-soft); color: var(--ink); }

/* Loading overlay (shown on generate/recheck submit) */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 21, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.loading-overlay.visible { opacity: 1; }
.loading-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 36px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  max-width: 320px;
}
.loading-box p { margin: 14px 0 0; font-weight: 600; color: var(--ink); }
.loading-box .loading-sub { margin-top: 6px; font-weight: 400; font-size: 0.85rem; color: var(--ink-faint); }
.spinner {
  width: 32px; height: 32px;
  margin: 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Confidence stat + read time chips, shown alongside the report */
.report-meta { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 18px; }
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 20px;
}
.meta-chip strong { color: var(--ink); }

/* Copy-as-text button reuses .btn.ghost; plain-text source stays offscreen */
.report-text-source {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: pre-wrap;
}

/* Example-fill link on the homepage */
.example-link { font-size: 0.82rem; color: var(--accent); text-decoration: none; margin-left: 8px; }
.example-link:hover { text-decoration: underline; }

/* Business tag badges */
.tag-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.tag-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.tag-form input[type="text"] {
  width: auto;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.tag-form button {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* Homepage hero with illustration + demo video (logged-out visitors) */
.hero-with-media {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-with-media .hero-content { flex: 1 1 300px; min-width: 260px; }
.hero-media {
  flex: 0 1 260px;
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hero-illustration {
  width: 100%;
  height: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-video {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #000;
  display: block;
}
@media (max-width: 620px) {
  .hero-with-media { flex-direction: column; }
  .hero-media { width: 100%; flex: none; }
}

/* Homepage report preview (logged-out visitors) */
.report-preview-wrap {
  position: relative;
  max-height: 420px;
  overflow: hidden;
  border-radius: var(--radius);
}
.report-preview { padding-bottom: 30px; }
.report-preview-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--surface) 82%);
  pointer-events: none;
}

/* Stats page */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .stat-label { color: var(--ink-faint); font-size: 0.85rem; margin-top: 4px; }

/* Print styles: strip chrome, keep the report content */
@media print {
  .nav, .toolbar, .card-form, .form-submit, form, .theme-toggle,
  .biz-list, .empty, h2.section + form, .back, .report-brand,
  .tag-form, button, .loading-overlay {
    display: none !important;
  }
  body { background: #fff !important; }
  .page { max-width: 100%; padding: 0; }
  .competitor, .summary, .diff { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
