:root {
  --bg: #f9f4f2;
  --signature: #08a2a5;
  --signature-dark: #069a9d;
  --text: #15161a;
  --text-soft: rgba(21, 22, 26, 0.62);
  --panel: #8d8f92;
  --line: #2f3033;
  --white: #ffffff;
  --card: #ffffff;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --danger: #c53030;
  --ok: #069a9d;
  --shadow-card: 0 4px 24px rgba(21, 22, 26, 0.06);
  --shadow-nav: 0 4px 16px rgba(21, 22, 26, 0.08);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Nunito", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ── Nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 244, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1.6px solid rgba(47, 48, 51, 0.12);
}

.nav-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--signature);
}

.brand-logo-full {
  height: 32px;
  width: auto;
  max-width: min(220px, 48vw);
  display: block;
}

/* ── Layout ── */
.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 60px;
  padding-top: 32px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--signature);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.subtitle {
  color: var(--text-soft);
  max-width: 680px;
  line-height: 1.55;
  font-size: 16px;
  font-weight: 500;
  margin-top: 14px;
}

/* ── Form grid ── */
.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 2px solid rgba(47, 48, 51, 0.1);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.span-2 { grid-column: span 2; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--signature) 0%, var(--signature-dark) 100%);
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 {
  margin: 24px 0 12px;
  font-size: 16px;
  font-weight: 800;
}

label {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 13px;
}

label strong { color: var(--signature); }

input,
select {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1.6px solid rgba(47, 48, 51, 0.2);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder { color: var(--panel); }

input:focus,
select:focus {
  outline: none;
  border-color: var(--signature);
  box-shadow: 0 0 0 3px rgba(8, 162, 165, 0.12);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-row.three { grid-template-columns: repeat(3, 1fr); }
.field-row.four { grid-template-columns: repeat(4, 1fr); }
.field-row.five { grid-template-columns: repeat(5, 1fr); }
.field-row.compact { grid-template-columns: 1fr 1fr; }

.hint {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 5px;
  font-weight: 600;
}

.checkbox input {
  width: auto;
  margin: 0;
  accent-color: var(--signature);
}

/* ── Segmented CTA button ── */
.actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-segmented {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1.6px solid var(--line);
  border-radius: var(--radius);
  background: var(--signature);
  color: var(--white);
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.btn-segmented:hover { background: var(--signature-dark); }
.btn-segmented:disabled { opacity: 0.55; cursor: wait; }

.btn-label {
  padding: 14px 22px;
  transition: transform 0.2s;
}

.btn-segmented:hover .btn-label { transform: translateX(3px); }

.btn-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-left: 1.6px solid rgba(255, 255, 255, 0.35);
  transition: transform 0.2s;
}

.btn-segmented:hover .btn-arrow { transform: translateX(4px); }

.loading-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 14px;
  margin: 0;
}

.loading-state[hidden] {
  display: none;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--signature);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* ── Download links ── */
.button-link {
  display: inline-flex;
  align-items: center;
  border: 1.6px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 20px;
  background: var(--signature);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.button-link:hover { background: var(--signature-dark); }

.button-link.secondary {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  border-color: rgba(47, 48, 51, 0.25);
}

.button-link.secondary:hover {
  border-color: var(--signature);
  background: rgba(8, 162, 165, 0.08);
  color: var(--signature);
}

/* ── Results ── */
.results { margin-top: 22px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric {
  border: 1.6px solid rgba(47, 48, 51, 0.12);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.7);
}

.metric .label {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric .value {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 800;
  word-break: break-word;
  color: var(--text);
}

.finding {
  border-left: 4px solid var(--panel);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-weight: 500;
}

.warning {
  border: 1.6px solid rgba(245, 158, 11, 0.5);
  border-left: 4px solid #d97706;
  padding: 12px 16px;
  background: #fffbeb;
  color: #92400e;
  border-radius: var(--radius);
  margin-top: 12px;
  font-weight: 700;
}

.warning.detail {
  font-weight: 600;
  font-size: 13px;
  background: #fff7ed;
}

.availability-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.availability-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1.4px solid rgba(47, 48, 51, 0.12);
  background: rgba(255, 255, 255, 0.75);
  min-width: 160px;
}

.availability-chip .chip-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}

.availability-chip .chip-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.availability-chip.severity-info,
.report-notice.severity-info {
  border-color: rgba(107, 114, 128, 0.35);
  background: #f3f4f6;
  color: #374151;
}

.availability-chip.severity-warning,
.report-notice.severity-warning {
  border-color: rgba(245, 158, 11, 0.45);
  background: #fffbeb;
  color: #92400e;
}

.availability-chip.severity-critical,
.report-notice.severity-critical {
  border-color: rgba(239, 68, 68, 0.45);
  background: #fee2e2;
  color: #991b1b;
}

.report-notice {
  border: 1.6px solid rgba(107, 114, 128, 0.35);
  border-left: 4px solid #6b7280;
  padding: 12px 16px;
  background: #f3f4f6;
  color: #374151;
  border-radius: var(--radius);
  margin-top: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.report-notice.detail {
  font-size: 13px;
  margin-top: 6px;
}

.finding.medium { border-left-color: #d97706; }
.finding.high { border-left-color: var(--danger); }
.finding.positive { border-left-color: var(--signature); }
.finding.neutral { border-left-color: #3b82f6; }

.finding strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 800;
}

.download-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ── Footer ── */
.site-footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1.6px solid rgba(47, 48, 51, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer-logo {
  height: 28px;
  width: auto;
  max-width: 200px;
  color: var(--signature);
}

.site-footer p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

/* ── Input flow ── */
.source-toggle {
  border: 0;
  margin: 18px 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.weather-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.weather-actions {
  margin-top: 6px;
  margin-bottom: 12px;
}

.source-toggle legend {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
}

.source-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1.6px solid rgba(47, 48, 51, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  margin: 0;
  transition: border-color 0.15s, background 0.15s;
}

.source-option:has(input:checked) {
  border-color: var(--signature);
  background: rgba(8, 162, 165, 0.08);
}

.source-option input {
  margin-top: 3px;
  width: auto;
  accent-color: var(--signature);
}

.source-option-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.source-option-body strong {
  font-size: 14px;
}

.source-option-body small {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.inline-status {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--signature);
}

.detected-store-preview {
  border: 1.6px solid rgba(8, 162, 165, 0.25);
  border-radius: var(--radius);
  background: rgba(8, 162, 165, 0.06);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.compact-btn {
  padding: 8px 14px !important;
  font-size: 13px !important;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0;
}

.preview-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-grid dt {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
}

.preview-grid dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.match-warning {
  border: 1.6px solid rgba(217, 119, 6, 0.45);
  border-left: 4px solid #d97706;
  background: #fffbeb;
  color: #92400e;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 14px;
}

.rules-collapsible {
  border: 0;
}

.rules-collapsible summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
  font-size: 18px;
  user-select: none;
}

.rules-collapsible summary::-webkit-details-marker {
  display: none;
}

.rules-collapsible summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--signature);
  font-size: 18px;
  transition: transform 0.15s;
}

.rules-collapsible[open] summary::after {
  transform: rotate(180deg);
}

.inline-step {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.rules-summary-text small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  margin-top: 2px;
}

.rules-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1.6px solid rgba(47, 48, 51, 0.1);
}

.tariff-auto-note {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.5;
}

.tariff-override {
  margin-top: 14px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .grid-form,
  .field-row,
  .field-row.three,
  .field-row.four,
  .field-row.five,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .span-2 { grid-column: span 1; }

  .source-toggle,
  .weather-mode-row,
  .preview-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 480px) {
  .shell { width: calc(100% - 20px); }

  .btn-label { padding: 12px 16px; font-size: 14px; }
}
