/* =======================================================
   FISSY FINANCIAL TOOLS — tools.css (v1.6 canonical)
   Governed by: FISSY_STANDARD_v1.6.md
   Notes (non-negotiables):
   - Header ALWAYS white (independent of theme)
   - Premium guard uses .fissy-plus-guard.is-locked
   - Back-compat vars: --color-card / --color-text / --page-bg
   - Premium checkout styles included
   - Duplicates removed (chart-wrapper / chart-canvas-wrap / planner CTA)
   - Sticky bars MUST sit under header (use --header-height)
   - Inline (non-alert) error messages supported
   ======================================================= */

/* =======================================================
   TOOL IDS / "TOOLMAP" (canonical slugs)
   Keep consistent with:
   - <body data-tool="...">
   - header tool IDs
   - common.js getCurrentTool()
   - premium-checkout.php + apply-promo.php tool maps
   -------------------------------------------------------
   planner | financial-planner
   goal | financial-goal
   independence | financial-independence
   rent-buy
   car-renting
   debt-maths
   work-spend
   plan-iul
   what-if
   premium-checkout
   rent-buy-car   (solo si existe esa tool)
   ======================================================= */

/* =======================================================
   VARIABLES / BASE
   ======================================================= */

:root {
    --header-height: 82px; /* canonical spacing reference for sticky elements */

    --color-bg-dark: #020617;
    --color-bg-light: #f9fafb;

    --color-surface-dark: #020617;
    --color-surface-light: #ffffff;

    --color-card-dark: #020617;
    --color-card-light: #ffffff;

    --color-primary: #00c9a7;
    --color-primary-soft: rgba(0, 201, 167, 0.1);

    /* Brand gradient (landing-aligned) */
    --gradient: linear-gradient(135deg, #7030A0, #00c9a7);
    --gradient-h: linear-gradient(90deg, #7030A0, #00c9a7);

    --color-text-dark: #e5e7eb;
    --color-text-light: #111827;

    --color-muted-dark: #9ca3af;
    --color-muted-light: #6b7280;

    --color-border-dark: #1f2937;
    --color-border-light: #e5e7eb;

    --color-danger: #ef4444;

    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.45);
    --shadow-card: 0 12px 28px rgba(15,23,42,0.25);

    /* Back-compat (legacy blocks use these) */
    --color-card: var(--color-card-dark);
    --color-text: var(--color-text-dark);
    --page-bg: var(--color-bg-dark);

    /* Canonical mapped vars */
    --color-muted: var(--color-muted-dark);
    --color-border: var(--color-border-dark);
}

/* Reset muy ligero */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

/* =======================================================
   BODY / THEME
   ======================================================= */

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
                 "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Tema oscuro */
body.theme-dark {
    background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #020617 100%);
    color: var(--color-text-dark);

    --color-card: var(--color-card-dark);
    --color-text: var(--color-text-dark);
    --page-bg: var(--color-bg-dark);
    --color-muted: var(--color-muted-dark);
    --color-border: var(--color-border-dark);
}

/* Tema claro */
body.theme-light {
    background: radial-gradient(circle at top, #e5f3ff 0, #f9fafb 40%, #f9fafb 100%);
    color: var(--color-text-light);

    --color-card: var(--color-card-light);
    --color-text: var(--color-text-light);
    --page-bg: var(--color-bg-light);
    --color-muted: var(--color-muted-light);
    --color-border: var(--color-border-light);
}

/* Contenedor principal (main) */
.page-wrap {
    min-height: 100vh;
    padding: var(--header-height) 16px 40px; /* espacio para el header sticky */
}

/* Contenedor genérico */
.container {
    max-width: 1040px;
    margin: 0 auto;
}

/* Contenedor estrecho (premium-checkout, etc.) */
.container-narrow {
    max-width: 860px;
}

/* Enlaces globales */
a {
    color: inherit;
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}

/* =======================================================
   HEADER (SIEMPRE BLANCO)
   ======================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15,23,42,0.12);
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0; /* estabilidad móvil */
}

/* Brand */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    height: 90px;
    width: auto;
    display: block;
    flex: 0 0 auto;
}

/* alternamos logos con la clase de body */
body.theme-dark .logo-light { display: none; }
body.theme-dark .logo-dark  { display: block; }

body.theme-light .logo-light { display: block; }
body.theme-light .logo-dark  { display: none; }

.brand-text-block {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #0f172a;
}

.brand-subtitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #6b7280;
}

/* =======================================================
   NAV PRINCIPAL
   ======================================================= */

.main-nav {
    margin-left: 24px;
}

.main-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav-item {
    position: relative;
}

.main-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #4b5563;
    background: transparent;
    border: 1px solid transparent;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
    cursor: pointer;
    white-space: nowrap;
}

.main-nav-link.active {
    background: #eef2ff;
    color: #111827;
    border-color: #c7d2fe;
    font-weight: 600;
}

.main-nav-link:hover {
    background: rgba(148, 163, 184, 0.16);
    color: #111827;
}

/* Menú herramientas (dropdown) */
.nav-tools { position: relative; }

.nav-tools-toggle {
    padding-right: 22px;
}

.nav-tools-chevron {
    font-size: 0.65rem;
    opacity: 0.7;
}

.nav-tools-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
}

.nav-tools-dropdown.open {
    display: flex;
}

.nav-tools-link {
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.nav-tools-link.active {
    background: #eef2ff;
    color: #111827;
    border-color: #c7d2fe;
    font-weight: 600;
}

.nav-tools-link:hover {
    background: rgba(243, 244, 246, 0.9);
    border-color: #e5e7eb;
}

/* =======================================================
   TOGGLES HEADER (IDIOMA / TEMA / USUARIO)
   ======================================================= */

.header-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Idioma */
.lang-toggle {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #111827;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Tema */
.theme-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-slider {
    width: 40px;
    height: 20px;
    border-radius: 999px;
    background: #e5e7eb;
    position: relative;
    transition: background 120ms ease;
}

.theme-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    transition: transform 120ms ease;
}

.theme-switch input:checked + .theme-slider {
    background: #111827;
}

.theme-switch input:checked + .theme-slider::before {
    transform: translateX(20px);
}

.theme-icon {
    margin-left: 4px;
    font-size: 0.78rem;
    color: #4b5563;
}

/* Usuario */
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    color: #111827;
}

.badge-premium {
    align-self: flex-start;
    font-size: 0.65rem;
    border-radius: 999px;
    padding: 2px 8px;
    background: #022c22;
    color: #a7f3d0;
}

.btn-header-primary,
.btn-header-secondary {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-header-primary {
    background: #111827;
    color: #f9fafb;
}
.btn-header-primary:hover { background: #020617; }

.btn-header-secondary {
    background: #f3f4f6;
    color: #111827;
    border-color: #e5e7eb;
}
.btn-header-secondary:hover { background: #e5e7eb; }

/* Toggle menú móvil */
.nav-toggle {
    display: none;
    border: 0;
    background: transparent;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    cursor: pointer;
    flex: 0 0 auto;
}
.nav-toggle-bar {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #111827;
}

/* =======================================================
   RESPONSIVE HEADER
   ======================================================= */

@media (max-width: 768px) {
    .header-inner {
        justify-content: space-between;
        gap: 10px;
    }

    .brand-logo {
        height: 56px;
    }

    .brand-subtitle {
        display: none;
    }

    .main-nav {
        position: fixed;
        inset: 64px 0 auto 0;
        background: #ffffff;
        padding: 8px 16px 12px;
        display: none;
        box-shadow: 0 6px 18px rgba(15,23,42,.16);
        max-height: calc(100vh - 64px);
        overflow: auto;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .nav-tools-dropdown {
        position: static;
        box-shadow: none;
        padding-left: 12px;
        margin-top: 4px;
    }

    .nav-toggle {
        display: inline-flex;
    }
}

/* =======================================================
   PAGE HEADER / TITULOS
   ======================================================= */

.page-header {
    margin: 16px 0 18px;
    text-align: center;
}

.page-header-centered {
    text-align: center;
}

.page-header h1 {
    font-size: 1.6rem;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

body.theme-dark .page-header h1 {
    background: var(--gradient-h);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.theme-light .page-header h1 { color: #0f172a; }

.page-header p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.required-note {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--color-muted);
}

/* =======================================================
   BLOQUES DE SECCIÓN / FORM
   ======================================================= */

.tool-form { margin-top: 12px; }

.section-block {
    border-radius: 18px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid rgba(148,163,184,0.26);
    background: rgba(15,23,42,0.45);
    box-shadow: var(--shadow-soft);
}

body.theme-light .section-block {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 20px 40px rgba(15,23,42,0.18);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    cursor: pointer;
}

.section-header-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.section-title {
    font-size: 0.98rem;
    margin: 0;
}

.section-subtitle {
    font-size: 0.78rem;
    margin: 0;
    color: var(--color-muted);
}

.section-toggle-btn {
    border: 0;
    background: transparent;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5);
    position: relative;
    cursor: pointer;
}

.section-toggle-btn::before,
.section-toggle-btn::after {
    content: "";
    position: absolute;
    background: #e5e7eb;
    border-radius: 999px;
}

.section-toggle-btn::before {
    width: 12px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.section-toggle-btn::after {
    width: 2px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* cuando colapsado, solo la línea horizontal */
.section-block.collapsed .section-toggle-btn::after { display: none; }

.section-content { padding: 0 14px 14px; }

/* Grid del formulario */
.section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

@media (max-width: 640px) {
    .section-grid { grid-template-columns: 1fr; }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Etiquetas */
.label-text { font-size: 0.8rem; }

.required-star {
    color: #f97373;
    margin-left: 3px;
    font-size: 0.85em;
}

/* Inputs */
/* IMPORTANTE: font-size mínimo 16px → iOS Safari no hace zoom al hacer foco */
input[type="number"],
input[type="text"],
input[type="email"],
input[type="tel"],
select {
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.6);
    padding: 6px 8px;
    font-size: 16px;           /* ← anti-zoom: iOS solo hace zoom si < 16px */
    background: rgba(15,23,42,0.7);
    color: var(--color-text-dark);
    outline: none;
    touch-action: manipulation; /* evita doble-tap zoom en Android */
}

body.theme-light input[type="number"],
body.theme-light input[type="text"],
body.theme-light input[type="email"],
body.theme-light input[type="tel"],
body.theme-light select {
    background: #ffffff;
    color: #111827;
    border-color: #d1d5db;
}

input:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(0,201,167,0.35);
}

/* Inline error messages (no alert) */
.field-error {
    font-size: 0.78rem;
    color: var(--color-danger);
    margin-top: 3px;
}

.input-error,
select.input-error {
    border-color: rgba(239, 68, 68, 0.9) !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25) !important;
}

/* Sliders (touch-friendly) */
input[type="range"]{
    width: 100%;
    height: 28px; /* touch target */
    padding: 0;
    background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track{
    height: 6px;
    border-radius: 999px;
    background: rgba(148,163,184,0.35);
}
input[type="range"]::-webkit-slider-thumb{
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--color-primary);
    border: 0;
    margin-top: -6px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}
input[type="range"]::-moz-range-track{
    height: 6px;
    border-radius: 999px;
    background: rgba(148,163,184,0.35);
}
input[type="range"]::-moz-range-thumb{
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--color-primary);
    border: 0;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* Botón calcular */
button.primary,
#btnCalculate {
    border-radius: 999px;
    border: 0;
    padding: 8px 24px;
    font-size: 0.9rem;
    background: var(--color-primary);
    color: #022c22;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(16,185,129,0.32);
}
button.primary:hover,
#btnCalculate:hover { filter: brightness(1.05); }

/* =======================================================
   RESULTADOS / CARDS
   ======================================================= */

#resultsSection { margin-top: 16px; }

.results {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

@media (max-width: 900px) {
    .results { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
    border-radius: 14px;
    padding: 10px 10px 9px;
    background: var(--color-card-dark);
    border: 1px solid rgba(148,163,184,0.45);
    box-shadow: var(--shadow-soft);
}

body.theme-light .card {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 20px 40px rgba(15,23,42,0.16);
}

.card-title {
    font-size: 0.78rem;
    margin-bottom: 4px;
    color: var(--color-muted);
}

.card-value {
    font-size: 0.9rem;
    font-weight: 600;
}

/* =======================================================
   GRÁFICA
   ======================================================= */

.chart-wrapper {
    margin-top: 18px;
    border-radius: 18px;
    padding: 12px 14px 14px;
    background: rgba(15,23,42,0.75);
    border: 1px solid rgba(148,163,184,0.4);
    box-shadow: var(--shadow-soft);
}

body.theme-light .chart-wrapper {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 20px 50px rgba(15,23,42,0.18);
}

.chart-wrapper h2 {
    font-size: 1rem;
    margin: 0 0 4px;
}

.chart-wrapper p {
    font-size: 0.8rem;
    margin: 0 0 8px;
    color: var(--color-muted);
}

/* Canvas wrapper */
.chart-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 320px;  /* alto mínimo para desktop */
    border-radius: 12px;
    padding: 1rem;
}

/* Opcional: aún más alto en pantallas grandes */
@media (min-width: 992px) {
    .chart-canvas-wrap { min-height: 420px; }
}

/* Modo oscuro: fondo de gráfica más claro */
body.theme-dark .chart-canvas-wrap {
    background: #0f172a;
}

/* Modo claro: fondo de gráfica más oscuro (para ticks/text blancos) */
body.theme-light .chart-canvas-wrap {
    background: #111827;
}

/* Toggle escenarios */
.scenario-toggle-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.scenario-btn {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    padding: 4px 10px;
    font-size: 0.78rem;
    background: transparent;
    color: #e5e7eb;
    cursor: pointer;
}
.scenario-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #022c22;
}

/* Descargas (PDF / Excel) */
.pdf-wrapper {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px dashed rgba(148,163,184,0.6);
}

.pdf-subtitle {
    font-size: 0.78rem;
    color: var(--color-muted);
    margin-bottom: 6px;
}

.pdf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pdf-btn {
    border-radius: 999px;
    border: 0;
    padding: 6px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    background: #111827;
    color: #f9fafb;
}

.pdf-btn-secondary {
    background: #f3f4f6;
    color: #111827;
}

/* =======================================================
   FISSY+ / FREEMIUM
   ======================================================= */

/* Zonas bloqueadas visualmente */
.fissy-plus-guard.is-locked {
    position: relative;
    cursor: pointer;
}

.fissy-plus-guard.is-locked::after {
    content: "Fissy+";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(to bottom, rgba(15,23,42,0.8), rgba(15,23,42,0.96));
    border: 1px dashed rgba(148,163,184,0.8);
    color: #e5e7eb;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    pointer-events: none;
}

/* Highlight cuando hacemos scroll al bloque Fissy+ */
.fissy-plus-highlight {
    animation: fissyPlusPulse 1s ease-out 0s 1;
}

@keyframes fissyPlusPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,201,167,0.9); }
    100% { box-shadow: 0 0 0 16px rgba(0,201,167,0); }
}

/* Bloque Fissy+ (CTA) */
.premium-locked-block {
    margin-top: 18px;
    border-radius: 18px;
    padding: 16px 16px 14px;
    background: #020617;
    border: 1px solid rgba(148,163,184,0.7);
    box-shadow: var(--shadow-soft);
}

body.theme-light .premium-locked-block {
    background: #020617;
    color: #e5e7eb;
}

.premium-title {
    font-size: 1rem;
    margin: 0 0 8px;
}

.fissy-plus { color: var(--color-primary); }

.premium-features {
    list-style: none;
    margin: 0 0 10px;
    padding-left: 0;
    font-size: 0.8rem;
    display: grid;
    gap: 4px;
}

.btn-premium-upgrade {
    border-radius: 999px;
    border: 0;
    padding: 7px 18px;
    font-size: 0.86rem;
    background: var(--color-primary);
    color: #022c22;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 6px;
}

.premium-disclaimer {
    font-size: 0.78rem;
    color: var(--color-muted);
}

/* =======================================================
   PREMIUM CHECKOUT (premium-checkout.php)
   ======================================================= */

.plus-options {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 860px) {
    .plus-options { grid-template-columns: 1fr; }
}

.plus-card {
    border-radius: 18px;
    padding: 16px 16px 14px;
    border: 1px solid rgba(148,163,184,0.26);
    background: rgba(15,23,42,0.45);
    box-shadow: var(--shadow-soft);
}

body.theme-light .plus-card {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 20px 40px rgba(15,23,42,0.18);
}

.plus-card h2 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.plus-card p {
    margin: 0 0 10px;
    font-size: 0.86rem;
    color: var(--color-muted);
}

.plus-card ul {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 0.85rem;
}

.plus-card ul li { margin-bottom: 4px; }

.plus-card-highlight {
    border-color: rgba(0,201,167,0.55);
    box-shadow: 0 18px 50px rgba(0,201,167,0.12), var(--shadow-soft);
}

.plus-footer-actions {
    margin-top: 14px;
    text-align: center;
}

.btn-link {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--color-primary);
    padding: 8px 10px;
}
.btn-link:hover { text-decoration: underline; }

/* =======================================================
   LEAD MODAL
   ======================================================= */

.lead-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
}

.lead-modal {
    width: min(460px, 94vw);
    border-radius: 18px;
    background: #020617;
    border: 1px solid rgba(148,163,184,0.7);
    box-shadow: 0 24px 60px rgba(0,0,0,0.8);
    padding: 14px 14px 12px;
    position: relative;
}

body.theme-light .lead-modal {
    background: #ffffff;
    border-color: #e5e7eb;
}

.lead-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 0;
    background: transparent;
    font-size: 1.2rem;
    color: #9ca3af;
    cursor: pointer;
}

/* Cabecera */
.lead-modal-header {
    padding-right: 16px;
    margin-bottom: 8px;
}

#leadModalTitle {
    margin: 0 0 4px;
    font-size: 1rem;
}

#leadModalText {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-muted);
}

/* Cuerpo */
.lead-modal-body { margin-bottom: 10px; }

.lead-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.lead-form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lead-form-group label { font-size: 0.78rem; }

.lead-phone-row {
    display: flex;
    gap: 6px;
}

.lead-phone-row select { max-width: 110px; }

/* Footer (botones) */
.lead-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-lead-primary,
.btn-lead-secondary {
    border-radius: 999px;
    border: 0;
    padding: 7px 14px;
    font-size: 0.82rem;
    cursor: pointer;
}

.btn-lead-primary {
    background: var(--gradient);
    color: #fff;
    font-weight: 600;
}

.btn-lead-secondary {
    background: transparent;
    border: 1px solid rgba(148,163,184,0.6);
    color: #e5e7eb;
}

body.theme-light .btn-lead-secondary { color: #111827; }

/* =======================================================
   LEGACY: Fissy+ Modal (optional/legacy)
   ======================================================= */

.fissyplus-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.fissyplus-modal-inner {
    background: var(--color-card);
    color: var(--color-text);
    padding: 2rem;
    border-radius: 12px;
    max-width: 420px;
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

.fissyplus-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
}

.btn-secondary {
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 8px;
    color: var(--color-text);
    cursor: pointer;
}

/* =======================================================
   PREMIUM OPTIONS GRID (if used elsewhere)
   ======================================================= */

.premium-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.premium-option-card {
    background: var(--color-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255,255,255,0.08);
}

.premium-option-card h2 { margin-bottom: 0.5rem; }
.premium-option-card ul {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
}

.premium-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}
.premium-actions-row .btn-secondary { white-space: nowrap; }

/* =======================================================
   Simple vs. Compound Interest – layout
   ======================================================= */

.tool-simple-compound .page-header {
    text-align: left;
    margin-bottom: 12px;
}

.tool-simple-compound .section-block .section-content {
    padding-top: 14px;
}

.svc-results {
    margin-top: 8px;
    margin-bottom: 18px;
}

.svc-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.svc-sliders-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
}

@media (max-width: 768px) {
    .svc-sliders-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.svc-slider-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.svc-slider-label {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.svc-slider-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.tool-simple-compound .svc-chart-wrapper {
    margin-top: 14px;
}

.tool-simple-compound .svc-chart-wrapper .chart-canvas-wrap {
    min-height: 320px;
}

@media (min-width: 992px) {
    .tool-simple-compound .svc-chart-wrapper .chart-canvas-wrap {
        min-height: 380px;
    }
}

.svc-notes {
    margin-top: 14px;
    font-size: 0.8rem;
    line-height: 1.5;
}

.svc-notes-block + .svc-notes-block { margin-top: 10px; }

.svc-notes-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.svc-why-list {
    margin: 0 0 6px;
    padding-left: 18px;
}

.svc-why-list li { margin-bottom: 2px; }

.svc-rates-intro { margin: 0 0 4px; }

.svc-rates-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.svc-rates-list li { margin-bottom: 2px; }

.svc-actions {
    margin: 18px auto 28px;
    text-align: center;
}

.svc-actions .primary {
    border-radius: 999px;
    padding: 10px 26px;
}

.svc-actions .secondary-outline {
    border-radius: 999px;
    padding: 10px 20px;
    border: 1px solid var(--color-primary, #00c9a7);
    background: transparent;
    color: var(--color-primary, #00c9a7);
    font-weight: 500;
    cursor: pointer;
}

.svc-advisor-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 26px;
    font-size: 0.9rem;
    background: var(--gradient);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(16,185,129,0.32);
    cursor: pointer;
}

.tool-simple-compound .svc-advisor-link:hover {
    filter: brightness(1.05);
}

.svc-whatsapp-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

/* =======================================================
   Sticky bar (optional) — canonical (place after header)
   Use only when tool needs persistent indicators/controls
   ======================================================= */

.sticky-bar {
    position: sticky;
    top: var(--header-height);
    z-index: 30;
    padding: 8px 12px;
}

body.theme-light .sticky-bar { background: #ffffff; }
body.theme-dark  .sticky-bar { background: #020617; }

.sticky-inner {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* =======================================================
   Barra de puntaje financiera – sticky bajo el header
   ======================================================= */

.fs-score-bar-wrap {
    position: sticky;
    top: var(--header-height);
    z-index: 30;
    background: var(--page-bg, #ffffff);
    padding: 8px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.fs-score-bar-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fs-score-bar-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: #4b5563;
}

.fs-score-bar {
    position: relative;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.fs-score-bar-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
        #f97373 0%,
        #fbbf24 25%,
        #22c55e 60%,
        #00c9a7 100%
    );
}

.fs-score-bar-pointer {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 18px;
    background: #111827;
}

.fs-score-bar-pointer-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    background: #111827;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 999px;
    white-space: nowrap;
}

.fs-score-bar-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #9ca3af;
}

/* =======================================================
   Safety: header links no underline
   ======================================================= */
.site-header a { text-decoration: none; }
.site-header a:hover { text-decoration: none; }

/* =======================================================
   FOOTER — CTA (Schedule + WhatsApp) — required in all tools
   ======================================================= */

.site-footer {
    margin-top: 26px;
    padding: 18px 16px 28px;
}

.footer-inner {
    max-width: 1040px;
    margin: 0 auto;
    border-top: 1px solid rgba(148,163,184,0.28);
    padding-top: 14px;
}

.footer-cta-row{
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.footer-cta-row .btn-primary,
.footer-cta-row .btn-whatsapp{
    border-radius: 999px;
    border: 0;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-cta-row .btn-primary{
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 12px 24px rgba(112,48,160,0.28);
}

.footer-cta-row .btn-whatsapp{
    background: #25d366;
    color: #022c22;
    box-shadow: 0 10px 22px rgba(37, 211, 102, 0.28);
}

.footer-cta-row img{
    width: 18px;
    height: 18px;
    display: block;
}

/* =======================================================
   PLANNER — CTA FINAL (2 COLUMNAS) + row inline (deduped)
   ======================================================= */

.planner-cta-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 14px;
}

@media (max-width: 768px) {
    .planner-cta-grid {
        grid-template-columns: 1fr;
    }
}

/* Columna izquierda: acciones */
.planner-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

/* CTA row: Schedule + WhatsApp inline */
.planner-cta-actions-row,
.planner-cta-row{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}

/* WhatsApp con texto + icono (single canonical class) */
.planner-whatsapp-link,
.planner-whatsapp-btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    border-radius:999px;
    border:0;
    padding:8px 14px;
    font-size:0.9rem;
    background:#25d366;
    color:#022c22;
    font-weight:600;
    cursor:pointer;
    box-shadow:0 6px 14px rgba(37,211,102,0.35);
    width: auto;
    height: auto;
}

.planner-whatsapp-link img,
.planner-whatsapp-btn img{
    width:18px;
    height:18px;
    display:block;
}

.planner-whatsapp-text{
    font-size:0.9rem;
    font-weight:600;
    color:#022c22;
}

/* Promo link (no botón) */
.promo-link {
    font-size: 0.82rem;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
    align-self: flex-start;
}


@media (max-width: 920px){
  .goal-grid-3col{ grid-template-columns: 1fr; }
}

/* Make the block span full width */
.goal-fullwidth-block{
  width: 100%;
}

/* Real card look (like planner) */
.goal-card{
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}
body.theme-light .goal-card{
  border-color: rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
}

/* 3 columns inside the card */
.goal-grid-3col{
  display:grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap:16px;
  align-items:start;
}
@media (max-width: 920px){
  .goal-grid-3col{ grid-template-columns: 1fr; }
}

.goal-accum-2col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
@media (max-width: 920px){
  .goal-accum-2col{ grid-template-columns: 1fr; }
}

/* =========================
   MoneyMap v0.5 (layout + hide hints + modal)
   ========================= */

.mm-head-2col{
  display:flex;
  gap:14px;
  justify-content:space-between;
  align-items:flex-start;
}
.mm-head-left{ flex: 1 1 auto; }
.mm-head-right{ flex: 0 0 auto; display:flex; align-items:flex-start; }
.mm-cta-right{ display:flex; gap:12px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width: 820px){
  .mm-head-2col{ flex-direction:column; }
  .mm-head-right{ width:100%; }
  .mm-cta-right{ justify-content:flex-start; }
}

.mm-load-card{ margin: 12px auto; max-width: 980px; }
.mm-load-email{ grid-column: 1 / span 2; }
.mm-load-btn{ display:flex; align-items:flex-end; }

/* Hide all “suggested max/min” hints */
.mm-muted[id^="hint"]{ display:none !important; }
#mmTierHint{ display:none !important; } /* optional: remove this guidance text too */

/* Save modal */
.mm-save-modal{ position:fixed; inset:0; z-index:9999; }
.mm-save-overlay{ position:absolute; inset:0; background:rgba(0,0,0,.55); }
.mm-save-dialog{
  position:relative;
  max-width:560px;
  margin:8vh auto;
  background: var(--color-card, #111827);
  border:1px solid rgba(255,255,255,.14);
  border-radius:14px;
  padding:14px;
}
body.theme-light .mm-save-dialog{
  border-color: rgba(0,0,0,.12);
  background: var(--color-card, #ffffff);
}
.mm-save-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.mm-load-btn{
  display:flex;
  align-items:flex-end;
}

.mm-load-inline{
  padding: 0;
  margin: 14px 0 10px;
  border: 0;
  background: transparent;
}

.mm-load-inline .mm-load-left{
  margin-bottom: 8px;
}

.mm-load-inline .mm-load-right{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.mm-load-inline #mmLoadEmail{
  width: 260px;       /* reduce el campo */
  max-width: 70vw;    /* mobile safe */
}

.mm-load-inline #mmLoadLatest{
  white-space: nowrap; /* que no salte de línea */
}

.mm-load-inline .mm-load-info{
  margin-top: 8px;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* opcional: accesibilidad para label oculto */
.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}
.label-inline-live{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.live-final-inline{
  font-size:0.78rem;
  opacity:0.95;
  display:inline-flex;
  gap:6px;
  align-items:baseline;
  white-space:nowrap;
}
.live-final-inline strong{
  font-weight:700;
}

/* =======================================================
   SPRINT 1 — simple-compound v2.0
   Tiers: Libre | Libre + datos | Fissy+
   ======================================================= */

/* ── PRESET BUTTONS ───────────────────────────────────── */
.svc-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.svc-presets-label {
  font-size: 0.82rem;
  opacity: 0.6;
  white-space: nowrap;
  margin-right: 4px;
}
.svc-preset-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.svc-preset-btn:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
}
.svc-preset-btn.svc-preset-active {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* ── HYBRID INPUTS ────────────────────────────────────── */
.svc-inputs-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.svc-hybrid-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Layout vertical: nombre → input → slider */
.svc-hybrid-header {
  display: flex;
  flex-direction: column;   /* apilado: label arriba, input abajo */
  gap: 6px;
}

.svc-hybrid-label {
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0.85;
  cursor: pointer;
}

.svc-hybrid-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;               /* ocupa todo el ancho disponible */
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--color-card);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.svc-hybrid-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0,201,167,0.18);
}

.svc-unit-prefix {
  font-size: 0.9rem;
  opacity: 0.6;
  user-select: none;
  flex-shrink: 0;
}

/* font-size: 16px → iOS Safari NO hace zoom al hacer foco */
.svc-hybrid-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;           /* ← clave anti-zoom móvil */
  font-weight: 600;
  color: inherit;
  text-align: right;
  -moz-appearance: textfield;
  touch-action: manipulation; /* evita doble-tap zoom */
}
.svc-hybrid-input::-webkit-inner-spin-button,
.svc-hybrid-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.svc-hybrid-unit {
  font-size: 0.9rem;
  opacity: 0.55;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

/* ── 2-COL WRAPPER (featured-result + inputs + chart) ──── */
/* featured-result ahora vive DENTRO del wrapper para poder
   reordenarse en móvil sin JS */
.tool-simple-compound .svc-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: auto auto;
  gap: 0 20px;
  align-items: start;
  margin-top: 20px;
}

/* Desktop: featured-result ocupa fila 1, columnas 1 y 2 (ancho completo) */
.tool-simple-compound .svc-featured-result {
  grid-column: 1 / -1;    /* span ambas columnas */
  grid-row: 1;
  margin-bottom: 20px;
}
/* inputs col: fila 2, col 1 */
.tool-simple-compound .svc-inputs-col {
  grid-column: 1;
  grid-row: 2;
}
/* chart: fila 2, col 2 */
.tool-simple-compound .svc-chart-wrapper {
  grid-column: 2;
  grid-row: 2;
}

/* Móvil: 1 columna, con featured-result ENTRE inputs y chart */
@media (max-width: 860px) {
  .tool-simple-compound .svc-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto;  /* filas automáticas */
    gap: 16px 0;
  }
  .tool-simple-compound .svc-inputs-col      { grid-column: 1; grid-row: auto; order: 1; }
  .tool-simple-compound .svc-featured-result { grid-column: 1; grid-row: auto; order: 2; margin-bottom: 0; }
  .tool-simple-compound .svc-chart-wrapper   { grid-column: 1; grid-row: auto; order: 3; }
}

/* ── DIFF CARD ACCENT ─────────────────────────────────── */
.svc-card-diff {
  border-color: rgba(0,201,167,0.35) !important;
}
.svc-diff-value {
  color: var(--color-primary) !important;
}

/* ── INSIGHT BLOCK (Tier 1) ───────────────────────────── */
.svc-insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--color-primary-soft);
  border: 1px solid rgba(0,201,167,0.3);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.svc-insight-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.svc-insight p {
  margin: 0;
}

/* ── TIER 2 SECTION ───────────────────────────────────── */
.svc-tier2 {
  margin: 28px 0;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 22px;
}

.svc-tier2-header {
  margin-bottom: 16px;
}

.svc-tier2-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 6px;
}
.svc-tier2-eyebrow:empty { display: none; }

.svc-tier2-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.svc-tier2-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .svc-tier2-actions { grid-template-columns: 1fr; }
}

.svc-tier2-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.svc-tier2-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  transform: translateY(-1px);
}

.svc-tier2-btn-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.svc-tier2-btn-body {
  flex: 1;
  min-width: 0;
}

.svc-tier2-btn-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.svc-tier2-btn-sub {
  display: block;
  font-size: 0.78rem;
  opacity: 0.6;
  line-height: 1.3;
}

.svc-tier2-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-primary);
  color: #fff;
  flex-shrink: 0;
}

/* ── AGE COMPARE SECTION ──────────────────────────────── */
.svc-age-compare .svc-compare-now  { color: var(--color-primary) !important; }
.svc-age-compare .svc-compare-later { color: #7030A0 !important; }

/* ── FEATURED RESULT PERCENTAGE ────────────────────────── */
.svc-featured-pct {
  font-size: 0.62em;
  font-weight: 600;
  color: var(--color-primary);
  opacity: 0.85;
  margin-left: 4px;
  white-space: nowrap;
}

.svc-age-compare-note {
  margin: 12px 0 0;
  font-size: 0.88rem;
  opacity: 0.75;
  font-style: italic;
}

/* ── FISSY+ UPSELL CARD (Tier 3) ──────────────────────── */
.svc-upsell {
  margin: 28px 0;
  background: linear-gradient(135deg, rgba(0,201,167,0.08) 0%, rgba(0,201,167,0.02) 100%);
  border: 1px solid rgba(0,201,167,0.3);
  border-radius: 16px;
  padding: 24px;
}

.svc-upsell-top {
  margin-bottom: 16px;
}

.svc-upsell-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--color-primary);
  color: #fff;
  margin-bottom: 8px;
}

.svc-upsell-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.svc-upsell-sub {
  font-size: 0.88rem;
  opacity: 0.7;
  margin: 0;
}

.svc-upsell-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
@media (max-width: 640px) {
  .svc-upsell-list { grid-template-columns: 1fr; }
}
.svc-upsell-list li {
  font-size: 0.88rem;
  line-height: 1.4;
}

.svc-upsell-btn {
  display: inline-block;
  padding: 11px 24px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.svc-upsell-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════
   SPRINT 1 v2.1 — additional styles
   ══════════════════════════════════════════════════════════ */

/* ── Page header centered ─────────────────────────────── */
.svc-page-header {
  text-align: center;
}
.svc-page-header h1 {
  margin-bottom: 6px;
}
.svc-page-header p {
  opacity: 0.7;
  font-size: 0.95rem;
}

/* ── Utility: centered / justified text ───────────────── */
.svc-text-center  { text-align: center; }
.svc-section-center { text-align: center; }

/* ── Preset sources (collapsible details) ─────────────── */
.svc-presets-info {
  margin: -8px 0 16px;
  font-size: 0.82rem;
}
.svc-presets-info summary {
  cursor: pointer;
  color: var(--color-primary);
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.svc-presets-info summary::-webkit-details-marker { display: none; }
.svc-presets-info[open] summary { opacity: 0.75; }

.svc-presets-info-body {
  margin-top: 10px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  line-height: 1.55;
}
.svc-presets-info-body ul {
  margin: 0 0 10px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.svc-presets-info-body li { opacity: 0.9; }
.svc-presets-info-note {
  margin: 0;
  opacity: 0.6;
  font-style: italic;
}

/* ── Compare period row (cost-of-waiting config) ──────── */
.svc-compare-period-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.svc-compare-period-row span {
  opacity: 0.75;
  white-space: nowrap;
}
.svc-compare-period-input {
  width: 70px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: inherit;
  font-size: 0.9rem;
  font-family: inherit;
  text-align: center;
  -moz-appearance: textfield;
}
.svc-compare-period-input::-webkit-inner-spin-button,
.svc-compare-period-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.svc-compare-period-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0,201,167,0.2);
}
.svc-compare-period-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: inherit;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}
.svc-compare-period-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* Light-mode overrides for new inputs */
body.theme-light .svc-compare-period-input,
body.theme-light .svc-compare-period-select {
  border-color: rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.04);
  color: var(--color-text);
}
body.theme-light .svc-presets-info-body {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.1);
}

/* ── Age compare note (small footer text) ─────────────── */
.svc-age-compare-note {
  margin-top: 12px;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
  font-style: italic;
}

/* ── Compare result cards spacing ─────────────────────── */
.svc-compare-results {
  margin-bottom: 4px;
}

/* ══════════════════════════════════════════════════════════
   SPRINT 1 v3.0 — Compound Interest Calculator redesign
   ══════════════════════════════════════════════════════════ */

/* ── Featured result (investor.gov style) ─────────────────── */
.svc-featured-result {
  text-align: center;
  padding: 28px 20px 24px;
  margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(0,201,167,0.07) 0%, rgba(0,201,167,0.02) 100%);
  border: 1px solid rgba(0,201,167,0.2);
  border-radius: 16px;
}
.svc-featured-label {
  font-size: 1rem;
  opacity: 0.7;
  margin: 0 0 6px;
  font-weight: 400;
}
.svc-featured-value {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.svc-mini-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.svc-mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.svc-mini-stat-icon { font-size: 0.95rem; }
.svc-mini-stat strong {
  font-weight: 700;
  color: var(--color-primary);
}
.svc-mini-stat-label { opacity: 0.65; }
.svc-mini-stat-sep {
  opacity: 0.4;
  font-size: 1.1rem;
  font-weight: 300;
}

/* ── 2×2 input grid (cajones iguales) ─────────────────────── */
.svc-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .svc-inputs-grid { grid-template-columns: 1fr; gap: 12px; }
}
.svc-inputs-grid .svc-hybrid-group { margin-bottom: 0; }

/* Fix overflow: inputs can shrink inside the 2×2 grid */
.svc-inputs-grid .svc-hybrid-input {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 16px; /* anti-zoom móvil */
}
.svc-inputs-grid .svc-hybrid-input-wrap {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.svc-inputs-grid .svc-hybrid-header {
  flex-direction: column; /* apilado en la grilla también */
  gap: 6px;
}
.svc-inputs-grid .svc-range {
  width: 100%;
  max-width: 100%;
}

/* ── Frequency select row ──────────────────────────────────── */
.svc-freq-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.svc-freq-label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
  cursor: default;
}
.svc-freq-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: inherit;
  font-size: 16px;           /* anti-zoom móvil */
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s;
  touch-action: manipulation;
}
.svc-freq-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0,201,167,0.2);
}
.svc-freq-note {
  font-size: 0.78rem;
  opacity: 0.5;
  margin: 2px 0 0;
  font-style: italic;
  line-height: 1.4;
}

/* Light-mode overrides v3.0 */
body.theme-light .svc-freq-select {
  border-color: rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.04);
  color: var(--color-text);
}
body.theme-light .svc-featured-result {
  background: linear-gradient(135deg, rgba(0,201,167,0.08) 0%, rgba(0,201,167,0.02) 100%);
}

/* ── Remove old 4-card grid if still present ──────────────── */
.svc-results:not(.svc-compare-results) {
  display: none !important;   /* hidden: replaced by svc-featured-result */
}
}