/* ---- Forkast POC design tokens (from Figma Highlight-Demo) ---- */
:root {
  --bg: #f0f4f8;
  --card: #ffffff;
  --border: #d9e1e7;
  --border-input: #e5e7eb;
  --ink: #232625;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --support: #7a8fa3;
  --brand: #1ea642;
  --brand-dark: #178537;
  --brand-tint: #eafaf0;
  --brand-tint-border: #c7ecd3;

  /* price tiers — approximate from Figma; centralized so the Thu restyle is a one-line swap */
  --tier-underpriced: #d97b2f;
  --tier-underpriced-bg: #fdf1e7;
  --tier-affordable: #2f7fed;
  --tier-affordable-bg: #e9f1fd;
  --tier-competitive: #1ea642;
  --tier-competitive-bg: #e7f7ec;
  --tier-premium: #7c5cbf;
  --tier-premium-bg: #f1ecfa;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 1.5px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Login page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
  padding: 41px 37px;
}
.login-card .logo { width: 89px; height: 32px; margin-bottom: 27px; display: block; }
.login-card h1 { font-size: 24px; font-weight: 700; line-height: 32px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 14px; line-height: 19.5px; margin: 0; }

.form { margin-top: 23px; display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 12px; font-weight: 500; letter-spacing: 0.24px;
  text-transform: uppercase; color: var(--muted-2);
}
.field input[type="text"],
.field input[type="password"] {
  height: 44px;
  border: 1px solid var(--border-input);
  border-radius: 12px;
  padding: 0 15px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 166, 66, 0.12);
}
.form-row { display: flex; align-items: center; justify-content: space-between; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.remember input { width: 14px; height: 14px; accent-color: var(--brand); }
.forgot { font-size: 12px; font-weight: 500; }

.btn-primary {
  height: 44px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.error-msg {
  color: #d92d20; font-size: 13px; margin: -8px 0 0; min-height: 0;
}
.divider { display: flex; align-items: center; gap: 12px; margin-top: 19px; color: var(--muted-2); font-size: 12px; font-weight: 500; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border-input); }
.contact { text-align: center; color: var(--muted); font-size: 13px; margin: 15px 0 0; }
.contact a { font-weight: 600; }

/* ---- Dashboard ---- */
.dash-wrap { max-width: 1320px; margin: 0 auto; padding: 40px 40px 80px; }
@media (max-width: 720px) { .dash-wrap { padding: 24px 16px 48px; } }

.dash-header { margin-bottom: 28px; }
.dash-header h1 { font-size: 30px; font-weight: 600; line-height: 38px; margin: 0 0 6px; }
.dash-header .sub { color: var(--support); font-size: 14px; margin: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.section-title { font-size: 20px; font-weight: 700; margin: 0 0 2px; }
.section-sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }

/* reveal / fade-in-up */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; margin-bottom: 24px; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }
.stat-tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 20px 22px; }
.stat-tile .label { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.stat-tile .label svg { width: 15px; height: 15px; color: var(--muted-2); }
.stat-tile .value { font-size: 28px; font-weight: 700; margin-top: 10px; }

/* opportunities */
.opps-card { background: var(--brand-tint); border: 1px solid var(--brand-tint-border); border-radius: var(--radius); padding: 24px 26px; }
.opps-card .head svg { width: 18px; height: 18px; color: var(--brand); vertical-align: middle; margin-right: 6px; }
.opps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 18px; }
@media (max-width: 820px) { .opps-grid { grid-template-columns: 1fr; } }
.opp-item { display: flex; gap: 12px; }
.opp-num { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.opp-item .t { font-size: 14px; font-weight: 700; margin: 2px 0 3px; }
.opp-item .d { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* map + competitors row */
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: stretch; margin-bottom: 24px; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
.two-col .reveal { margin-bottom: 0; }

.map-wrap { position: relative; }
#map { height: 340px; border-radius: 12px; border: 1px solid var(--border); z-index: 0; }
@media (max-width: 980px) { #map { height: 300px; } }
.pin { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28); }
.pin.store { background: var(--brand); width: 16px; height: 16px; box-shadow: 0 0 0 3px rgba(30, 166, 66, 0.2), 0 1px 3px rgba(0, 0, 0, 0.28); }
.pin.comp { background: #9aa7b2; width: 11px; height: 11px; }
.popup-title { font-weight: 600; font-size: 13px; }
.popup-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.map-callout { position: absolute; z-index: 1000; top: 18px; left: 18px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow-card); }
.map-callout .r { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.map-callout .r .x { color: var(--brand); }
.map-callout .m { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.map-legend { position: absolute; z-index: 1000; right: 14px; bottom: 14px; background: rgba(255,255,255,0.92); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 11px; color: var(--muted); }
.map-legend div { display: flex; align-items: center; gap: 7px; }
.map-legend div + div { margin-top: 5px; }
.map-legend .k { width: 9px; height: 9px; border-radius: 50%; }

.comp-row { padding: 14px 0; border-top: 1px solid var(--border-input); }
.comp-row:first-child { border-top: none; padding-top: 4px; }
.comp-row .n { font-size: 14px; font-weight: 700; }
.comp-row .desc { color: var(--muted-2); font-size: 12px; margin-top: 2px; }
.comp-row .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }

/* market overview */
.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 820px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
.tier-tile .top { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; }
.tier-tile .top svg { width: 14px; height: 14px; }
.tier-tile.t-underpriced .top { color: var(--tier-underpriced); }
.tier-tile.t-affordable .top { color: var(--tier-affordable); }
.tier-tile.t-competitive .top { color: var(--tier-competitive); }
.tier-tile.t-premium .top { color: var(--tier-premium); }
.loc-chip svg { width: 100%; height: 100%; }
.tier-tile .num { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 4px; }
.tier-tile .num .v { font-size: 26px; font-weight: 700; }
.tier-tile .num .pct { font-size: 12px; font-weight: 600; color: var(--muted); background: #f1f5f8; border-radius: 6px; padding: 2px 6px; }
.tier-tile .cap { font-size: 12px; color: var(--muted-2); }

.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--border-input); border-radius: 12px; }
table.prices { border-collapse: collapse; width: 100%; font-size: 12px; }
table.prices th, table.prices td { padding: 10px 12px; text-align: left; white-space: nowrap; }
table.prices thead th { background: #f7f9fb; color: var(--muted-2); font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; border-bottom: 1px solid var(--border-input); }
table.prices tbody tr + tr td { border-top: 1px solid #f0f3f6; }
table.prices .item-name { font-weight: 600; color: var(--ink); position: sticky; left: 0; background: var(--card); }
.cell .p { font-weight: 700; }
.cell .tag { font-size: 10px; text-transform: lowercase; }
.t-underpriced .p, .t-underpriced .tag { color: var(--tier-underpriced); }
.t-affordable .p, .t-affordable .tag { color: var(--tier-affordable); }
.t-competitive .p, .t-competitive .tag { color: var(--tier-competitive); }
.t-premium .p, .t-premium .tag { color: var(--tier-premium); }
td.t-underpriced { background: var(--tier-underpriced-bg); }
td.t-affordable { background: var(--tier-affordable-bg); }
td.t-competitive { background: var(--tier-competitive-bg); }
td.t-premium { background: var(--tier-premium-bg); }
td.blurred, th.blurred { filter: blur(5px); opacity: 0.65; user-select: none; }
.teaser {
  position: absolute; top: 50%; right: 24px; transform: translateY(-50%);
  background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(16,24,40,0.12);
  padding: 16px 18px; max-width: 210px; cursor: pointer; z-index: 2;
}
.teaser .k { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--brand); }
.teaser .m { font-size: 13px; color: var(--ink); margin-top: 6px; line-height: 1.4; }
.teaser:hover { border-color: var(--brand); }

/* guardrails */
.gr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.loc-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-tint); color: var(--brand-dark); border: 1px solid var(--brand-tint-border); border-radius: 9999px; padding: 6px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.gr-row { border: 1px solid var(--border-input); border-radius: 12px; margin-top: 14px; overflow: hidden; }
.gr-row-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; user-select: none; }
.gr-row-head .n { font-size: 14px; font-weight: 700; }
.gr-row-head .cat { font-size: 12px; color: var(--muted-2); }
.badge { font-size: 11px; font-weight: 600; border-radius: 9999px; padding: 3px 10px; text-transform: capitalize; }
.badge.t-underpriced { color: var(--tier-underpriced); background: var(--tier-underpriced-bg); }
.badge.t-affordable { color: var(--tier-affordable); background: var(--tier-affordable-bg); }
.badge.t-competitive { color: var(--tier-competitive); background: var(--tier-competitive-bg); }
.badge.t-premium { color: var(--tier-premium); background: var(--tier-premium-bg); }
.gr-row-head .chev { margin-left: auto; color: var(--muted-2); transition: transform 0.2s; }
.gr-row.open .chev { transform: rotate(180deg); }
.gr-body { display: none; padding: 6px 18px 22px; }
.gr-row.open .gr-body { display: block; }
.gr-yourprice { display: inline-block; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.gr-track { position: relative; height: 8px; background: #eef2f5; border-radius: 9999px; margin: 26px 0 10px; }
.gr-range { position: absolute; top: 0; height: 100%; background: var(--brand); border-radius: 9999px; }
.gr-median { position: absolute; top: -4px; width: 3px; height: 16px; background: var(--brand-dark); border-radius: 2px; transform: translateX(-50%); }
.gr-you { position: absolute; top: -5px; width: 3px; height: 18px; background: var(--ink); border-radius: 2px; transform: translateX(-50%); }
.gr-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.gr-scale .mid { color: var(--brand-dark); font-weight: 600; }

