
:root {
  --bg: #f4f4f4;
  --card: #ffffff;
  --text: #111111;
  --muted: #666666;
  --accent: #f2c300;
  --accent-dark: #d6ad00;
  --line: #e7e7e7;
  --black: #111111;
  --shadow: 0 10px 26px rgba(0,0,0,.08);
  --green: #25D366;
  --blue: #1f4fa3;
  --blue-soft: #edf3ff;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #fff7cf 0%, #eef4ff 120px, #f4f4f4 220px, #f4f4f4 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
body { padding: env(safe-area-inset-top) 0 calc(env(safe-area-inset-bottom) + 12px); }
button, input { font: inherit; }
.app {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 10px 12px 18px;
}
.hero {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  padding: 4px 2px 12px;
}
.hero-logo {
  width: 74px;
  height: 74px;
  object-fit: contain;
  border-radius: 16px;
  background: #111;
  box-shadow: var(--shadow);
}
.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--blue);
}
.hero h1 {
  margin: 3px 0 4px;
  font-size: clamp(24px, 6.3vw, 34px);
  line-height: 1;
}
.sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.3;
  font-size: 14px;
}
.card, .result-card, .flat-card {
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  border: 1px solid #edf0f5;
}
.card { padding: 14px; }
.label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin-bottom: 10px;
}
.seg {
  border: 0;
  border-radius: 14px;
  min-height: 48px;
  padding: 8px 10px;
  background: #ededed;
  color: #222;
  font-weight: 800;
  cursor: pointer;
}
.seg.active { background: var(--accent); }
.location-pill {
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.field label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #dedede;
  border-radius: 14px;
  padding: 0 11px;
  background: #fff;
}
.input-wrap:focus-within { border-color: var(--blue); }
.input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 26px;
  font-weight: 800;
  padding: 11px 0;
  background: transparent;
  min-width: 0;
}
.input-wrap span {
  color: var(--muted);
  font-weight: 700;
}
.switch-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.switch-row > div { flex: 1; }
.switch-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #d0d0d0;
  position: relative;
  transition: .2s;
}
.switch::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: .2s;
}
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(22px); }
.result-card {
  margin-top: 12px;
  padding: 16px;
}
.result-line, .result-total {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}
.result-line {
  padding: 5px 0;
  font-size: 16px;
}
.result-line strong { font-size: 20px; }
.divider {
  height: 1px;
  background: var(--line);
  margin: 10px 0 12px;
}
.result-total span {
  font-size: 18px;
  font-weight: 800;
}
.result-total strong {
  font-size: 32px;
  line-height: 1;
  color: var(--blue);
}
.flat-card {
  margin-top: 12px;
  overflow: hidden;
}
.flat-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}
.flat-toggle-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flat-title {
  font-size: 17px;
  font-weight: 800;
}
.flat-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.flat-badge {
  background: #f0f0f0;
  color: #444;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.flat-badge.active {
  background: var(--blue-soft);
  color: var(--blue);
}
.chevron {
  font-size: 18px;
  color: var(--muted);
  transition: transform .2s;
}
.chevron.open { transform: rotate(180deg); }
.flat-panel {
  padding: 0 14px 14px;
}
.flat-summary-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.flat-summary-top > div {
  background: #f8f8f8;
  border-radius: 14px;
  padding: 10px 12px;
}
.flat-summary-top span, .flat-diff span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}
.flat-summary-top strong {
  font-size: 22px;
}
.option-label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.quick-chip {
  border: 0;
  border-radius: 999px;
  min-height: 38px;
  padding: 0 13px;
  background: #efefef;
  color: #222;
  font-weight: 800;
  cursor: pointer;
}
.quick-chip.active {
  background: var(--accent);
}
.flat-field { margin-bottom: 12px; }
.flat-diff {
  background: #f8f8f8;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.flat-diff strong { font-size: 20px; }
.actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn {
  border: 0;
  border-radius: 15px;
  min-height: 54px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.btn-whatsapp {
  background: var(--green);
  color: white;
}
.btn-reset {
  background: var(--black);
  color: white;
}
.link-btn {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  padding: 12px 8px 0;
  cursor: pointer;
}
.tariff-details {
  margin: 12px 2px 0;
  border-radius: 14px;
  background: rgba(255,255,255,.7);
  border: 1px solid #e8edf7;
  padding: 0 12px;
}
.tariff-details summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 0;
  font-weight: 800;
  color: var(--blue);
}
.tariff-details summary::-webkit-details-marker { display: none; }
.tariff-note {
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
@media (max-width: 430px) {
  .hero { grid-template-columns: 64px 1fr; gap: 10px; }
  .hero-logo { width: 64px; height: 64px; }
  .segmented, .grid, .flat-summary-top { grid-template-columns: 1fr; }
  .btn { min-height: 56px; }
  .result-total strong { font-size: 30px; }
  .flat-toggle { align-items: flex-start; }
}
