/* =========================================================
   ASESOR "Encuentra tu sitio ideal"
   Usa las variables de la página si existen (--blue, --blue-2…)
========================================================= */
.asesor {
    --a-blue: var(--blue, #1d6ff2);
    --a-cyan: var(--blue-2, #00d4ff);
    --a-text: #e2e8f0;
    --a-gray: #8b9ab5;
    --a-border: rgba(255, 255, 255, .1);
    position: relative;
    padding: 2rem;
    text-align: left;
    scroll-margin-top: 96px;   /* al desplazarse, que el menú fijo no tape el indicador de pasos */
    background:
        radial-gradient(80% 120% at 0% 0%, rgba(29, 111, 242, .14), transparent 60%),
        rgba(13, 20, 36, .85);
    border: 1px solid rgba(29, 111, 242, .3);
    border-radius: 22px;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7);
}

.asesor-head { margin: 0 -.25rem 1.9rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--a-border); }

/* ── Indicador de pasos (stepper) ── */
.asesor-steps { display: flex; margin: 0; padding: 0; list-style: none; }
.asesor-step { position: relative; flex: 1; min-width: 0; }
/* Línea que une cada paso con el anterior: se llena con el degradado al avanzar */
.asesor-step:not(:first-child)::before,
.asesor-step:not(:first-child)::after {
    content: ""; position: absolute; top: 17px; right: 50%; width: calc(100% - 44px); height: 3px;
    margin-right: 22px; border-radius: 3px;
}
.asesor-step:not(:first-child)::before { background: rgba(255, 255, 255, .09); }
.asesor-step:not(:first-child)::after {
    /* Relleno celeste con punta luminosa que viaja de un punto al siguiente */
    background: linear-gradient(90deg, var(--a-blue) 0%, var(--a-cyan) 82%, #e6fdff 100%);
    box-shadow: 0 0 10px rgba(0, 212, 255, .5);
    transform: scaleX(0); transform-origin: left center;
    transition: transform .65s cubic-bezier(.65, 0, .35, 1) var(--fill-delay, 0s);
}
.asesor-step.is-done::after, .asesor-step.is-current::after { transform: scaleX(1); }
/* Estados de partida de la animación (los quita js/asesor.js en el siguiente cuadro) */
.asesor-step.is-enter::after { transform: scaleX(0) !important; transition: none !important; }
.asesor-step.is-leave::after { transform: scaleX(1) !important; transition: none !important; }
/* Tramos ya recorridos: un destello suave que los recorre de vez en cuando */
.asesor-step.is-done:not(:first-child)::after,
.asesor-step.is-current:not(:first-child)::after {
    background-image: linear-gradient(90deg, var(--a-blue) 0%, var(--a-cyan) 40%, #f0feff 50%, var(--a-cyan) 60%, var(--a-blue) 100%);
    background-size: 300% 100%;
    animation: asesorDestello 3.6s linear infinite;
}

.asesor-step > button, .asesor-step-static {
    display: flex; flex-direction: column; align-items: center; gap: .55rem;
    width: 100%; padding: 0;
    color: inherit; font: inherit;
    background: none; border: 0;
}
.asesor-step > button { cursor: pointer; }
.asesor-step-dot {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    color: var(--a-gray); font-size: .85rem; font-weight: 800;
    background: #0d1424;
    border: 2px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    transition: background .3s, border-color .3s, color .3s, box-shadow .3s, transform .3s;
    transition-delay: calc(var(--fill-delay, 0s) + .45s);   /* se enciende cuando llega la línea */
}
.asesor-steps .asesor-step.is-enter .asesor-step-dot { color: var(--a-gray); background: #0d1424; border-color: rgba(255, 255, 255, .14); box-shadow: none; animation: none; transition: none; }
.asesor-steps .asesor-step.is-enter .asesor-step-label { color: var(--a-gray); }
.asesor-step-label {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--a-gray); font-size: .74rem; font-weight: 600; letter-spacing: .2px;
    transition: color .3s;
}

/* Completado: check sobre degradado; al pasar el mouse invita a volver */
.asesor-step.is-done .asesor-step-dot { color: #fff; background: linear-gradient(135deg, var(--a-blue), var(--a-cyan)); border-color: transparent; font-size: .8rem; }
.asesor-step.is-done .asesor-step-label { color: var(--a-text); }
.asesor-step.is-done > button:hover .asesor-step-dot,
.asesor-step.is-done > button:focus-visible .asesor-step-dot { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(29, 111, 242, .25); }
.asesor-step.is-done > button:hover .asesor-step-label { color: var(--a-cyan); }
.asesor-step > button:focus-visible { outline: none; }

/* Actual: anillo con halo que respira */
.asesor-step.is-current .asesor-step-dot {
    color: #fff; background: #10213f; border-color: var(--a-cyan);
    box-shadow: 0 0 0 5px rgba(0, 212, 255, .14), 0 0 22px rgba(0, 212, 255, .35);
    animation: asesorPulse 2.2s ease-in-out calc(var(--fill-delay, 0s) + .6s) infinite;
}
.asesor-step.is-current .asesor-step-label { color: #fff; font-weight: 800; }

/* Meta final */
.asesor-step.is-result .asesor-step-dot { font-size: .8rem; }
.asesor-step.is-result.is-current .asesor-step-dot {
    background: linear-gradient(135deg, #16a34a, #22c55e); border-color: transparent;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, .18), 0 0 24px rgba(34, 197, 94, .4);
    animation: asesorPop .5s cubic-bezier(.2, .8, .2, 1.4) calc(var(--fill-delay, 0s) + .55s) both;
}
.asesor-step.is-result.is-current .asesor-step-label { color: #4ade80; }

@keyframes asesorPulse { 0%, 100% { box-shadow: 0 0 0 5px rgba(0, 212, 255, .14), 0 0 22px rgba(0, 212, 255, .3); } 50% { box-shadow: 0 0 0 8px rgba(0, 212, 255, .06), 0 0 30px rgba(0, 212, 255, .45); } }
@keyframes asesorDestello { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@keyframes asesorPop { from { transform: scale(.6); } to { transform: scale(1); } }

/* Texto para lectores de pantalla (el stepper ya lo muestra visualmente) */
.asesor-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.asesor-title { margin: 0 0 .4rem; color: #fff; font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.asesor-hint { margin: 0 0 1.4rem; color: var(--a-gray); font-size: .95rem; line-height: 1.6; }

.asesor-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; animation: asesorIn .35s ease both; }
.asesor-options > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.asesor-options.two > :last-child { grid-column: auto; }

.asesor-option {
    display: flex; align-items: center; gap: .9rem;
    width: 100%;
    padding: 1rem 1.1rem;
    color: var(--a-text);
    font: inherit;
    text-align: left;
    background: rgba(255, 255, 255, .035);
    border: 1.5px solid var(--a-border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s;
}
.asesor-option:hover, .asesor-option:focus-visible { background: rgba(29, 111, 242, .1); border-color: rgba(29, 111, 242, .7); transform: translateY(-2px); outline: none; }
.asesor-option:focus-visible { box-shadow: 0 0 0 3px rgba(56, 189, 248, .5); }
.asesor-option-icon {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 42px; height: 42px;
    color: var(--a-cyan);
    background: rgba(29, 111, 242, .14);
    border: 1px solid rgba(29, 111, 242, .3);
    border-radius: 12px;
    font-size: 1rem;
    transition: background .2s, color .2s;
}
.asesor-option:hover .asesor-option-icon { color: #fff; background: linear-gradient(135deg, var(--a-blue), var(--a-cyan)); }
.asesor-option-text { flex: 1; min-width: 0; }
.asesor-option-text strong { display: block; color: #fff; font-size: .95rem; font-weight: 700; }
.asesor-option-text small { display: block; margin-top: 2px; color: var(--a-gray); font-size: .8rem; line-height: 1.45; }
.asesor-option-arrow { color: var(--a-gray); font-size: .8rem; transition: transform .2s, color .2s; }
.asesor-option:hover .asesor-option-arrow { color: var(--a-cyan); transform: translateX(3px); }

.asesor-nav { margin-top: 1.1rem; min-height: 1.5rem; }
.asesor-back, .asesor-restart {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .3rem 0;
    color: var(--a-gray);
    font: inherit; font-size: .88rem; font-weight: 600;
    background: none; border: 0; cursor: pointer;
}
.asesor-back:hover, .asesor-restart:hover { color: #fff; }
.asesor-back[hidden] { display: none; }

/* Resultado */
.asesor-result { animation: asesorIn .45s ease both; }
.asesor-result-head { display: flex; align-items: flex-start; gap: 1.1rem; margin-bottom: 1.5rem; }
.asesor-result-icon {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 60px; height: 60px;
    color: #fff;
    background: linear-gradient(135deg, var(--a-blue), var(--a-cyan));
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(29, 111, 242, .45);
    font-size: 1.5rem;
}
.asesor-result-tag { display: inline-flex; align-items: center; gap: .4rem; color: #4ade80; font-size: .78rem; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.asesor-result-name { margin: .2rem 0 .3rem; color: #fff; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.15; }
.asesor-result-tagline { margin: 0; color: var(--a-gray); font-size: .95rem; }

.asesor-result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.asesor-result-grid > div { padding: 1.1rem 1.2rem; background: rgba(255, 255, 255, .03); border: 1px solid var(--a-border); border-radius: 14px; }
.asesor-result-grid h4 { margin: 0 0 .7rem; color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.asesor-list { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.asesor-list li { position: relative; padding-left: 1.5rem; color: var(--a-text); font-size: .88rem; line-height: 1.5; }
.asesor-list li::before { content: "\f00c"; position: absolute; left: 0; top: 1px; color: var(--a-cyan); font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: .78rem; }
.asesor-list.why li::before { content: "\f0eb"; color: #fbbf24; }

.asesor-extra { margin: .4rem 0; padding: .7rem 1rem; color: var(--a-text); font-size: .88rem; background: rgba(29, 111, 242, .08); border: 1px dashed rgba(29, 111, 242, .4); border-radius: 12px; }
.asesor-extra i { margin-right: .35rem; color: var(--a-cyan); }

.asesor-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.3rem 0 .6rem; }
.asesor-cta, .asesor-wa {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .9rem 1.5rem;
    font-weight: 700; font-size: .95rem;
    text-decoration: none;
    border-radius: 12px;
    transition: transform .2s, box-shadow .2s, background .2s;
}
.asesor-cta { color: #fff; background: linear-gradient(135deg, var(--a-blue), #0ea5e9); box-shadow: 0 8px 24px rgba(29, 111, 242, .4); }
.asesor-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(29, 111, 242, .55); }
.asesor-wa { color: #fff; background: rgba(37, 211, 102, .12); border: 1px solid rgba(37, 211, 102, .45); }
.asesor-wa i { color: #25d366; font-size: 1.1rem; }
.asesor-wa:hover { background: rgba(37, 211, 102, .2); transform: translateY(-2px); }
.asesor-noscript { color: var(--a-gray); }
.asesor-noscript a { color: var(--a-cyan); }

/* ── Alessa, la asesora ── */
.asesor-bot { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; min-height: 87px; }
/* Conversación: un globo a la vez (js/asesor.js reemplaza el anterior) */
.asesor-chat { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; min-width: 0; }
.lumi { flex-shrink: 0; width: 70px; height: 87px; overflow: visible; filter: drop-shadow(0 8px 18px rgba(0, 212, 255, .18)); }
.lumi-flota { animation: lumiFlota 3.4s ease-in-out infinite; }
.lumi-sombra { fill: rgba(0, 212, 255, .28); transform-box: fill-box; transform-origin: center; animation: lumiSombra 3.4s ease-in-out infinite; }
.lumi-antena { fill: #00d4ff; animation: lumiLuz 2.4s ease-in-out infinite; }
.lumi-corazon { fill: #00d4ff; animation: lumiLuz 2.4s ease-in-out infinite .6s; }
.lumi-ojos { transform-box: fill-box; transform-origin: center; animation: lumiParpadeo 4.8s infinite; }
.lumi-ojos-felices { display: none; }
.asesor-bot.is-happy .lumi-ojos { display: none; }
.asesor-bot.is-happy .lumi-ojos-felices { display: inline; }
.asesor-bot.is-happy .lumi-flota { animation: lumiSalto .6s cubic-bezier(.2, .8, .2, 1.3) 2, lumiFlota 3.4s ease-in-out 1.2s infinite; }
.lumi-brazo { transform-box: fill-box; transform-origin: 50% 12%; }
.lumi-brazo-izq { transform: rotate(14deg); }
.lumi-brazo-der { transform: rotate(-14deg); }
.asesor-bot.is-waving .lumi-brazo-der { animation: lumiSaludo 1.1s ease-in-out 2; }
.asesor-bot.is-happy .lumi-brazo { animation: lumiCelebra .6s ease-in-out 2; }

.asesor-bubble {
    position: relative;
    margin: 0;
    padding: .8rem 1.05rem;
    color: #fff; font-size: .92rem; line-height: 1.5;
    background: linear-gradient(135deg, rgba(29, 111, 242, .2), rgba(0, 212, 255, .08));
    border: 1px solid rgba(0, 212, 255, .28);
    border-radius: 16px 16px 16px 4px;
}
.asesor-bubble:not(:last-child) { border-radius: 16px; }
.asesor-bubble:last-child::before {   /* colita del globo hacia Alessa (solo el último) */
    content: ""; position: absolute; left: -7px; bottom: 12px;
    width: 12px; height: 12px;
    background: #12264a;
    border-left: 1px solid rgba(0, 212, 255, .28); border-bottom: 1px solid rgba(0, 212, 255, .28);
    transform: rotate(45deg);
}
.asesor-bubble strong { color: #7df3ff; }
.asesor-bubble { animation: lumiGlobo .4s cubic-bezier(.2, .8, .2, 1.2) both; }
/* "Escribiendo…": tres puntitos que saltan */
.asesor-typing { display: inline-flex; gap: 5px; padding: .85rem 1rem; }
.asesor-typing span { width: 7px; height: 7px; border-radius: 50%; background: #7df3ff; animation: lumiTecleo 1s ease-in-out infinite; }
.asesor-typing span:nth-child(2) { animation-delay: .15s; }
.asesor-typing span:nth-child(3) { animation-delay: .3s; }
.asesor-bubble-wa {
    display: inline-flex; align-items: center; gap: .45rem;
    margin-top: .55rem; padding: .5rem .95rem;
    color: #fff; font-weight: 700; font-size: .85rem; text-decoration: none; white-space: nowrap;
    background: rgba(37, 211, 102, .16); border: 1px solid rgba(37, 211, 102, .5); border-radius: 50px;
    transition: background .2s;
}
.asesor-bubble-wa i { color: #25d366; font-size: 1.05rem; }
.asesor-bubble-wa:hover { background: rgba(37, 211, 102, .28); }
@keyframes lumiTecleo { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

@keyframes lumiFlota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes lumiSombra { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.8); opacity: .5; } }
@keyframes lumiLuz { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes lumiParpadeo { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes lumiSaludo { 0%, 100% { transform: rotate(-14deg); } 25% { transform: rotate(-150deg); } 50% { transform: rotate(-120deg); } 75% { transform: rotate(-150deg); } }
@keyframes lumiCelebra { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-30deg); } }
@keyframes lumiSalto { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-12px); } }
@keyframes lumiGlobo { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes asesorIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Ventana emergente (planes y cotizador) */
.asesor-dialog { position: fixed; width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 32px); padding: 0; color: inherit; background: transparent; border: 0; overflow: visible; }
.asesor-dialog::backdrop { background: rgba(3, 6, 14, .78); backdrop-filter: blur(4px); }
.asesor-dialog .asesor { max-height: calc(100vh - 40px); overflow-y: auto; background-color: #0d1424; }
.asesor-dialog .asesor-head { padding-right: 46px; }
.asesor-dialog-close {
    position: absolute; top: 18px; right: 18px; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    color: #8b9ab5; font-size: 1rem;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 50%;
    cursor: pointer;
}
.asesor-dialog-close:hover { color: #fff; }

/* Botón de acceso al asesor */
.asesor-trigger {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .7rem 1.2rem;
    color: #fff; font: inherit; font-size: .92rem; font-weight: 700;
    background: rgba(29, 111, 242, .14);
    border: 1px solid rgba(29, 111, 242, .5);
    border-radius: 50px;
    cursor: pointer;
    transition: background .2s, transform .2s;
}
.asesor-trigger i { color: var(--blue-2, #00d4ff); }
.asesor-trigger:hover { background: rgba(29, 111, 242, .25); transform: translateY(-2px); }

@media (max-width: 640px) {
    .asesor { padding: 1.3rem; border-radius: 18px; }
    .asesor-options, .asesor-result-grid { grid-template-columns: 1fr; }
    .asesor-options > :last-child:nth-child(odd) { grid-column: auto; }
    .asesor-actions a { flex: 1 1 100%; }
    .asesor-head { margin-bottom: 1.4rem; padding-bottom: 1.1rem; }
    .lumi { width: 54px; height: 67px; }
    .asesor-bot { gap: .7rem; min-height: 67px; }
    .asesor-bubble { font-size: .85rem; padding: .65rem .85rem; }
    .asesor-typing { padding: .75rem .9rem; }
    .asesor-step-dot { width: 30px; height: 30px; font-size: .75rem; }
    .asesor-step:not(:first-child)::before, .asesor-step:not(:first-child)::after { top: 14px; width: calc(100% - 36px); margin-right: 18px; }
    .asesor-step-label { font-size: .68rem; }
    /* En pantallas chicas solo se nombra el paso actual */
    .asesor-step:not(.is-current) .asesor-step-label { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .asesor-options, .asesor-result { animation: none; }
    .asesor-option, .asesor-step-dot, .asesor-step::after { transition: none; animation: none; }
    .asesor-step.is-current .asesor-step-dot { animation: none; }
    .lumi-flota, .lumi-sombra, .lumi-antena, .lumi-corazon, .lumi-ojos, .lumi-brazo, .asesor-bubble, .asesor-typing span { animation: none !important; }
}
