/* Calculadora IPC Alquiler — Ultra-Fast Light Design System (v1) */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --muted-bg: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --brand: #0f766e;
  --brand-hover: #115e59;
  --brand-soft: #f0fdfa;
  --brand-border: #99f6e4;
  --accent: #0284c7;
  --accent-soft: #f0f9ff;
  --accent-border: #bae6fd;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --rose: #be123c;
  --rose-soft: #fff1f2;
  --rose-border: #fecdd3;
  --wa: #16a34a;
  --wa-hover: #15803d;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow: 0 12px 32px -6px rgba(15, 23, 42, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; width: 100%; }
.wrap-md { max-width: 880px; margin: 0 auto; padding: 0 18px; width: 100%; }
.hidden { display: none !important; }

/* Header & Navigation */
.site-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 18px;
  height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand-logo {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none !important; color: var(--text); flex-shrink: 0;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 17.5px; font-weight: 900; letter-spacing: -0.35px; color: var(--text); }
.brand-name .accent { color: var(--brand); }
.brand-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: 1px; }

.nav-desktop { display: flex; align-items: center; gap: 18px; height: 100%; }
.nav-link {
  color: var(--text-sub); font-size: 14px; font-weight: 600;
  padding: 6px 2px; border-bottom: 2px solid transparent;
  text-decoration: none !important; white-space: nowrap; transition: color .15s, border-color .15s;
}
.nav-link:hover, .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }

.nav-drop { position: relative; display: inline-flex; align-items: center; height: 100%; }
.nav-drop-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-sub); font-size: 14px; font-weight: 600;
  padding: 6px 2px; display: inline-flex; align-items: center; gap: 4px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav-drop-btn:hover, .nav-drop-btn.active, .nav-drop.open .nav-drop-btn {
  color: var(--brand); border-bottom-color: var(--brand);
}
.nav-drop-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
  min-width: 235px; padding: 8px; z-index: 950;
}
.nav-drop-menu::before { content: ''; position: absolute; top: -14px; left: 0; right: 0; height: 14px; }
.nav-drop:hover .nav-drop-menu, .nav-drop.open .nav-drop-menu { display: block; }
.nav-drop-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--text); text-decoration: none !important;
}
.nav-drop-menu a:hover, .nav-drop-menu a.curr { background: var(--brand-soft); color: var(--brand); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn {
  display: none; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 9px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.mobile-drawer {
  display: none; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 18px 18px;
}
.mobile-drawer.open { display: block; }
.mobile-drawer a {
  display: block; padding: 10px 4px; color: var(--text); font-weight: 600;
  font-size: 14px; border-bottom: 1px solid var(--muted-bg); text-decoration: none;
}

/* Buttons & Badges */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 800;
  cursor: pointer; border: 1px solid transparent; text-decoration: none !important;
  transition: background .15s, border-color .15s, transform .1s; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(15, 118, 110, 0.22); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22); }
.btn-wa:hover { background: var(--wa-hover); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--muted-bg); }
.btn-soft { background: var(--muted-bg); color: var(--text); border-color: var(--border); }
.btn-soft:hover { background: var(--border); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 7px; font-weight: 700; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-teal { background: var(--brand-soft); color: var(--brand-hover); border: 1px solid var(--brand-border); }
.badge-blue { background: var(--accent-soft); color: #0369a1; border: 1px solid var(--accent-border); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-rose { background: var(--rose-soft); color: var(--rose); border: 1px solid var(--rose-border); }
.badge-neutral { background: var(--muted-bg); color: var(--text-sub); border: 1px solid var(--border); }

/* Hero & Above-the-Fold Calculator */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 55%, #f8fafc 100%);
  border-bottom: 1px solid var(--border);
  padding: 26px 0 38px;
}
.hero-head { text-align: center; max-width: 780px; margin: 0 auto 20px; }
.hero-head h1 {
  font-size: clamp(24px, 4vw, 39px); font-weight: 900; line-height: 1.16;
  letter-spacing: -0.025em; color: var(--text); margin: 10px 0 8px;
}
.hero-head h1 .accent { color: var(--brand); }
.hero-sub { font-size: 15px; color: var(--text-sub); max-width: 660px; margin: 0 auto; line-height: 1.55; }

/* Live Official Stats Ribbon */
.live-ribbon {
  max-width: 820px; margin: 0 auto 16px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px;
}

/* Main Calculator Card */
.calc-wrap { max-width: 820px; margin: 0 auto; }
.calc-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: 24px; box-shadow: var(--shadow);
}
.calc-grid {
  display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 14px;
}
.field-lbl {
  display: block; font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--text-sub); margin-bottom: 6px;
}
.input-prefix-wrap {
  display: flex; align-items: center; border: 1.5px solid var(--border-strong);
  border-radius: 11px; background: #fff; overflow: hidden; transition: border-color .15s;
}
.input-prefix-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); }
.input-prefix {
  padding: 11px 12px; background: var(--muted-bg); color: var(--text-sub);
  font-weight: 900; font-size: 15px; border-right: 1px solid var(--border);
}
.f-input, .f-select {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--border-strong);
  border-radius: 11px; font-size: 15px; font-weight: 700; color: var(--text);
  background: #fff; outline: none; transition: border-color .15s;
}
.input-prefix-wrap .f-input { border: none; border-radius: 0; font-size: 17px; font-weight: 800; }
.f-input:focus, .f-select:focus { border-color: var(--brand); }

.period-chips {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--muted-bg); align-items: center;
}
.p-chip {
  padding: 6px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 800;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-sub);
  cursor: pointer; transition: all .15s;
}
.p-chip:hover { border-color: var(--brand); color: var(--brand); }
.p-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Estimator Drawer (for pending unpublished months) */
.est-bar {
  margin-top: 14px; padding: 11px 14px; border-radius: 11px;
  background: var(--amber-soft); border: 1px solid var(--amber-border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: #78350f;
}

/* Primary Result Box */
.result-panel {
  margin-top: 20px; border-radius: 16px; padding: 20px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 65%);
  border: 1.5px solid var(--brand-border);
}
.res-top {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; align-items: center;
}
.res-main-lbl { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--brand-hover); letter-spacing: 0.04em; }
.res-main-val {
  font-size: clamp(28px, 4.5vw, 38px); font-weight: 900; color: var(--text);
  letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: 3px;
}
.res-kpi {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.res-kpi-lbl { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.res-kpi-val { font-size: 19px; font-weight: 900; color: var(--brand); margin-top: 2px; font-variant-numeric: tabular-nums; }
.res-kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.res-actions {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--brand-border);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
}
.res-btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* Month-by-Month Breakdown Table */
.breakdown-wrap { margin-top: 16px; }
.breakdown-toggle {
  background: none; border: none; color: var(--brand-hover); font-size: 13px;
  font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
}

/* Tool Hub Pills */
.tool-hub-strip {
  max-width: 820px; margin: 18px auto 0; text-align: center;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.hub-pill {
  background: #fff; border: 1px solid var(--border); color: var(--text-sub);
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  text-decoration: none !important; transition: border-color .15s, color .15s;
}
.hub-pill:hover, .hub-pill.curr { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* Content Sections */
.sec { padding: 50px 0; border-bottom: 1px solid var(--border); }
.sec-white { background: #fff; }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 30px; }
.sec-head h2 { font-size: clamp(22px, 3vw, 31px); font-weight: 900; letter-spacing: -0.02em; color: var(--text); margin: 10px 0 8px; line-height: 1.2; }
.sec-head p { font-size: 15px; color: var(--text-sub); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.card-soft { background: var(--bg); }
.card h3 { font-size: 16.5px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.card p, .card li { font-size: 14px; color: var(--text-sub); line-height: 1.65; }
.card ul, .card ol { padding-left: 18px; display: grid; gap: 6px; margin-top: 8px; }

.step-num {
  width: 34px; height: 34px; border-radius: 10px; font-weight: 900; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px;
  background: var(--brand-soft); color: var(--brand);
}

/* Tables */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.data-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-tbl th, .data-tbl td { padding: 11px 15px; border-bottom: 1px solid var(--muted-bg); text-align: left; }
.data-tbl tr:last-child td { border-bottom: none; }
.data-tbl th { background: var(--bg); color: var(--text-muted); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.num-col { text-align: right !important; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Prose & Callouts */
.prose-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 30px; }
.prose-card h2 { font-size: 21px; font-weight: 900; color: var(--text); margin: 26px 0 10px; line-height: 1.25; }
.prose-card h2:first-child { margin-top: 0; }
.prose-card h3 { font-size: 16.5px; font-weight: 800; color: var(--text); margin: 20px 0 8px; }
.prose-card p { font-size: 15px; color: var(--text-sub); line-height: 1.75; margin-bottom: 14px; }
.prose-card ul, .prose-card ol { padding-left: 22px; margin: 10px 0 18px; display: grid; gap: 8px; color: var(--text-sub); font-size: 14.5px; line-height: 1.65; }
.prose-card strong { color: var(--text); }

.callout-box {
  padding: 15px 18px; border-radius: 12px; margin: 18px 0;
  background: var(--brand-soft); border: 1px solid var(--brand-border);
  border-left: 4px solid var(--brand); font-size: 14px; color: #134e4a; line-height: 1.65;
}
.callout-warn { background: var(--amber-soft); border-color: var(--amber-border); border-left-color: var(--amber); color: #78350f; }

.formula-box {
  padding: 16px 20px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--border); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px; font-weight: 700; color: var(--text); text-align: center; margin: 16px 0;
}

/* FAQ Accordion */
.faq-list { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.faq-item summary {
  padding: 16px 20px; font-weight: 800; font-size: 15px; color: var(--text);
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 20px; color: var(--brand); font-weight: 700; flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-ans { padding: 12px 20px 16px; color: var(--text-sub); font-size: 14px; line-height: 1.7; border-top: 1px solid var(--muted-bg); }

/* Footer */
.site-footer {
  margin-top: auto; background: #fff; border-top: 1px solid var(--border);
  padding: 44px 0 24px; color: var(--text-sub); font-size: 13.5px;
}
.footer-grid { display: grid; grid-template-columns: 1.8fr 1.1fr 1fr 1fr; gap: 28px; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.footer-col h4 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text); margin-bottom: 12px; }
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col ul a { color: var(--text-sub); font-size: 13.5px; }
.footer-col ul a:hover { color: var(--brand); }
.footer-bottom { padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: var(--text-muted); }

/* Forms */
.f-ctrl { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border-strong); border-radius: 10px; font-size: 14.5px; color: var(--text); background: #fff; outline: none; }
.f-ctrl:focus { border-color: var(--brand); }

/* Clean Print Receipt Mode */
@media print {
  .site-header, .site-footer, .tool-hub-strip, .res-actions, .sec, .nav-actions, .period-chips { display: none !important; }
  body, .hero, .calc-card { background: #fff !important; box-shadow: none !important; border: none !important; padding: 0 !important; }
  .breakdown-body { display: block !important; }
}

@media (max-width: 920px) {
  .nav-desktop, .nav-actions .desktop-only { display: none; }
  .menu-btn { display: inline-flex; }
  .calc-grid, .res-top { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .grid-2, .grid-4, .footer-grid { grid-template-columns: 1fr; }
  .calc-card, .prose-card { padding: 18px; }
  .brand-sub { display: none; }
}

/* Editorial Content Components (v3) */
.callout-info {
  background: var(--accent-soft); border-color: var(--accent-border);
  border-left-color: var(--accent); color: #0c4a6e;
}
.template-box {
  margin: 16px 0 20px; padding: 18px 20px; border-radius: 12px;
  background: var(--bg); border: 1px dashed var(--border-strong);
  font-size: 14px; color: var(--text); line-height: 1.7;
}
.template-lbl {
  display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--brand-hover); background: var(--brand-soft);
  border: 1px solid var(--brand-border); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px;
}
.hub-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.hub-card {
  display: flex; flex-direction: column; justify-content: space-between;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-decoration: none !important; transition: border-color .15s, box-shadow .15s;
}
.hub-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.hub-card h3 { font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.hub-card p { font-size: 13.5px; color: var(--text-sub); line-height: 1.55; margin-bottom: 12px; }
.hub-card-cta { font-size: 13px; font-weight: 800; color: var(--brand); }

@media (max-width: 820px) {
  .hub-cards { grid-template-columns: 1fr; }
}
