:root {
  --bg: #f4f8ff;
  --bg-2: #e9f2ff;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --muted: #516072;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --secondary: #14b8a6;
  --shadow: 0 24px 70px rgba(37, 99, 235, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
}

* { 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:
    radial-gradient(circle at 10% 0%, rgba(20, 184, 166, 0.12), transparent 34%),
    radial-gradient(circle at 100% 10%, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 45%, #f6f9ff 100%);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: #fff;
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 999;
}
.skip-link:focus { top: 16px; }

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(150%) blur(18px);
  background: rgba(248, 251, 255, 0.82);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}
.back-link, .footer-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}
.back-link::before, .footer-back::before {
  content: "←";
}
.brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  justify-self: center;
}
.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.28);
}
.brand-name {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.lang-switcher {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  font-weight: 700;
}
.lang-btn.is-active {
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  color: white;
}

.hero {
  padding: 3.2rem 0 1.4rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
}
.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-strong);
  font-size: 0.92rem;
  font-weight: 800;
}
.eyebrow::before,
.section-kicker::before {
  content: "●";
  font-size: 0.68rem;
  color: var(--secondary);
}
.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.2rem, 4vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.hero-text,
.section-intro {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 62ch;
}
.hero-points {
  list-style: none;
  padding: 0;
  margin: 1.35rem 0 1.6rem;
  display: grid;
  gap: 0.85rem;
}
.hero-points li {
  position: relative;
  padding-left: 1.8rem;
  color: #1e293b;
}
.hero-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  font-size: 0.82rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.hero-actions, .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.9rem 1.2rem;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  color: white;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.22);
}
.btn-secondary,
.btn-ghost {
  background: rgba(255,255,255,0.82);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.1);
}
.hero-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: #f7fbff;
}

.calculator-section,
.info-section,
.seo-section {
  padding: 1.4rem 0 2rem;
}
.calculator-grid,
.seo-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.form-card,
.results-card,
.seo-card {
  padding: 1.5rem;
}
.section-heading h2,
.seo-card h2,
.summary-box h3,
.disclaimer-box h3,
.feature-card h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.15;
}
.section-heading { margin-bottom: 1.25rem; }
.section-heading.center { text-align: center; }

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.field-full { grid-column: 1 / -1; }
.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.1);
  overflow: hidden;
  min-height: 56px;
}
.input-wrap.no-suffix { grid-template-columns: 1fr; }
.input-wrap:focus-within {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.input-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0 1rem;
  color: var(--text);
  min-height: 56px;
}
.input-wrap .suffix {
  padding: 0 1rem;
  color: var(--muted);
  font-weight: 800;
}
.helper,
.form-message,
.summary-box p,
.disclaimer-box p,
.feature-card p,
.seo-card p,
.faq-list p,
summary {
  margin: 0.5rem 0 0;
  color: var(--muted);
}
.form-actions { margin-top: 1.2rem; }
.form-message {
  min-height: 1.5rem;
  margin-top: 1rem;
  font-weight: 700;
}
.form-message.is-error { color: #b91c1c; }
.form-message.is-success { color: #0f766e; }

.results-card { position: sticky; top: 92px; }
.result-highlight {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.2rem;
  border-radius: 22px;
  color: white;
  background: linear-gradient(135deg, #0f172a, #2563eb 70%, #14b8a6);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.2);
}
.result-highlight span {
  font-weight: 700;
  opacity: 0.9;
}
.result-highlight strong {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.result-item {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.result-item span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}
.result-item strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.2rem;
}
.summary-box,
.disclaimer-box {
  margin-top: 1rem;
  padding: 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.disclaimer-box {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(236, 245, 255, 0.88));
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.feature-card {
  padding: 1.3rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}
.feature-card h3 { font-size: 1.12rem; }

.seo-card {
  height: 100%;
}
.faq-list {
  display: grid;
  gap: 0.75rem;
}
.faq-list details {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.85);
}
.faq-list summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.site-footer {
  padding: 1.25rem 0 2rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.footer-inner p {
  margin: 0;
  color: var(--muted);
}
.footer-inner a { font-weight: 700; }

@media (max-width: 980px) {
  .hero-grid,
  .calculator-grid,
  .seo-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .results-card {
    position: static;
  }

  .hero { padding-top: 2rem; }
}

@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .back-link { justify-self: center; }

  .field-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .form-actions {
    flex-direction: column;
  }

  .btn { width: 100%; }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .form-card,
  .results-card,
  .seo-card,
  .feature-card {
    padding: 1.2rem;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

.analytics-section,
.pdf-section {
  padding: 1.4rem 0 2rem;
}

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

.chart-card {
  padding: 1.5rem;
  overflow: hidden;
}

.chart-card-heading h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.chart-card-heading p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.donut-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr);
  gap: 1.5rem;
  align-items: center;
  margin-top: 1.4rem;
}

.cost-donut {
  --base-share: 100%;
  width: min(230px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  margin-inline: auto;
  position: relative;
  background: conic-gradient(var(--primary) 0 var(--base-share), var(--secondary) var(--base-share) 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04), 0 22px 44px rgba(37, 99, 235, 0.12);
}

.cost-donut::after {
  content: "";
  position: absolute;
  inset: 23%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.donut-center {
  position: absolute;
  inset: 30%;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  z-index: 2;
}

.donut-center span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.donut-center strong {
  margin-top: 0.2rem;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.1;
}

.chart-legend {
  display: grid;
  gap: 0.9rem;
}

.legend-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.legend-row span:not(.legend-swatch) {
  color: var(--muted);
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border-radius: 999px;
}

.swatch-original { background: var(--primary); }
.swatch-extra { background: var(--secondary); }

.bar-chart {
  display: grid;
  gap: 1.1rem;
  margin-top: 1.4rem;
}

.bar-row {
  display: grid;
  gap: 0.48rem;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.bar-label span {
  color: var(--muted);
  font-weight: 700;
}

.bar-track {
  width: 100%;
  height: 15px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 0.55s cubic-bezier(.2,.8,.2,1);
}

.bar-down { background: linear-gradient(90deg, #64748b, #94a3b8); }
.bar-installments { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.bar-fees { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.bar-insurance { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.pdf-card {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  background:
    radial-gradient(circle at 100% 0%, rgba(20,184,166,0.15), transparent 35%),
    linear-gradient(135deg, rgba(255,255,255,0.95), rgba(239,246,255,0.93));
}

.pdf-copy h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.35rem);
  line-height: 1.12;
}

.pdf-copy p:not(.section-kicker) {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 68ch;
}

.pdf-action {
  min-width: 220px;
  text-align: center;
}

.pdf-action .btn {
  width: 100%;
}

.pdf-action .btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.25);
  transform: none;
  box-shadow: none;
}

.pdf-status {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.pdf-status.is-ready {
  color: #0f766e;
  font-weight: 700;
}

@media (max-width: 980px) {
  .charts-grid,
  .pdf-card {
    grid-template-columns: 1fr;
  }

  .pdf-action {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .donut-layout {
    grid-template-columns: 1fr;
  }

  .legend-row {
    grid-template-columns: auto 1fr;
  }

  .legend-row strong {
    grid-column: 2;
  }
}
