/* -------------------------------------------------------------------
2) VARIABLES
-------------------------------------------------------------------- */
:root {
    --brand-red: #EC0000;
    --brand-red-dark: #C71F17;
    --text-main: #4C4C4C;
    --text-muted: #767676;
    --bg: #fff;
    --border: #D9D9D9;
    --shadow: 0 8px 24px rgba(0, 0, 0, .08);
    --radius: 12px;
    --ok: #EC0000;

    /* Tamaño unificado de campos de formulario */
    --field-width: 343px;
    --field-height: 64px;

    /* Gaps por sección */
    --gap-1: 24px;
    --gap-2: 24px;
    --gap-3: 24px;
    --gap-4: 0px;

    /* ===== Tamaño del Goal Panel (base escritorio) ===== */
    --goal-w: 360px;
    --goal-h: 260px;

    /* ===== Offsets libres (desktop) ===== */
    --goal-offset-x: -60px;
    --goal-offset-y: -100px;

    /* ===== Flecha sobre goalPanel (solo desktop/tablet) ===== */
    --arrow-x: 310px;
    --arrow-y: 215px;
    --arrow-scale: 4;
    --arrow-z: 3;

    /* Contenedor */
    --container-max: 1180px;
    --container-pad: 20px;

    /* ===== CONTROLES PERSONA EN MÓVIL ===== */
    /* X: izquierda(-) / derecha(+) */
    --persona-mobile-x: 0px;
    /* Y: más negativo = sube, positivo = baja */
    --persona-mobile-y: -30px;
    /* Tamaño de la persona en móvil */
    --persona-mobile-scale: 2.0;

    /* ===== CONTROLES LEYENDA EN MÓVIL ===== */
    /* Solo mover en X la leyenda (izq/der) */
    --legend-mobile-x: 0px;
    --legend-mobile-y: 260px;

}

/* -------------------------------------------------------------------
3) RESET + TIPOGRAFÍA + GUARDAS ANTI-OVERFLOW
-------------------------------------------------------------------- */
/* * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

body {
    font-family: "Santander Micro Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.45;
} */


/* -------------------------------------------------------------------
4) TOPBAR
-------------------------------------------------------------------- */
.topbar {
    height: 64px;
    background: var(--brand-red);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(225, 37, 27, .18);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    opacity: .9;
}

/* -------------------------------------------------------------------
5) CONTENEDOR
-------------------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    padding: 0 var(--container-pad);
}

/* -------------------------------------------------------------------
6) HERO + PROPÓSITO
-------------------------------------------------------------------- */
.hero {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.herohead {
    text-align: center;
    font-family: "Santander Headline";
    font-weight: 700;
    font-size: 54px;
    margin-bottom: 24px;
    color: #222222;
}

.heroTitle {
    font-family: 'Santander Headline', sans-serif;
    font-size: 28px;
    color: #222222;
    font-weight: bold;
    margin-bottom: 8px;
}

.purposeFull {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0 0 12px;
}

.purposeFull .purpose-heading {
    font-family: 'Santander Micro Text', sans-serif;
    font-size: 16px;
    color: #222222;
    font-weight: 400;
    margin-top: 0px;
}

.purposeGrid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 16px;
    padding-top: 24px;
}

.purposeBtn {
    width: 80px;
    height: 80px;
    background: #fff;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font: 500 13px "Santander Micro Text", sans-serif;
    color: #4C4C4C;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .06s;
}

.purposeBtn .icon {
    width: 26px;
    height: 26px;
}

.purposeBtn .label {
    font-size: 11.2px;
    color: #999999;
    transition: color .2s;
}

.purposeBtn:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, .05);
}

.purposeBtn[aria-pressed="true"] {
    border: 2px solid var(--ok);
    color: var(--ok);
}

.purposeBtn[aria-pressed="true"] .label {
    color: var(--ok);
}

.purposeBtn[aria-pressed="true"] .icon {


    filter: brightness(0) saturate(100%) invert(17%) sepia(96%) saturate(7483%) hue-rotate(356deg) brightness(96%) contrast(104%);
}

.purposeBtn .otherEditable {
    display: none;
    font-size: 11.2px;
    font-weight: 500;
    background: transparent;
    border: none;
    outline: none;
    color: var(--ok);
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    caret-color: var(--ok);
}

.purposeBtn[aria-pressed="true"] .otherEditable {
    display: block;
}

.purposeBtn.hasCustom .label {
    display: none;
}

/* -------------------------------------------------------------------
7) GRID PRINCIPAL
-------------------------------------------------------------------- */
.gridMain {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    margin-top: 32px;
}

@media (max-width:991px) {
    .gridMain {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* -------------------------------------------------------------------
8) FORMULARIO (inputs a prueba de overflow)
-------------------------------------------------------------------- */
.panel {
    display: grid;
    gap: 0;
    align-content: start;
}

.cc-label {
    font-family: 'Santander Micro Text', sans-serif;
    font-size: 18px;
    color: #222222;
    font-weight: bold;
    display: block;
}

.cc-input,
.cc-select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    padding: 0 14px;
    color: var(--text-main);
    background: #fff;
    outline: none;
    appearance: none;
    width: min(100%, var(--field-width)) !important;
    max-width: 100%;
    height: var(--field-height) !important;
    line-height: var(--field-height) !important;
    font-family: 'Santander Micro Text', sans-serif;
}

.cc-input:focus,
.cc-select:focus,
.selectWrap:focus-within .es-field {
    border-color: #595959;
    box-shadow: 0 0 0 2px #595959;
}

.selectWrap .es-menu {
    min-width: min(100%, var(--field-width)) !important;
    max-width: min(100%, var(--field-width)) !important;
}

.help,
.error {
    max-width: min(100%, var(--field-width));
}

.help {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.error {
    display: none;
    font-size: 13px;
    margin-top: 6px;
    color: #C62828;
}

#aporte:disabled {
    border-color: #D9D9D9;
    background: #FFFFFF;
    color: var(--text-muted);
}

.formSection {
    display: block;
}

.fieldBlock {
    display: grid;
    grid-template-rows: auto auto;
    row-gap: 0;
}

.fieldBlock>.cc-label {
    margin-bottom: 4px;
}

.fieldBlock>.cc-input,
.fieldBlock>.selectWrap {
    margin-top: 0;
}

.section-1 {
    margin-bottom: var(--gap-1);
}

.section-2 {
    margin-bottom: var(--gap-2);
}

.section-3 {
    margin-bottom: var(--gap-3);
}

.section-4 {
    margin-bottom: var(--gap-4);
}

/* Select mejorado */
.selectWrap {
    position: relative;
    margin-bottom: 0;
    width: min(100%, var(--field-width));
}

.cc-select[data-enhanced] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.es-field {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 44px 0 14px;
    cursor: pointer;
    width: min(100%, var(--field-width)) !important;
    height: var(--field-height) !important;
    line-height: var(--field-height) !important;
}

.es-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    color: var(--text-main);
}

.es-placeholder {
    color: #9B9B9B;
}

.es-chev {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    pointer-events: auto;
    transition: transform .18s ease;
}

.es-field[aria-expanded="true"] .es-chev {
    transform: translateY(-50%) rotate(180deg);
}

.es-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid #D9D9D9;
    border-radius: 12px;
    box-shadow: var(--shadow);
    list-style: none;
    padding: 6px 0;
    margin: 0;
    z-index: 20;
    max-height: 260px;
    overflow: auto;
    display: none;
}

.selectWrap[data-open="true"] .es-menu {
    display: block;
}

.es-option {
    padding: 10px 14px;
    font-size: 15px;
    color: var(--text-main);
    cursor: pointer;
}

.es-option[aria-disabled="true"] {
    color: #9B9B9B;
    cursor: default;
}

.es-option:hover,
.es-option[aria-selected="true"] {
    background: #F5F7FF;
}

.selectWrap[data-locked="true"] .es-field {
    background: #FFFFFF;
    border-color: #D9D9D9;
    color: var(--text-muted);
    cursor: default;
    box-shadow: none !important;
}

.selectWrap[data-locked="true"] .es-display[aria-disabled="true"] {
    pointer-events: none;
}

/* -------------------------------------------------------------------
9) VISUAL DERECHA (desktop / tablet)
-------------------------------------------------------------------- */
.visual {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    position: relative;
}

.personaCol {
    text-align: right;
    position: relative;
    z-index: 2;
    width: fit-content;
}

.persona-img {
    height: 350px;
    transform: translateX(35px) translateY(0px) scale(0.9);
}

/* Columna (panel + leyenda) movible en desktop */
.goalCol {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transform: translate(var(--goal-offset-x), var(--goal-offset-y));
    will-change: transform;
}

/* Goal Panel */
.goalPanel {
    position: relative;
    background: #F4F5F7;
    border-radius: 24px;
    padding: 28px;
    width: clamp(260px, calc(100vw - 2 * var(--container-pad) - 12px), var(--goal-w));
    min-height: var(--goal-h);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    user-select: none;
}

/* Oculta encabezado y monto cuando aún no hay cálculo */
.goalPanel.is-empty .goalLead {
    display: none;
}

.goalPanel.is-empty .goalAmount {
    display: none;
}

/* Flecha (NO móvil) */
.arrowOverlay {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(var(--arrow-x), var(--arrow-y)) scale(var(--arrow-scale));
    width: 38px;
    height: auto;
    z-index: var(--arrow-z);
    pointer-events: none;
}

/* Texto */
.goalText {
    width: 100%;
    max-width: 520px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.goalLead {
    font-size: 18px;
    color: #404040;
    margin-bottom: 6px;
    font-family: 'Santander Micro Text', sans-serif;
}

.goalAmount {
    font-size: 48px;
    line-height: 1.1;
    color: #222;
    margin-bottom: 10px;
    min-height: 56px;
    font-weight: 700;
    font-family: 'Santander Headline', sans-serif;
}

.goalDetail {
    font-size: 16px;
    color: #404040;
    font-family: 'Santander Micro Text', sans-serif;
}

.goalDetail .highlight {
    color: #63B468;
    font-weight: 700;
}

.goalDetail strong {
    font-weight: 700;
}

.goalPanel.is-empty .goalAmount {
    opacity: .35;
}

/* Leyenda (desktop) */
.legendNote {
    font-family: "Santander Micro Text", sans-serif;
    font-size: 13px;
    color: #767676;
    margin-top: 10px;
    max-width: clamp(260px, calc(100vw - 2 * var(--container-pad) - 12px), var(--goal-w));
    line-height: 1.4;
    column-count: 1;
    column-gap: 0;
    white-space: normal;
    word-break: normal;
}

/* -------------------------------------------------------------------
10) BOTÓN REINICIAR
-------------------------------------------------------------------- */
.resetWrap {
    text-align: left;

}

.linkBtn {
    min-width: 140px;
    height: 48px;
    background: #fff;
    color: #EC0000;
    border: 1px solid #EC0000;
    border-radius: 40px;
    font-family: "Santander Headline", sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    transition:
        background .25s ease,
        color .25s ease,
        transform .15s,
        box-shadow .15s;
}

.linkBtn:hover {
    background: #EC0000;
    color: #fff;
    border-color: #EC0000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(236, 0, 0, .20);
}

.linkBtn:active {
    background: #EC0000;
    color: #fff;
    border-color: #EC0000;
    transform: none;
    box-shadow: none;
}

/* ============================
   LAPTOP (referencia base)
   ============================ */
@media (min-width: 1024px) and (max-width: 1439px) {
    :root {
        /* Estos pueden ser los valores que ya tenías o los que te gusten */
        --goal-offset-x: -20px;
        --goal-offset-y: -100px;

        /* Opcional: mueve también la flecha si hace falta */
        --arrow-x: 310px;
        --arrow-y: 215px;
    }
}

/* ============================
   MONITOR FULL HD (1440–1919px)
   ============================ */
@media (min-width: 1440px) and (max-width: 1919px) {
    :root {
        /* Ajusta estos hasta que sientas el panel centrado donde lo quieres */
        --goal-offset-x: 0px;
        /* más negativo = más a la izquierda */
        --goal-offset-y: -80px;
        /* más negativo = más arriba */

        --arrow-x: 320px;
        --arrow-y: 220px;
    }
}

/* ============================
   MONITOR GRANDE / ULTRAWIDE (≥1920px)
   ============================ */
@media (min-width: 1920px) {
    :root {
        --goal-offset-x: -10px;
        --goal-offset-y: -90px;

        --arrow-x: 320px;
        --arrow-y: 220px;
    }
}

@media(min-width: 1200px) and (max-width: 1300px) {
    .persona-img {
        height: 285px;
        transform: translateX(35px) translateY(-20px) scale(0.9);
    }
}

@media(min-width: 992px) and (max-width: 1199px) {
    .visual {
        grid-template-columns: 1fr;
    }

    .goalCol {
        transform: none;
        will-change: transform;
        justify-content: center;
        align-items: center;
    }

    .personaCol {
        display: none;
    }
}

/* -------------------------------------------------------------------
11) RESPONSIVE GENERAL (tablets)
-------------------------------------------------------------------- */
@media (max-width: 991px) {
    :root {
        --field-width: 360px;
    }

    .visual {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .goalCol {
        order: 1;
        align-items: center;
        transform: none;
        /* quita offsets en responsive */
    }

    .goalPanel {
        width: 100%;
        max-width: 100%;
    }

    .legendNote {
        max-width: 100%;
        text-align: center;
    }

    .personaCol {
        order: 2;
        text-align: center;
    }

    .persona-img {
        height: 220px;
        transform: translate(0, -20px) scale(1.2);
    }
}

@media(max-width: 575px){
    .section-descubre .section-simulator .container {
        padding: 0;
    }
}

/* -------------------------------------------------------------------
12) MÓVIL ≤480px
   - Goal panel centrado, cuadrado y más chico que el contenedor
   - Flecha OCULTA
   - Persona debajo, centrada y sobrepuesta (X, Y, scale por variables)
   - Leyenda centrada debajo de la persona (solo X ajustable)
-------------------------------------------------------------------- */
@media (max-width: 480px) {
    :root {
        --container-pad: 16px;
        --field-width: clamp(260px, 92vw, 343px);
    }


    .herohead {
        text-align: center;
        font-family: "Santander Headline";
        font-weight: 700;
        font-size: 44px;
        color: #222222;
        line-height: 1.2;
    }

    .heroTitle {
        font-size: 24px;
        margin-top: 16px;
        margin-bottom: 10px;
    }

    .cc-label {
        font-size: 16px;
    }

    .purposeGrid {
        gap: 12px;
    }

    .panel,
    .fieldBlock,
    .selectWrap {
        width: 100%;
        max-width: 100%;
    }

    .es-field,
    .cc-input {
        width: min(100%, var(--field-width)) !important;
    }

    .selectWrap .es-menu {
        left: 0;
        right: auto;
        width: min(100%, var(--field-width)) !important;
        min-width: min(100%, var(--field-width)) !important;
        max-width: min(100%, var(--field-width)) !important;
    }

    /* Visual en columna */
    .visual {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        margin-bottom: 50px;
    }

    /* Goal panel: centrado y cuadrado, NO pantalla completa */
    .goalCol {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        transform: none;
    }

    .goalPanel {
        width: 100%;
        min-height: 260px;
        border-radius: 20px;
        padding: 20px;
        margin: 0 auto;
    }

    .goalAmount {
        font-size: 34px;
        min-height: auto;
    }

    .goalDetail {
        font-size: 14px;
    }

    /* FLECHA OCULTA EN CELULARES */
    .arrowOverlay {
        display: none !important;
    }

    /* Persona centrada, debajo y sobrepuesta */
    .personaCol {
        order: 2;
        text-align: center;
        position: relative;
        margin-top: 0;
        /* ya no usamos margin-top con variable */
        z-index: 3;
    }

    .persona-img {
        height: 120px;
        transform:
            translate(var(--persona-mobile-x), var(--persona-mobile-y)) scale(var(--persona-mobile-scale));
    }

    /* LEYENDA: centrada debajo de la persona, solo X movible */
    .legendNote {
        font-size: 10px;
        width: min(320px, 90vw);
        max-width: min(320px, 90vw);
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        transform: translateX(var(--legend-mobile-x));
        transform: translateY(var(--legend-mobile-y));
    }

    .resetWrap {
        text-align: center;
        margin-bottom: 8px;

    }
}


/* Ultra chico (360px y menos) */
@media (max-width: 360px) {
    :root {
        --field-width: clamp(240px, 94vw, 320px);
        --persona-mobile-y: -30px;
        --persona-mobile-scale: 1.3;
    }
}