:root {
  --bg: #f8fafc;
  --bg-alt: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #dbe2ea;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --good-bg: #dcfce7;
  --good-text: #166534;
  --warn-bg: #fef3c7;
  --warn-text: #92400e;
  --bad-bg: #fee2e2;
  --bad-text: #991b1b;
  --neutral-bg: #e2e8f0;
  --neutral-text: #334155;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* { 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;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(219, 226, 234, 0.7);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  font-family: inherit;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text > span {
  display: block;
}

.logo-text small {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  font-weight: 600;
}

.hero {
  padding: 3.5rem 0 2rem;
}

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

.hero-grid > * {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.hero-support {
  margin-top: auto;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.78rem;
}

.hero h1,
.section h2,
.card h2,
.card h3 {
  margin-top: 0;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.08;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 58ch;
}

.hero-points {
  padding-left: 1.1rem;
  color: var(--muted);
}

.primary-btn,
.secondary-btn,
.unit-btn {
  appearance: none;
  border: none;
  font: inherit;
  cursor: pointer;
  border-radius: 14px;
  transition: 0.2s ease;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
  padding: 0.95rem 1.2rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.primary-btn:hover { background: var(--accent-dark); }

.hero-copy .primary-btn {
  align-self: flex-start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.calculator-card {
  padding: 1.25rem;
}

.card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calculator-heading {
  min-width: 0;
}

.calculator-heading h2 {
  margin: 0;
  font-size: clamp(0.98rem, 1.05vw, 1.12rem);
  line-height: 1.2;
  max-width: none;
  white-space: nowrap;
}

.unit-toggle {
  flex-shrink: 0;
  background: #e2e8f0;
  padding: 0.25rem;
  border-radius: 16px;
  display: inline-flex;
  gap: 0.2rem;
}

.unit-btn {
  padding: 0.65rem 0.85rem;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
}
.unit-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.form-grid label {
  display: grid;
  grid-template-rows: auto 3.35em auto;
  align-items: start;
}

label span {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
}

input {
  width: 100%;
  min-height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

input:focus {
  outline: 2px solid rgba(37,99,235,0.18);
  border-color: var(--accent);
}

.feedback {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  font-weight: 700;
}
.feedback.good { background: var(--good-bg); color: var(--good-text); }
.feedback.warn { background: var(--warn-bg); color: var(--warn-text); }
.feedback.bad { background: var(--bad-bg); color: var(--bad-text); }
.feedback.neutral { background: var(--neutral-bg); color: var(--neutral-text); }

.results-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: #fbfdff;
}

.result-card p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.result-card strong {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.result-card.emphasis {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.result-card.winner {
  background: #f8fafc;
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.08);
}

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

.secondary-btn {
  padding: 0.8rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 700;
}
.secondary-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.privacy-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.hero-support {
  margin-top: auto;
  padding: 1.25rem;
}

.hero-support h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.hero-support-grid {
  display: grid;
  gap: 1rem;
}

.hero-support-grid article {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.hero-support-grid article:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.hero-support-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.hero-support-grid p {
  margin: 0;
  color: var(--muted);
}

.section {
  padding: 1.25rem 0 3rem;
}
.section-light { background: linear-gradient(180deg, #ffffff 0%, var(--bg-alt) 100%); }

.info-grid,
.feature-grid {
  display: grid;
  gap: 1rem;
}

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

.info-card,
.feature-card,
.faq-item {
  padding: 1.25rem;
}

.narrow {
  width: min(860px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.faq-list {
  display: grid;
  gap: 1rem;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1rem 0 2rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero-grid,
  .info-grid,
  .feature-grid,
  .form-grid,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }

  .hero-grid > * {
    height: auto;
  }

  .card-header {
    grid-template-columns: 1fr;
  }

  .calculator-heading h2 {
  margin: 0;
  font-size: clamp(0.98rem, 1.05vw, 1.12rem);
  line-height: 1.2;
  max-width: none;
  white-space: nowrap;
}
}

@media (max-width: 640px) {
  .nav {
    align-items: start;
    padding: 0.8rem 0;
    flex-direction: column;
  }

  .actions,
  .footer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn,
  .secondary-btn,
  .unit-toggle {
    width: 100%;
  }

  .unit-toggle {
    justify-content: stretch;
  }

  .unit-btn {
    flex: 1;
  }
}

label small {
  display: block;
  margin: -0.1rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
  min-height: 3.35em;
}

.section-intro {
  color: var(--muted);
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}

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

.mini-card {
  padding: 1.25rem;
}

@media (max-width: 900px) {
  .mini-grid {
    grid-template-columns: 1fr;
  }
}


.internal-links,
.hero-note {
  color: var(--muted);
  font-size: 0.98rem;
}

.internal-links {
  margin: -0.2rem 0 0.9rem;
}

.internal-links a {
  color: var(--accent);
  text-decoration: none;
}

.internal-links a:hover {
  text-decoration: underline;
}

.hero-note {
  margin: 0.9rem 0 0;
}

/* --- Related tools --- */
.related-tools-section {
  padding: 0 0 2rem;
}

.related-tools {
  padding: 1.25rem;
}

.related-tools h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.related-tools ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.related-tools li {
  margin: 0;
}

.related-tools a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.related-tools a:hover {
  text-decoration: underline;
}

/* --- Contact form --- */
.contact-card h1,
.thank-you-card h1 {
  margin-bottom: 0.75rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
}

.contact-form textarea {
  width: 100%;
  min-height: 180px;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
  font: inherit;
  color: var(--text);
  background: #fff;
  resize: vertical;
}

.contact-form textarea:focus {
  outline: 2px solid rgba(37,99,235,0.18);
  border-color: var(--accent);
}

.contact-form .primary-btn {
  justify-self: start;
}

.hidden {
  display: none;
}

.thank-you-card {
  text-align: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.thank-you-card p {
  margin-top: 1rem;
}
