:root {
  --bg: #f7faff;
  --panel: #ffffff;
  --panel-soft: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%);
  --text: #18314f;
  --muted: #55708e;
  --line: #d5e3f4;
  --primary: #0f4ca7;
  --primary-dark: #0a3779;
  --primary-soft: #edf4ff;
  --success: #15654a;
  --error: #b42318;
  --shadow: 0 16px 40px rgba(17, 61, 125, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f9fbff 0%, #f3f8ff 50%, #f9fbff 100%);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

.container {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.page-shell { min-height: 100vh; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(249, 251, 255, 0.88);
  border-bottom: 1px solid rgba(213, 227, 244, 0.75);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 94px;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
}

.brand-logo {
  height: 160px;
  width: 1;
  object-fit: contain;
}

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

.nav a:hover { color: var(--primary); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}
.button:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #8aa8cf;
  border-color: #8aa8cf;
}
.button-ghost { background: #fff; color: var(--primary); }
.button-ghost:hover { background: var(--primary-soft); }
.button-ghost:disabled {
  background: #f1f5fb;
  color: #7f97b6;
  border-color: #c7d7ea;
}
.button-small { min-height: 40px; padding-inline: 16px; }

.section { padding: 68px 0; }
.section-soft { background: rgba(255,255,255,0.55); }
.hero { padding: 48px 0 56px; }
.hero-grid,
.calculator-layout,
.contact-layout {
  display: grid;
  grid-template-columns: 1.16fr 0.84fr;
  gap: 30px;
  align-items: start;
}

.hero-copy-wrap { padding-top: 18px; }
.hero h1 {
  font-size: clamp(2.05rem, 5vw, 3.3rem);
  line-height: 1.08;
  margin: 8px 0 16px;
  letter-spacing: -0.03em;
}
.hero-copy, .section-copy, .muted {
  font-size: 1rem;
  color: var(--muted);
  max-width: 760px;
}
.muted-copy { margin-top: 10px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.hero-actions, .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}
.hero-points li {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(213, 227, 244, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.soft-panel { background: var(--panel-soft); }
.hero-card h2, .section-head h2, .quote-panel h3 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}
.hero-card-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.hero-card-list div {
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.hero-card-list strong { display: block; margin-bottom: 4px; }
.hero-card-list span { color: var(--muted); font-size: 0.95rem; }

.section-head { margin-bottom: 24px; }
.cards-grid, .steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.service-card, .step-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 8px 30px rgba(17, 61, 125, 0.05);
}
.service-card h3, .step-card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.service-card p, .step-card p { margin: 0; color: var(--muted); font-size: 0.96rem; }
.step-card strong {
  display: inline-flex;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid label,
.form-grid fieldset {
  display: grid;
  gap: 8px;
}
.form-grid span,
.form-grid legend {
  font-size: 0.94rem;
  font-weight: 600;
}
label input,
label select,
label textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
}
label textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus {
  outline: 3px solid rgba(15, 76, 167, 0.15);
  outline-offset: 1px;
  border-color: rgba(15, 76, 167, 0.45);
}
.full-span { grid-column: 1 / -1; }

.checkbox-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(248, 251, 255, 0.85);
}
.checkbox-panel label {
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}
.checkbox-panel input[type="checkbox"] { margin-top: 4px; }
.single-check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; }

.quote-panel { position: sticky; top: 116px; }
.quote-price {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f6faff, #e9f2ff);
  border: 1px solid var(--line);
}
.quote-price span, .quote-meta span { color: var(--muted); font-size: 0.92rem; }
.quote-price strong { font-size: 2rem; letter-spacing: -0.03em; }
.quote-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.quote-meta div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
}
.quote-meta strong { display: block; margin-top: 4px; }
.quote-breakdown {
  list-style: none;
  padding: 0;
  margin: 16px 0 10px;
  display: grid;
  gap: 10px;
}
.quote-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.quote-breakdown strong { color: var(--text); text-align: right; }
.small-note { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; }

.tabs {
  display: inline-flex;
  background: #eef5ff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}
.tab-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.tab-button.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 6px 20px rgba(17, 61, 125, 0.08);
}
.subgrid {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.subgrid.is-visible { display: grid; }
.rut-box, .quote-attach-box { background: #f8fbff; }
.rut-note { margin: 0; color: var(--muted); font-size: 0.9rem; }
.rut-details-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  justify-self: start;
  padding: 0;
}

.rut-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 520px;
  width: calc(100% - 24px);
  padding: 20px;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: calc(100vh - 24px);
  overflow: auto;
}
.rut-dialog::backdrop {
  background: rgba(16, 38, 70, 0.45);
}
.rut-dialog h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}
.rut-dialog p {
  margin: 0 0 10px;
  color: var(--muted);
}

.warning-dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  width: min(560px, calc(100% - 24px));
  padding: 20px;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  box-shadow: 0 24px 60px rgba(17, 61, 125, 0.2);
}
.warning-dialog::backdrop {
  background: rgba(16, 38, 70, 0.55);
  backdrop-filter: blur(2px);
}
.warning-close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.warning-eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.warning-dialog h3 {
  margin: 0 0 8px;
}
.warning-dialog p {
  margin: 0;
  color: var(--muted);
}
.warning-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.form-status {
  min-height: 24px;
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
}
.success-box {
  border: 1px solid rgba(21, 101, 74, 0.18);
  background: #f4fffa;
  border-radius: 18px;
  overflow: hidden;
}
.success-toggle {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 16px 18px;
  color: var(--success);
  font-weight: 700;
  cursor: pointer;
}
.success-content {
  padding: 0 18px 18px;
  display: grid;
  gap: 10px;
}
.success-content[hidden] { display: none; }
.honeypot {
  position: absolute !important;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.site-footer {
  border-top: 1px solid rgba(213, 227, 244, 0.8);
  padding: 28px 0 34px;
  background: rgba(255,255,255,0.7);
}
.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.footer-wrap p { margin: 6px 0 0; color: var(--muted); }
.footer-wrap div:last-child { display: flex; gap: 18px; color: var(--muted); }

@media (max-width: 980px) {
  .nav { display: none; }
  .hero-grid,
  .calculator-layout,
  .contact-layout,
  .cards-grid,
  .steps-grid { grid-template-columns: 1fr; }
  .quote-panel { position: static; }
}

@media (max-width: 720px) {
  .nav-wrap { min-height: 84px; }
  .brand-logo { height: 60px; }
  .hero { padding-top: 28px; }
  .section { padding: 52px 0; }
  .form-grid, .subgrid, .quote-meta { grid-template-columns: 1fr; }
  .mobile-stack { flex-direction: column; }
  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
