/* NorthCart landing page: light theme */

:root {
  --bg: #F6FAF7;
  --surface: #FFFFFF;
  --surface-alt: #EEF6F1;
  --surface-sunken: #F3F7F4;
  --border: #DCE7E0;
  --border-strong: #C6D6CC;

  --text: #12261C;
  --text-muted: #4B5F55;
  --text-dim: #6B7C73;

  --primary: #0B7A4B;
  --primary-hover: #09663F;
  --primary-soft: #E3F4EA;
  --primary-ink: #075A37;

  --gold: #F5A524;
  --gold-soft: #FFF3DC;
  --gold-ink: #8A5300;

  --danger: #C0352B;
  --danger-soft: #FDECEA;
  --warn: #B45309;
  --warn-soft: #FEF3C7;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(18, 38, 28, 0.06);
  --shadow: 0 4px 16px rgba(18, 38, 28, 0.08);
  --shadow-lg: 0 18px 40px rgba(18, 38, 28, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.text-primary { color: var(--primary); }
.text-good { color: var(--primary); }
.text-bad { color: var(--danger); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: var(--transition);
  border: 1.5px solid transparent;
}

.btn:focus-visible,
.link-btn:focus-visible,
.preset-pill:focus-visible,
.fuel-pill:focus-visible,
.grade-pill:focus-visible,
.faq-question:focus-visible,
.auth-tab:focus-visible {
  outline: 3px solid rgba(11, 122, 75, 0.35);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(11, 122, 75, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-alt);
}

.btn-lg {
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.link-btn {
  color: var(--primary);
  font-weight: 600;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover {
  color: var(--primary-hover);
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-actions > .auth-signed-out,
.nav-actions > .auth-signed-in {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 220px;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 0 10px;
}

.nav-toggle:hover {
  background: var(--surface-alt);
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

/* Hero */

.hero {
  padding: 4.5rem 0 4rem;
  background:
    radial-gradient(900px 400px at 85% 0%, rgba(11, 122, 75, 0.10), transparent 70%),
    radial-gradient(700px 360px at 0% 100%, rgba(245, 165, 36, 0.10), transparent 70%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.pill-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-title span {
  color: var(--primary);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hero-auth {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-welcome {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.hero-welcome strong {
  color: var(--text);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.stat-item strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.stat-item span {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.4;
  display: block;
}

.hero-visual {
  position: relative;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.floating-badge {
  position: absolute;
  left: -1.5rem;
  bottom: -1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.floating-badge-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gold-soft);
  font-size: 1.2rem;
}

.floating-badge strong {
  display: block;
  font-size: 0.95rem;
}

.floating-badge span {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Sections */

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--surface-alt);
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.75rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.75rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Cards, pills & forms (shared by calculator and price alerts) */

.calc-card {
  max-width: 940px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pills-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  align-self: center;
  margin-right: 0.25rem;
}

.preset-pill {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.preset-pill:hover {
  border-color: var(--primary);
  color: var(--primary-ink);
}

.preset-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.calc-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.input-box {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.input-box h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.tag-neutral { background: var(--surface-alt); color: var(--text-muted); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-good { background: var(--primary-soft); color: var(--primary-ink); }

.form-group {
  margin-bottom: 1rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 122, 75, 0.15);
}

.form-control:disabled {
  background: var(--surface-alt);
  color: var(--text-dim);
}

.input-prefix {
  position: relative;
}

.input-prefix > span {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--text-dim);
}

.input-prefix .form-control {
  padding-left: 1.9rem;
}

/* Shrinkflation calculator */

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.calc-result {
  background: var(--danger-soft);
  border: 1px solid #F5C6C1;
  border-radius: var(--radius);
  padding: 1.5rem;
}

.result-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.result-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--danger);
}

.result-main h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--danger);
  letter-spacing: -0.02em;
}

.result-badge {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.metric-pill {
  background: var(--surface);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.metric-pill span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.metric-pill strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.bar-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.bar-container {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.bar-fill {
  background: var(--primary);
  transition: width 0.4s ease;
}

.bar-loss {
  background: repeating-linear-gradient(45deg, #E9837A, #E9837A 6px, #F2A79F 6px, #F2A79F 12px);
  transition: width 0.4s ease;
}

/* Price radar & alerts */

.radar-item-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.radar-item-head strong {
  display: block;
  font-size: 1.02rem;
}

.radar-item-head span {
  font-size: 0.88rem;
  font-weight: 600;
}

.emoji-tile {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 1.8rem;
  flex-shrink: 0;
}

.comparison-box {
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.comparison-box span {
  display: block;
  font-size: 0.78rem;
  color: var(--primary-ink);
}

.comparison-box strong {
  font-size: 0.9rem;
}

.quick-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.quick-targets .preset-pill {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.status-text {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.status-good { color: var(--primary); }
.status-warn { color: var(--warn); }
.status-bad { color: var(--danger); }

.trend-card {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.trend-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.trend-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trend-head p {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.trend-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.trend-badge.is-flat {
  background: var(--warn-soft);
  color: var(--warn);
}

.trend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stat-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}

.stat-chip span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.stat-chip strong {
  font-size: 0.92rem;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 220px;
  border-radius: 10px;
  background: var(--surface-sunken);
  overflow: hidden;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 220px;
}

.chart-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  box-shadow: var(--shadow);
  z-index: 10;
}

.chart-tooltip strong {
  display: block;
  color: var(--primary-ink);
}

.chart-tooltip span {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-line {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.legend-dash {
  width: 16px;
  border-top: 2px dashed #D97706;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}

.radar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.radar-store-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.radar-store-filter .form-control {
  width: auto;
  padding: 0.5rem 0.8rem;
  font-size: 0.88rem;
}

.radar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.alerts-box {
  margin-top: 1.5rem;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.alerts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.alerts-head span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alerts-empty {
  font-size: 0.88rem;
  color: var(--text-dim);
}

.alert-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
}

.alert-row-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.alert-row-emoji {
  font-size: 1.4rem;
}

.alert-row-info strong {
  display: block;
  font-size: 0.88rem;
}

.alert-row-info span {
  font-size: 0.78rem;
  color: var(--primary-ink);
}

.alert-row-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.alert-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--danger);
  font-size: 1rem;
}

.alert-remove-btn:hover {
  background: var(--danger-soft);
}

/* Toast */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 380px;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.3s ease;
}

.toast.toast-warn {
  border-left-color: var(--gold);
}

.toast-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.toast-head strong {
  font-size: 0.95rem;
}

.toast-close {
  font-size: 1rem;
  color: var(--text-dim);
  padding: 0 0.25rem;
}

.toast p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Features */

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 48px;
  padding: 0 0.5rem;
  border-radius: 12px;
  background: var(--primary-soft);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Fuel radar */

.fuel-controls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.fuel-controls-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.fuel-control-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.fuel-location-pills,
.fuel-grade-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.fuel-pill,
.grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.fuel-pill:hover,
.grade-pill:hover {
  border-color: var(--primary);
  color: var(--primary-ink);
}

.fuel-pill.active,
.grade-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.grade-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: var(--gold-soft);
  color: var(--gold-ink);
}

.diesel-badge {
  background: #E5E7EB;
  color: #374151;
}

.fuel-meta-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.6fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.fuel-meta-item {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.fuel-meta-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.fuel-meta-value {
  font-size: 0.98rem;
  font-weight: 700;
}

.cross-border-item {
  background: var(--primary-soft);
  border-color: transparent;
}

.cross-border-item .fuel-meta-value {
  color: var(--primary-ink);
  font-size: 0.9rem;
}

.cheapest-hero-card {
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--surface) 55%, var(--primary-soft));
}

.cheapest-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cheapest-rank-badge {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.cheapest-distance {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cheapest-main-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.cheapest-brand-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cheapest-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0.2rem 0;
}

.cheapest-address {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.cheapest-amenities,
.station-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.amenity-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.amenity-chip.chip-good { background: var(--primary-soft); color: var(--primary-ink); }
.amenity-chip.chip-gold { background: var(--gold-soft); color: var(--gold-ink); }

.cheapest-pricing-block {
  display: flex;
  gap: 1rem;
}

.cheapest-price-box,
.tank-savings-box {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  text-align: center;
  min-width: 170px;
}

.cheapest-price-box {
  background: var(--surface);
  border: 1px solid var(--border);
}

.cheapest-price-label,
.savings-title {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.cheapest-price-num {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.price-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
}

.cheapest-cash-flag,
.savings-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tank-savings-box {
  background: var(--gold-soft);
}

.savings-amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold-ink);
}

.station-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.station-list-header h4 {
  font-size: 1.05rem;
}

.station-count-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.station-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.station-card.is-cheapest {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.station-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.station-brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-ink);
  background: var(--primary-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.station-distance-badge {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.station-card-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.station-card-addr {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.station-prices-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.station-price-cell {
  background: var(--surface-sunken);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
}

.cell-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.cell-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cell-val.highlighted {
  color: var(--primary);
}

.station-bottom-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

.station-rank {
  font-weight: 700;
  color: var(--text-muted);
}

.station-rank.is-best {
  color: var(--primary);
}

.fuel-callout-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.callout-content {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.callout-icon {
  font-size: 1.5rem;
}

.callout-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Stores */

.stores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.store-country-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.country-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.country-head small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}

.store-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.store-tag {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 0.88rem;
  font-weight: 500;
}

/* Pricing */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
}

.pricing-card.featured {
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-lg);
}

.featured-ribbon {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: var(--gold);
  color: #3D2500;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.pricing-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.pricing-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.pricing-amount {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.pricing-period {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  flex-grow: 1;
}

.pricing-features li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.92rem;
}

.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 800;
}

/* Download */

.download-box {
  max-width: 860px;
  margin: 0 auto;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.download-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.download-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-soft);
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.download-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.download-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.download-account {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  text-align: center;
}

.download-account p {
  color: var(--text-muted);
}

.download-account strong {
  color: var(--text);
}

.download-account-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

/* FAQ */

.faq-list {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.1rem 1.25rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
}

.faq-icon {
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.15rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* Auth modal */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(18, 38, 28, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem 1.5rem;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-dim);
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-header img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin: 0 auto 0.6rem;
}

.auth-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.auth-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-alt);
  margin-bottom: 1.25rem;
}

.auth-tab {
  padding: 0.55rem;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 4rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.password-toggle:hover {
  background: var(--primary-soft);
}

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: -0.4rem 0 1rem;
  font-size: 0.85rem;
}

.auth-message {
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--danger-soft);
  color: var(--danger);
}

.auth-message.is-success {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.auth-switch {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand .logo-group {
  margin-bottom: 0.75rem;
}

.footer-brand .logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-col h5 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

/* Responsive */

@media (max-width: 1080px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .station-grid { grid-template-columns: repeat(2, 1fr); }
  .fuel-meta-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.8rem 0.75rem;
    font-size: 1rem;
  }

  .hero { padding: 3rem 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-visual { max-width: 560px; }
  .floating-badge { left: 1rem; bottom: -1.25rem; }

  .pricing-grid { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
  .pricing-card.featured { margin-top: 0.75rem; }

  .fuel-controls-row { flex-direction: column; }
  .cheapest-main-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 1rem; }
  .section { padding: 3.5rem 0; }

  .logo-text { font-size: 1.05rem; }
  .nav-actions .btn { padding: 0.5rem 0.75rem; font-size: 0.88rem; }
  .user-chip .user-email { display: none; }
  .user-chip { padding: 0.25rem; }

  .hero-actions,
  .hero-auth { flex-direction: column; align-items: stretch; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { grid-template-columns: 1fr; gap: 0.85rem; }
  .stat-item { display: flex; align-items: baseline; gap: 0.6rem; }
  .stat-item strong { font-size: 1.25rem; white-space: nowrap; }

  .calc-card,
  .fuel-controls-card { padding: 1.25rem; }
  .calc-inputs-grid { grid-template-columns: 1fr; }
  .result-main { flex-direction: column; align-items: flex-start; }
  .result-main h3 { font-size: 1.5rem; }
  .result-metrics { grid-template-columns: 1fr; }

  .radar-actions { flex-direction: column; align-items: stretch; }
  .radar-buttons { flex-direction: column; }
  .radar-buttons .btn { width: 100%; }

  .features-grid,
  .station-grid,
  .stores-grid,
  .download-grid { grid-template-columns: 1fr; }
  .fuel-meta-bar { grid-template-columns: 1fr 1fr; }
  .cross-border-item { grid-column: 1 / -1; }
  .cheapest-pricing-block { flex-direction: column; }
  .fuel-callout-footer { flex-direction: column; align-items: stretch; }
  .footer-grid { grid-template-columns: 1fr; }

  .toast { left: 1rem; right: 1rem; max-width: none; }
}

/* Very narrow phones: "Log in" stays available in the hero and download section. */
@media (max-width: 380px) {
  .nav-actions .auth-signed-out .btn-ghost { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
