:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #0f766e;
  --success: #047857;
  --danger: #b91c1c;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --radius: 22px;
  --radius-sm: 14px;
  --max-width: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.15), transparent 30%),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
  padding: 24px 0 96px;
}

.site-header,
.hero,
.calculator-layout,
.content-grid,
.faq-section,
.site-footer {
  width: 100%;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
}

.site-nav a {
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: stretch;
  padding: 18px 0 42px;
}

.hero-copy,
.hero-card,
.calculator-panel,
.results-panel,
.content-card,
.faq-section,
.site-footer {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 36px;
}

.eyebrow,
.section-kicker,
.result-kicker,
.hero-card-label {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.hero h1,
.section-heading h2,
.content-card h2 {
  margin: 0 0 16px;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  max-width: 12ch;
}

.hero-text,
.hero-note,
.section-heading p,
.content-card p,
#result-description,
#formula-copy,
.faq-list p,
.site-footer p,
.cookie-banner p,
.share-box p {
  color: var(--muted);
  line-height: 1.65;
}

.hero-note {
  margin-top: 16px;
  font-size: 0.98rem;
}

.hero-actions,
.form-actions,
.footer-links,
.share-box-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.88rem 1.2rem;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.button-secondary {
  background: white;
  border-color: var(--line);
  color: var(--text);
}

.hero-points {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.hero-points li::before {
  content: "✓";
  color: var(--success);
  font-weight: 800;
  margin-right: 10px;
}

.hero-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
  color: white;
}

.hero-card h2 {
  margin: 0 0 20px;
  font-size: 1.8rem;
  line-height: 1.2;
}

.hero-stat-grid,
.metrics-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-stat-grid div,
.metric-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.hero-stat-grid span,
.metric-card span {
  display: block;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.72);
}

.hero-stat-grid strong,
.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
}

.hero-card-note {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.74);
}

.calculator-section {
  padding: 18px 0 32px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
}

.calculator-panel,
.results-panel,
.content-card,
.faq-section,
.site-footer {
  padding: 28px;
}

.preset-row,
.toggle-row,
.field,
.callout-box,
.comparison-result {
  display: grid;
  gap: 8px;
}

.preset-row,
.toggle-row {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-wide {
  grid-column: 1 / -1;
}

label {
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  background: white;
  color: var(--text);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.toggle-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.hidden {
  display: none !important;
}

.error-text {
  min-height: 1.5rem;
  margin: 10px 0 0;
  color: var(--danger);
  font-weight: 600;
}

.results-panel {
  display: grid;
  gap: 20px;
  align-content: start;
}

.result-summary h3,
.callout-box h4,
.comparison-result h4 {
  margin: 0 0 10px;
}

.metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  border-color: rgba(15, 23, 42, 0.08);
  background: var(--surface-strong);
}

.metric-card-highlight {
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.06));
  border-color: rgba(15, 118, 110, 0.18);
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  color: var(--text);
}

.callout-box,
.comparison-result {
  padding: 18px;
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.savings-box {
  background: rgba(4, 120, 87, 0.08);
  border-color: rgba(4, 120, 87, 0.16);
}

.share-box {
  background: rgba(15, 118, 110, 0.07);
  border-color: rgba(15, 118, 110, 0.14);
}

.share-box-header {
  align-items: flex-start;
  justify-content: space-between;
}

.share-box-header h4,
.share-status {
  margin: 0;
}

.share-button {
  align-self: center;
}

.share-status {
  color: var(--accent);
  font-weight: 600;
}

.reference-section {
  padding: 8px 0 20px;
}

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

.reference-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.reference-card h3,
.reference-card p,
.reference-card a {
  margin: 0;
}

.reference-card p {
  color: var(--muted);
  line-height: 1.6;
}

.reference-card a {
  font-weight: 700;
  color: var(--primary-strong);
  text-decoration: none;
}

.reference-card a:hover {
  text-decoration: underline;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 8px 0 32px;
}

.content-card ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.comparison-link-grid {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.comparison-link-card {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.comparison-link-card:hover,
.comparison-link-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.08);
}

.comparison-link-card strong {
  font-size: 1.02rem;
}

.comparison-link-card span {
  color: var(--muted);
  line-height: 1.55;
}

.faq-list {
  display: grid;
  gap: 14px;
}

details {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: white;
  padding: 16px 18px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

summary::-webkit-details-marker {
  display: none;
}

.site-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
}

.cookie-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(calc(100% - 32px), 420px);
  background: rgba(15, 23, 42, 0.96);
  color: white;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.32);
  z-index: 20;
}

.cookie-banner p {
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0;
}

@media (max-width: 960px) {
  .hero,
  .calculator-layout,
  .content-grid,
  .site-footer {
    grid-template-columns: 1fr;
    display: grid;
  }

  .reference-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--max-width));
    padding-top: 14px;
  }

  .hero-copy,
  .hero-card,
  .calculator-panel,
  .results-panel,
  .content-card,
  .faq-section,
  .site-footer {
    padding: 20px;
    border-radius: 18px;
  }

  .form-grid,
  .metrics-grid,
  .reference-grid {
    grid-template-columns: 1fr;
  }

  .share-box-header {
    flex-direction: column;
    align-items: stretch;
  }

  .share-button,
  .button,
  .site-nav a {
    width: 100%;
  }

  .site-nav {
    width: 100%;
  }

  .site-footer {
    display: block;
  }
}
