:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --surface-alt: #eef7f5;
  --text: #10201d;
  --muted: #5c6f6a;
  --primary: #0f766e;
  --primary-dark: #0a514c;
  --accent: #f59e0b;
  --border: #d9e5e2;
  --error: #b42318;
  --shadow: 0 18px 45px rgba(16, 32, 29, 0.10);
  --radius: 22px;
  --radius-sm: 14px;
  --container: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.narrow { max-width: 820px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: 999;
  padding: 10px 14px;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 10px;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 248, 247, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 229, 226, 0.9);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand span { font-size: 1rem; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.96rem;
}

.main-nav a {
  text-decoration: none;
  font-weight: 650;
}

.main-nav a:hover,
.main-nav a:focus-visible { color: var(--primary); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  margin: 5px 0;
  border-radius: 2px;
}

.hero {
  padding: 64px 0 28px;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.04em; }

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.6rem);
  max-width: 760px;
}

h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); margin: 0 0 12px; }
h3 { font-size: 1.2rem; margin: 0 0 10px; }

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 18px 0 26px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fuel-icon { font-size: 3.6rem; line-height: 1; }
.hero-card p { color: var(--muted); margin: 18px 0 4px; }
.hero-card strong { font-size: 1.75rem; letter-spacing: -0.04em; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  font-size: 1rem;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.ad-slot {
  min-height: 96px;
  margin: 26px 0;
  border: 1px dashed #bfd2ce;
  background: rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  color: #82918d;
  text-align: center;
  padding: 14px;
}

.ad-slot span {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.ad-slot-top { min-height: 90px; }
.ad-slot-content { min-height: 250px; }
.ad-slot-bottom { min-height: 120px; }

.calculator-section { padding: 24px 0 40px; }

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 24px;
  align-items: start;
}

.calculator-card,
.result-card,
.tips-card,
.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calculator-card { padding: clamp(22px, 4vw, 34px); }
.result-card {
  padding: clamp(22px, 4vw, 30px);
  position: sticky;
  top: 96px;
}

.section-heading.compact p,
.empty-state,
.calculation-summary,
.legal-card p,
.legal-card li { color: var(--muted); }

.fuel-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.field-group label {
  display: block;
  font-weight: 800;
  margin-bottom: 7px;
}

.field-group small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.88rem;
}

.input-wrapper {
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.input-wrapper input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 15px 16px;
  font: inherit;
  color: var(--text);
  min-height: 54px;
}

.input-wrapper span {
  flex: 0 0 auto;
  padding: 0 15px;
  color: var(--muted);
  font-weight: 800;
  border-left: 1px solid var(--border);
}

.form-error {
  min-height: 24px;
  margin: 0;
  color: var(--error);
  font-weight: 700;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-actions .btn { flex: 1 1 180px; }

.main-result {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 24px;
  border-radius: 18px;
  margin: 20px 0;
}

.main-result span {
  display: block;
  opacity: 0.86;
  font-weight: 700;
}

.main-result strong {
  display: block;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  margin-top: 8px;
  letter-spacing: -0.06em;
}

.result-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.result-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.result-list dt { color: var(--muted); }
.result-list dd { margin: 0; font-weight: 900; text-align: right; }

.content-section { padding: 54px 0; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
  gap: 24px;
  align-items: start;
}

.content-section article,
.faq-section .narrow {
  background: transparent;
}

.content-section p { color: var(--muted); }

.formula-box,
.contact-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 22px 0;
}

code {
  display: inline-block;
  white-space: normal;
  color: var(--primary-dark);
  font-weight: 800;
}

.tips-card { padding: 24px; }
.tips-card ul, .legal-card ul { padding-left: 20px; }
.tips-card li + li, .legal-card li + li { margin-top: 8px; }

.faq-section details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 12px 0;
  overflow: hidden;
}

.faq-section summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 850;
  list-style: none;
}

.faq-section summary::-webkit-details-marker { display: none; }
.faq-section details p { margin: 0; padding: 0 20px 20px; }

.site-footer {
  background: #0b1c19;
  color: #e7f1ee;
  padding: 42px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
}

.site-footer p { color: #a9bbb6; max-width: 520px; }
.site-footer nav { display: grid; gap: 10px; }
.site-footer a { color: #e7f1ee; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 28px; padding-top: 20px; color: #a9bbb6; }

.legal-page { padding: 48px 0; }
.legal-card { padding: clamp(24px, 4vw, 42px); }
.legal-card h2 { font-size: 1.35rem; margin-top: 30px; }
.legal-card a { color: var(--primary-dark); font-weight: 800; }

.cookie-banner {
  position: fixed;
  z-index: 80;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.cookie-banner p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.cookie-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-banner[hidden] { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 14px;
  }
  .main-nav.is-open { display: grid; }
  .main-nav a { padding: 10px; }
  .hero { padding-top: 42px; }
  .hero-grid,
  .calculator-layout,
  .content-grid,
  .footer-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .hero-card { min-height: auto; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 24px, var(--container)); }
  .header-inner { min-height: 66px; }
  .brand span { font-size: 0.94rem; }
  .hero { padding: 34px 0 18px; }
  .calculator-section { padding-top: 12px; }
  .calculator-card, .result-card { border-radius: 18px; }
  .input-wrapper { align-items: stretch; }
  .input-wrapper span { display: flex; align-items: center; font-size: 0.88rem; }
  .result-list div { align-items: start; }
  .cookie-banner { display: grid; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
