*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  width: 100%;
  max-width: 100%;
}

:root {
  --blue:      #000b91;
  --blue-dark: #000878;
  --blue-deep: #000660;
  --blue-soft: #e8eaff;
  --blue-mid:  #1a22a8;
  --red:       #ed0800;
  --red-dark:  #c20700;
  --red-soft:  #fff0f0;
  --white:     #ffffff;
  --off-white: #f5f6ff;
  --slate:     #e2e4f3;
  --muted:     #6b6f9a;
  --text:      #0a0d2e;
  --radius:    12px;
  --shadow-sm: 0 2px 12px rgba(0,11,145,.08);
  --shadow:    0 8px 40px rgba(0,11,145,.13);
  --shadow-lg: 0 20px 60px rgba(0,11,145,.18);
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

.skip-link {
  position: absolute;
  left: 10px;
  top: -48px;
  background: var(--blue);
  color: #fff;
  padding: .6rem .9rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  z-index: 1000;
}
.skip-link:focus {
  top: 10px;
}

/* ── HEADER ──────────────────────────────────────── */
header {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 10px 30px rgba(10,13,46,0.09), 0 2px 6px rgba(10,13,46,0.04);
  border-bottom: 1px solid rgba(10,13,46,.04);
  backdrop-filter: blur(4px);
  transition: box-shadow .18s ease, background .18s ease;
}
.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-shield {
  width: 44px;
  height: 44px;
  background: transparent;
  clip-path: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  flex-shrink: 0;
  font-size: 0; /* hide any fallback text */
}

/* logo image should fit the container without being clipped */
.logo-shield img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: .01em;
}
.logo-sub {
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #000;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.pill {
  background: rgba(237,8,0,.2);
  border: 1px solid rgba(237,8,0,.45);
  color: #ff6b65;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .85rem;
  border-radius: 99px;
}
.header-date {
  font-size: .75rem;
  color: #000;
  letter-spacing: .04em;
}

.theme-toggle {
  border: 1px solid rgba(10,13,46,.14);
  background: #fff;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  border-radius: 99px;
  padding: .38rem .72rem;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, transform .1s;
}

.theme-toggle:hover {
  background: var(--blue-soft);
  border-color: rgba(0,11,145,.3);
  color: var(--blue);
}

.theme-toggle:active {
  transform: scale(.98);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(0,11,145,.35);
  outline-offset: 2px;
}

/* ── HERO BAND ───────────────────────────────────── */
.hero-band {
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 50%, var(--blue-mid) 100%);
  padding: 3rem 2rem 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero-band::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(237,8,0,.18) 0%, transparent 65%);
  pointer-events: none;
}
.hero-band::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  pointer-events: none;
}
/* Diagonal stripe accent */
.hero-stripe {
  position: absolute;
  top: 0; right: 0;
  width: 5px;
  height: 100%;
  background: var(--red);
}
.hero-content {
  max-width: 1160px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -.02em;
}
.hero-title span {
  color: var(--red);
  position: relative;
}
.hero-desc {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  margin-top: .5rem;
  max-width: 460px;
  line-height: 1.6;
}
.hero-stat {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: .9rem 1.4rem;
  text-align: center;
  backdrop-filter: blur(8px);
}
.hero-stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
.hero-stat-lbl {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-top: .15rem;
}

/* ── MAIN LAYOUT ─────────────────────────────────── */
.wrapper {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
  flex: 1 0 auto;
  width: 100%;
}
.grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media(max-width: 820px) { .grid { grid-template-columns: 1fr; } }

/* ── CARDS ───────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,11,145,.07);
  overflow: hidden;
  margin-bottom: 1.25rem;
  animation: slideUp .4s ease both;
}
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }

.info-card {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.info-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,11,145,.32);
  box-shadow: var(--shadow);
}

.right-col .info-card:hover .card-body[style*="border:1px solid rgba(0,11,145,.07)"] {
  border-color: rgba(0,11,145,.32) !important;
}

@media (hover: none), (pointer: coarse) {
  .info-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header {
  background: var(--blue);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}
.card-header-red {
  background: var(--red);
}
.card-icon {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.card-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.9);
}
.card-body {
  padding: 1.5rem;
}

/* ── FORM ELEMENTS ───────────────────────────────── */
.field { margin-bottom: 1.15rem; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }

label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.label-required::after {
  content: ' *';
  color: var(--red);
}

input, select {
  width: 100%;
  padding: .65rem 1rem;
  border: 1.5px solid var(--slate);
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--off-white);
  transition: border-color .18s, box-shadow .18s, background .18s;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0,11,145,.1);
}
input:focus-visible,
select:focus-visible,
.seg-btn:focus-visible,
.btn-calc:focus-visible,
.switch input:focus-visible + .slider {
  outline: 3px solid rgba(0,11,145,.35);
  outline-offset: 2px;
}
input::placeholder { color: #aab0cc; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23000b91' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.input-hint {
  font-size: .68rem;
  color: var(--muted);
  margin-top: .3rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}

/* ── SEGMENT CONTROL ─────────────────────────────── */
.seg {
  display: flex;
  background: var(--off-white);
  border: 1.5px solid var(--slate);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  flex: 1;
  padding: .45rem .3rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .17s;
  text-align: center;
  white-space: nowrap;
}
.seg-btn.active {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,11,145,.3);
}
.seg-btn:not(.active):hover { background: var(--blue-soft); color: var(--blue); }
.seg-btn:focus-visible {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ── TOGGLE SWITCHES ─────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 0;
  border-bottom: 1px solid var(--slate);
  gap: .75rem;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: .88rem; color: var(--text); font-weight: 600; }
.toggle-sub { font-size: .73rem; color: var(--muted); margin-top: .15rem; line-height: 1.4; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--slate);
  border-radius: 99px;
  cursor: pointer;
  transition: background .2s;
  border: 1.5px solid transparent;
}
.slider::before {
  content: '';
  position: absolute;
  width: 19px; height: 19px;
  left: 2px; top: 1.5px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
input:checked + .slider { background: var(--blue); border-color: var(--blue); }
input:checked + .slider::before { transform: translateX(20px); }

/* ── CALCULATE BUTTON ────────────────────────────── */
.btn-calc {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--red);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: .25rem;
  transition: background .18s, transform .1s, box-shadow .18s;
  box-shadow: 0 6px 24px rgba(237,8,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  position: relative;
  overflow: hidden;
}
.btn-calc::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.btn-calc:hover {
  background: var(--red-dark);
  box-shadow: 0 8px 30px rgba(237,8,0,.45);
  transform: translateY(-1px);
}
.btn-calc:active { transform: scale(.98) translateY(0); }
.btn-icon { font-size: 1.1rem; }
.btn-icon-img {
  width: 1em;
  height: 1em;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

#sendWhatsapp .btn-icon {
  display: inline-flex;
  align-items: flex-end;
  line-height: 1;
  transform: translateY(3px);
}

#sendWhatsapp .btn-icon-img {
  width: 16px;
  height: 16px;
  transform: none;
}
.btn-calc:focus-visible {
  box-shadow: 0 0 0 4px rgba(0,11,145,.25), 0 8px 30px rgba(237,8,0,.45);
}

.btn-whatsapp {
  background: var(--blue);
  box-shadow: 0 6px 24px rgba(0,11,145,.35);
}

.btn-whatsapp:hover {
  background: var(--blue-dark);
  box-shadow: 0 8px 30px rgba(0,11,145,.45);
}

.wa-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 30, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.wa-modal-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--slate);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1rem;
}

.wa-modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue);
}

.wa-modal-sub {
  margin-top: .4rem;
  font-size: .86rem;
  color: var(--text-light);
}

.wa-modal-field {
  margin-top: .85rem;
}

.wa-modal-field label {
  display: block;
  margin-bottom: .45rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text);
}

.wa-modal-field input {
  width: 100%;
  border: 1.5px solid var(--slate);
  border-radius: 10px;
  padding: .75rem .8rem;
  font-family: 'Outfit', sans-serif;
  font-size: .96rem;
}

.wa-modal-field input:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,11,145,.16);
}

.wa-modal-error {
  min-height: 1.1rem;
  margin-top: .38rem;
  font-size: .82rem;
  color: var(--red);
}

.wa-modal-actions {
  margin-top: .9rem;
  display: flex;
  gap: .65rem;
}

.wa-btn {
  margin-top: 0;
  width: 50%;
  text-transform: none;
  letter-spacing: .01em;
}

.wa-btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--slate);
  box-shadow: none;
}

.wa-btn-secondary:hover {
  background: #f7f8fb;
  box-shadow: none;
}

.wa-btn-primary {
  background: var(--blue);
  box-shadow: 0 6px 24px rgba(0,11,145,.35);
}

.wa-btn-primary:hover {
  background: var(--blue-dark);
  box-shadow: 0 8px 30px rgba(0,11,145,.45);
}

/* ── DIVIDER ─────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--slate);
  margin: 1rem 0;
}
.section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--blue-soft);
}

/* ── RESULT PANEL ────────────────────────────────── */
#result { display: none; }

.result-hero {
  background: var(--blue);
  border-radius: var(--radius);
  padding: 2rem 1.8rem 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.result-hero::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(237,8,0,.22) 0%, transparent 65%);
  pointer-events: none;
}
.result-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
}
/* Geometric corner accent */
.result-hero .geo {
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  border-left: 100px solid transparent;
  border-top: 100px solid rgba(237,8,0,.15);
  pointer-events: none;
}
.for-name {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.for-name::before { content: ''; display: block; width: 16px; height: 1px; background: var(--red); }
.result-mode-lbl {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: .25rem;
}
.result-amount {
  font-family: 'Playfair Display', serif;
  font-size: 2.9rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -.03em;
}
.result-amount-currency {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  vertical-align: super;
  margin-right: .3rem;
  letter-spacing: .05em;
}
.result-period-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.1);
  border-radius: 99px;
  padding: .25rem .85rem;
  font-size: .73rem;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  margin-top: .6rem;
}
.result-period-tag .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

/* breakdown grid */
.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--slate);
  border: 1px solid var(--slate);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.breakdown-cell {
  background: var(--white);
  padding: 1rem 1.3rem;
  position: relative;
}
.breakdown-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 1.3rem; right: 1.3rem;
  height: 2px;
  background: transparent;
  transition: background .2s;
}
.breakdown-cell:hover::before { background: var(--blue); }
.bc-lbl {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}
.bc-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* detail rows */
.detail-rows {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--slate);
  box-shadow: var(--shadow-sm);
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1.4rem;
  border-bottom: 1px solid var(--off-white);
  gap: .5rem;
}
.detail-row:last-child { border-bottom: none; }
.dr-key {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 500;
}
.dr-val {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}
.dr-val.good { color: var(--blue); }

.alt-coverage {
  margin-top: 1rem;
  border: 1px solid var(--slate);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--white) 0%, var(--off-white) 100%);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.alt-coverage-head {
  background: var(--blue);
  padding: .9rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.16);
}

.alt-coverage-head-top {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.alt-coverage-text {
  display: grid;
  gap: .16rem;
}

.alt-coverage-icon {
  flex-shrink: 0;
}

.alt-coverage-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.9);
}

.alt-coverage-sub {
  margin-top: 0;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: rgba(255,255,255,.7);
}

.alt-coverage-list {
  display: grid;
}

.alt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid var(--off-white);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.alt-row:last-child {
  border-bottom: none;
}

.alt-row:hover {
  background: rgba(0,11,145,.035);
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

@media (hover: none), (pointer: coarse) {
  .alt-row:hover {
    transform: none;
    box-shadow: none;
  }
}

.alt-row:focus-visible {
  outline: 2px solid rgba(0,11,145,.35);
  outline-offset: -2px;
  background: rgba(0,11,145,.05);
}

.alt-sa,
.alt-premium {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .6rem;
  font-size: .82rem;
  color: var(--text);
}

.alt-label {
  font-weight: 500;
  color: var(--muted);
}

.alt-value {
  font-weight: 650;
  color: var(--text);
}

.alt-sa .alt-value,
.alt-premium .alt-value,
.alt-premium .alt-value-accent {
  font-size: 18px;
}

.alt-premium .alt-value,
.alt-premium .alt-value-accent {
  font-size: 16px;
  white-space: nowrap;
}

.alt-value-accent {
  color: var(--blue);
}

@media (min-width: 821px) {
  .alt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 1rem;
    align-items: center;
  }

  .alt-sa,
  .alt-premium {
    width: auto;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: .65rem;
  }

  .alt-value,
  .alt-value-accent {
    min-width: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
  }

  .alt-sa .alt-value {
    white-space: nowrap;
  }
}

/* cashback banner */
.cashback-banner {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  position: relative;
  overflow: hidden;
  animation: fadeIn .4s ease both;
  border: 1px solid rgba(0,11,145,.2);
  box-shadow: var(--shadow-sm);
}
.cashback-banner::before {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(237,8,0,.2) 0%, transparent 65%);
}
.cb-icon {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.cb-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: .2rem;
}
.cb-amount {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.cb-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  margin-top: .15rem;
}
.cb-milestones {
  display: flex;
  gap: .6rem;
  margin: .55rem 0 .35rem;
  flex-wrap: wrap;
}
.cb-mile {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.1);
  border-radius: 99px;
  padding: .2rem .65rem .2rem .3rem;
  font-size: .72rem;
  color: rgba(255,255,255,.75);
  font-weight: 500;
}
.cb-mile-num {
  width: 18px; height: 18px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

/* WOP badge */
.wop-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: #fff3b0;
  border: 1px solid #f2bf18;
  border-radius: 6px;
  padding: .2rem .6rem;
  font-size: .72rem;
  font-weight: 700;
  color: #7a4e00;
  margin-top: .5rem;
}

body.dark-mode .wop-badge {
  background: #ffd84d;
  border-color: #ffc400;
  color: #3f2800;
}

/* ── EMPTY STATE ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-icon {
  width: 64px; height: 64px;
  background: var(--blue-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 1rem;
}
.empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: .4rem;
}
.empty-sub { font-size: .82rem; color: var(--muted); line-height: 1.6; }

/* ── ERROR ───────────────────────────────────────── */
.error-msg {
  background: var(--red-soft);
  border: 1.5px solid rgba(237,8,0,.25);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  font-size: .85rem;
  color: var(--red-dark);
  font-weight: 500;
  display: none;
  margin-bottom: 1rem;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── DOB CHANGE MODAL ────────────────────────────── */
.dob-modal-overlay {
  background: rgba(4, 6, 20, .65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dob-modal-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,11,145,.22), 0 6px 20px rgba(0,0,0,.1);
  overflow: hidden;
  animation: dobModalIn .35s cubic-bezier(.34,1.56,.64,1);
}

@keyframes dobModalIn {
  from { opacity: 0; transform: scale(.85) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.dob-modal-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--blue) 0%, #4a58f5 50%, #8b96ff 100%);
}

.dob-modal-body {
  padding: 1.8rem 1.8rem 1.2rem;
  text-align: center;
}

.dob-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-soft) 0%, #d4d9ff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 18px rgba(0,11,145,.14);
}

.dob-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  letter-spacing: .01em;
  line-height: 1.2;
  margin-bottom: .5rem;
}

.dob-modal-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.65;
  max-width: 280px;
  margin: 0 auto;
}

.dob-modal-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .4rem 1.8rem 1.6rem;
}

.dob-btn-primary {
  width: 100%;
  padding: .875rem 1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue) 0%, #2d3adc 100%);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0,11,145,.3);
  transition: transform .15s ease, box-shadow .15s ease;
}

.dob-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,11,145,.38);
}

.dob-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0,11,145,.2);
}

.dob-btn-secondary {
  width: 100%;
  padding: .6rem 1rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s ease;
}

.dob-btn-secondary:hover {
  color: var(--text);
}

body.dark-mode .dob-modal-overlay {
  background: rgba(2, 3, 14, .78);
}

body.dark-mode .dob-modal-card {
  background: #0f172a;
  box-shadow: 0 32px 80px rgba(0,0,0,.5), 0 6px 20px rgba(0,0,0,.3);
}

body.dark-mode .dob-modal-title {
  color: #e7ecff;
}

body.dark-mode .dob-modal-icon {
  background: linear-gradient(135deg, #1a2345 0%, #222e58 100%);
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
}

/* ── BUDGET FINDER / REVERSE CALCULATOR ─────────── */
.calc-mode-bar {
  display: flex;
  background: var(--blue-soft);
  border-radius: var(--radius);
  padding: .3rem;
  gap: .25rem;
  margin-bottom: 1rem;
}

.calc-mode-btn {
  flex: 1;
  padding: .6rem 1rem;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  font-family: 'Outfit', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.calc-mode-btn.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 10px rgba(0,11,145,.12);
}

.rev-results-header {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  margin-bottom: .9rem;
}

.rev-results-count {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

.rev-results-sub {
  font-size: .78rem;
  color: var(--muted);
}

.rev-results-grid {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.rev-result-card {
  background: var(--off-white);
  border: 1.5px solid var(--slate);
  border-radius: 14px;
  padding: 1rem 1.1rem 1rem;
  animation: revCardIn .35s ease both;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.rev-result-card:hover {
  border-color: rgba(0,11,145,.3);
  box-shadow: 0 4px 18px rgba(0,11,145,.1);
}

@keyframes revCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rev-card-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}

.rev-card-plan {
  font-family: 'DM Sans', sans-serif;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text);
}

.rev-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .15rem .5rem;
  border-radius: 20px;
  flex-shrink: 0;
}

.rev-badge-cb  { background: #ecfdf5; color: #047857; }
.rev-badge-no  { background: var(--blue-soft); color: var(--blue); }
.rev-badge-wop { background: #fff7ed; color: #c2410c; }

.rev-card-term {
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .55rem;
}

.rev-card-sa {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  font-style: italic;
  color: var(--blue);
  line-height: 1.1;
}

.rev-card-sa-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .67rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: .1rem;
  margin-bottom: .65rem;
}

.rev-card-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: .85rem;
}

.rev-stat { flex: 1; }

.rev-stat-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: .67rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .15rem;
}

.rev-stat-value {
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
}

.rev-stat-accent { color: var(--blue); }

.rev-apply-btn {
  width: 100%;
  padding: .6rem 1rem;
  border: 1.5px solid var(--blue);
  border-radius: 10px;
  background: transparent;
  color: var(--blue);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.rev-apply-btn:hover {
  background: var(--blue);
  color: #fff;
}

body.dark-mode .calc-mode-bar {
  background: #0d1526;
}

body.dark-mode .calc-mode-btn.active {
  background: #1a2345;
  color: #8b9aff;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

body.dark-mode .rev-result-card {
  background: #0f172a;
  border-color: #1e2d4a;
}

body.dark-mode .rev-result-card:hover {
  border-color: #4a5af5;
  box-shadow: 0 4px 18px rgba(74,90,245,.12);
}

body.dark-mode .rev-badge-cb  { background: #064e3b; color: #6ee7b7; }
body.dark-mode .rev-badge-no  { background: #1a2345; color: #8b9aff; }
body.dark-mode .rev-badge-wop { background: #431407; color: #fb923c; }

body.dark-mode .rev-card-sa   { color: #8b9aff; }
body.dark-mode .rev-stat-accent { color: #8b9aff; }

body.dark-mode .rev-apply-btn {
  border-color: #4a5af5;
  color: #8b9aff;
}

body.dark-mode .rev-apply-btn:hover {
  background: #4a5af5;
  color: #fff;
}

/* ── FOOTER BAR ──────────────────────────────────── */
.footer-bar {
  background: var(--blue-deep);
  text-align: center;
  padding: 1rem;
  font-size: .7rem;
  color: rgba(255,255,255,.3);
  letter-spacing: .06em;
  width: 100%;
  margin-top: auto;
}
.footer-bar span { color: var(--red); }

/* ── DARK MODE ─────────────────────────────────── */
body.dark-mode {
  --off-white: #0a1020;
  --white: #11192d;
  --slate: #2a3553;
  --text: #e7ecff;
  --muted: #a8b3d8;
  --blue-soft: #1a2340;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .35);
  --shadow: 0 8px 40px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .5);
}

body.dark-mode header {
  background: linear-gradient(180deg, #0f172b 0%, #0b1222 100%);
  border-bottom-color: rgba(231,236,255,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.2);
}

body.dark-mode .logo-sub,
body.dark-mode .header-date {
  color: #dbe4ff;
}

body.dark-mode .pill {
  background: rgba(237,8,0,.25);
  color: #ffc0bd;
}

body.dark-mode .theme-toggle {
  background: #141e35;
  border-color: rgba(219,228,255,.2);
  color: #dbe4ff;
}

body.dark-mode .theme-toggle:hover {
  background: #1b2745;
  color: #fff;
}

body.dark-mode .card,
body.dark-mode .breakdown-cell,
body.dark-mode .detail-rows,
body.dark-mode .alt-coverage {
  border-color: var(--slate);
}

body.dark-mode .info-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(120, 155, 255, 0.28);
  box-shadow:
    0 0 0 1px rgba(120, 155, 255, 0.08) inset,
    0 10px 26px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(77, 163, 255, 0.16);
}

body.dark-mode .info-card:hover {
  transform: translateY(-3px);
  border-color: rgba(142, 168, 255, 0.62);
  box-shadow:
    0 0 0 1px rgba(142, 168, 255, 0.16) inset,
    0 14px 30px rgba(0, 0, 0, 0.5),
    0 0 22px rgba(77, 163, 255, 0.24);
}

body.dark-mode .right-col .info-card:hover .card-body[style*="border:1px solid rgba(0,11,145,.07)"] {
  border-color: rgba(142, 168, 255, 0.62) !important;
}

body.dark-mode .right-col .card-body[style*="background:#fff"] {
  background: #11192d !important;
  border-color: var(--slate) !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode .seg,
body.dark-mode .wa-modal-field input {
  background: #0f172b;
  border-color: #33426a;
  color: #e7ecff;
}

body.dark-mode #plan,
body.dark-mode #term,
body.dark-mode #saSelect {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23FFFFFF' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 10px 6px;
  padding-right: 2.5rem;
}

body.dark-mode #plan::-ms-expand,
body.dark-mode #term::-ms-expand,
body.dark-mode #saSelect::-ms-expand {
  display: none;
}

body.dark-mode input[type="date"] {
  background: #0f172b;
  color: #e7ecff;
  border-color: #33426a;
}

body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.15);
  opacity: 1;
}

body.dark-mode input::placeholder {
  color: #8e9bc3;
}

body.dark-mode input:focus,
body.dark-mode select:focus {
  background: #131d35;
  box-shadow: 0 0 0 3px rgba(67, 95, 181, .35);
}

body.dark-mode .seg-btn:not(.active):hover,
body.dark-mode .seg-btn:focus-visible {
  background: #1b2745;
  color: #dbe4ff;
}

body.dark-mode .wa-modal-card,
body.dark-mode .wa-btn-secondary {
  background: #11192d;
  color: #e7ecff;
  border-color: var(--slate);
}

body.dark-mode .wa-modal-sub,
body.dark-mode .wa-modal-field label,
body.dark-mode .empty-sub,
body.dark-mode .dr-key,
body.dark-mode .bc-lbl {
  color: var(--muted);
}

body.dark-mode .wa-modal-title {
  color: #e7ecff;
}

body.dark-mode .wa-modal-error {
  color: #ffb1ac;
}

body.dark-mode .alt-sa .alt-value {
  font-weight: 700;
  color: #FFFFFF;
  font-size: 18px;
}

body.dark-mode .alt-premium .alt-value,
body.dark-mode .alt-premium .alt-value-accent {
  color: #4DA3FF;
  font-weight: 600;
}

body.dark-mode .alt-row {
  border-bottom-color: #1f2942;
}

body.dark-mode .alt-row:hover {
  background: rgba(77, 163, 255, 0.14);
  border-color: rgba(142, 168, 255, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

body.dark-mode .alt-row:focus-visible {
  outline: 2px solid rgba(142, 168, 255, 0.65);
  background: rgba(77, 163, 255, 0.2);
}

body.dark-mode .empty-icon {
  background: #1a2340;
}

body.dark-mode .error-msg {
  background: rgba(237,8,0,.16);
  border-color: rgba(237,8,0,.36);
  color: #ffb1ac;
}

body.dark-mode .footer-bar {
  background: #090f1c;
  color: rgba(231,236,255,.55);
}

/* ── RESULT CARD WRAPPER ─────────────────────────── */
.result-wrapper {
  display: grid;
  gap: .9rem;
  animation: slideUp .4s ease both;
}

/* ── STICKY RESULT CARD ──────────────────────────── */
.right-col {
  position: sticky;
  top: 90px;
}

/* ── MOBILE ACCESSIBILITY & RESPONSIVE TUNING ───────────────────────────── */
@media (max-width: 820px) {
  .wrapper {
    padding: 1rem 1rem 4.25rem;
  }

  .header-inner {
    padding: 0 .9rem;
    height: auto;
    min-height: 64px;
    gap: .65rem;
  }

  .header-right {
    gap: .5rem;
  }

  .pill,
  .header-date {
    font-size: .64rem;
  }

  .hero-band {
    padding: 1.75rem 1rem 1.35rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-content {
    align-items: flex-start;
    gap: .8rem;
  }

  .hero-stat {
    padding: .6rem .8rem;
  }

  .hero-stat-val {
    font-size: 1.2rem;
  }

  .card-body {
    padding: 1rem;
  }

  .field {
    margin-bottom: 1rem;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .field-row .field {
    margin-bottom: 0;
  }

  .field-row + .field {
    margin-top: .25rem;
  }

  .toggle-row {
    padding: .85rem 0;
  }

  .seg {
    flex-wrap: wrap;
    gap: .35rem;
    padding: .35rem;
  }

  .seg-btn {
    min-width: calc(50% - .25rem);
    min-height: 44px;
    padding: .55rem .45rem;
    font-size: .82rem;
  }

  input,
  select,
  .btn-calc {
    min-height: 44px;
  }

  /* Prevent iOS Safari from auto-zooming focused form controls. */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .btn-calc {
    padding: .9rem 1rem;
    font-size: .92rem;
  }

  .right-col {
    position: static;
    top: auto;
  }

  .result-amount {
    font-size: 2.15rem;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .detail-row {
    align-items: flex-start;
    flex-direction: column;
    gap: .2rem;
  }

  .dr-val {
    text-align: left;
    word-break: break-word;
  }

  .cashback-banner {
    padding: .9rem 1rem;
  }

  .alt-row {
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
  }

  .alt-sa,
  .alt-premium {
    justify-content: space-between;
    width: 100%;
  }

  .footer-bar {
    padding: .9rem .7rem;
    font-size: .64rem;
    line-height: 1.5;
  }
}

@media (max-width: 520px) {
  .logo-name {
    font-size: 1rem;
  }

  .logo-sub {
    font-size: .6rem;
    letter-spacing: .08em;
  }

  .pill {
    padding: .25rem .6rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-desc {
    font-size: .78rem;
  }

  .hero-content > div[style] {
    width: 100%;
    justify-content: space-between;
  }


  .hero-stat {
    flex: 1;
    min-width: 0;
    padding: .55rem .45rem;
  }

  .hero-stat-lbl {
    font-size: .6rem;
  }

  .card-header {
    padding: .8rem .95rem;
  }

  .card-title {
    font-size: .68rem;
  }

  .empty-state {
    padding: 2.2rem 1rem;
  }
}
