:root {
    --primario: #3368c6;
    --primario-oscuro: #1e4f9e;
    --secundario: #1e76bd;
    --turquesa: #00aaa6;
    --verde: #89b222;
    --naranja: #e48a00;
    --rojo: #dc5512;
    --texto: #444;
    --fondo: #f4f7fc;
    --dorado: #f5b301;
    --error: #9a3412;
    --muted: #5c6b7e;
    --linea: #d5deea;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--texto);
    background-color: var(--fondo);
    background-image: linear-gradient(165deg, #e7eefb 0%, var(--fondo) 42%, #e5f5f4 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(48px);
}

body::before {
    width: 280px;
    height: 280px;
    top: -90px;
    right: -70px;
    background: rgba(51, 104, 198, 0.22);
}

body::after {
    width: 340px;
    height: 340px;
    bottom: -120px;
    left: -90px;
    background: rgba(0, 170, 166, 0.18);
}

.pagina {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.25rem 1rem 2.5rem;
}

.envoltorio,
.card {
    width: 100%;
    max-width: 560px;
}

.envoltorio {
    scroll-margin-top: 12px;
}

.card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(30, 79, 158, 0.1), 0 2px 8px rgba(30, 79, 158, 0.05);
    padding: 1.25rem 1rem 1.35rem;
}

.logo {
    display: block;
    width: auto;
    height: 52px;
    max-width: 70%;
    margin: 0 auto 0.85rem;
    object-fit: contain;
}

h1,
.progreso,
.btn,
.pasos-nav,
.criterio-nombre,
.sucursal-nombre {
    font-family: Poppins, sans-serif;
}

h1 {
    margin: 0 0 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    color: var(--primario-oscuro);
}

.subtitulo,
.no-disponible {
    margin: -0.35rem 0 1.15rem;
    text-align: center;
    color: var(--texto);
}

.no-disponible {
    margin: 0.5rem 0 0.35rem;
    font-size: 1.05rem;
}

.progreso {
    margin-bottom: 0.85rem;
}

.pasos-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}

.pasos-nav li {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.25;
    color: var(--muted);
}

.pasos-nav li.hecho {
    color: var(--primario);
    font-weight: 600;
}

.pasos-nav li.actual {
    color: var(--primario-oscuro);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.barra {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #d9e3f2;
}

.relleno {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primario);
    transition: width 0.35s ease;
}

.pasos {
    display: grid;
}

.paso {
    grid-area: 1 / 1;
    min-width: 0;
}

.paso-tx {
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.paso-hacia {
    opacity: 1;
    transform: translateX(0);
}

.wizard.adelante .paso-desde {
    opacity: 0;
    transform: translateX(28px);
}

.wizard.adelante .paso-sale {
    opacity: 0;
    transform: translateX(-28px);
}

.wizard.atras .paso-desde {
    opacity: 0;
    transform: translateX(-28px);
}

.wizard.atras .paso-sale {
    opacity: 0;
    transform: translateX(28px);
}

.wizard:not(.listo) .paso-tx {
    transition: none;
}

.sucursales {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.sucursal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 64px;
    padding: 0.85rem 0.9rem;
    text-align: left;
    color: var(--texto);
    background: #fff;
    border: 1.5px solid #e4ebf5;
    border-left: 4px solid var(--primario);
    border-radius: 14px;
    cursor: pointer;
}

.sucursal.elegida {
    background: #f3f7ff;
    box-shadow: 0 0 0 2px rgba(51, 104, 198, 0.28);
}

.sucursal-texto {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.sucursal-nombre {
    font-weight: 700;
    font-size: 1rem;
    color: #243044;
}

.sucursal-direccion {
    font-size: 0.92rem;
    color: var(--muted);
}

.tilde-hueco {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.tilde {
    width: 26px;
    height: 26px;
    color: var(--primario);
}

.caritas {
    display: flex;
    gap: 0.35rem;
    justify-content: space-between;
}

.carita {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.1rem;
    color: var(--texto);
    background: transparent;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
}

.carita svg {
    width: 64px;
    height: 64px;
    color: #b7c0cc;
    transition: transform 0.2s ease, color 0.2s ease;
}

.carita .fondo {
    fill: currentColor;
    opacity: 0.16;
}

.carita .contorno,
.carita .boca {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
}

.carita .ojo {
    fill: currentColor;
}

.carita.elegida svg {
    transform: scale(1.15);
    animation: rebote 0.45s ease;
}

.carita.elegida.negativa svg { color: var(--rojo); }
.carita.elegida.regular svg { color: var(--naranja); }
.carita.elegida.excelente svg { color: var(--verde); }

.criterios {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.criterio.falta .criterio-nombre {
    color: var(--error);
}

.criterio.falta {
    padding-left: 0.65rem;
    box-shadow: inset 3px 0 0 var(--rojo);
}

.criterio-nombre {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #243044;
}

.criterio-desc {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.estrellas {
    display: flex;
    gap: 0.1rem;
    margin-top: 0.35rem;
}

.estrella {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 2px;
    color: #d5dbe3;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.estrella svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.estrella.activa {
    color: var(--dorado);
}

.estrella.pulso svg {
    animation: pulso-estrella 0.35s ease;
}

.leyenda {
    min-height: 1.3rem;
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primario-oscuro);
}

.leyenda.vacia {
    font-weight: 400;
    color: var(--muted);
}

.fila-doble {
    display: grid;
    gap: 0.75rem;
}

.campo {
    position: relative;
    margin-bottom: 0.75rem;
}

.campo input,
.campo textarea {
    width: 100%;
    margin: 0;
    padding: 1.25rem 0.9rem 0.45rem;
    font: inherit;
    font-size: 16px;
    color: var(--texto);
    background: #fff;
    border: 1.5px solid var(--linea);
    border-radius: 12px;
}

.campo textarea {
    min-height: 120px;
    resize: vertical;
}

.campo label {
    position: absolute;
    top: 0.95rem;
    left: 0.9rem;
    max-width: calc(100% - 1.8rem);
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.2;
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.15s ease, color 0.15s ease;
}

.campo input:focus + label,
.campo input:not(:placeholder-shown) + label,
.campo textarea:focus + label,
.campo textarea:not(:placeholder-shown) + label {
    transform: translateY(-0.62rem) scale(0.78);
    color: var(--primario);
}

.campo input::placeholder,
.campo textarea::placeholder {
    color: transparent;
}

.campo.invalido input,
.campo.invalido textarea {
    border-color: var(--rojo);
}

.campo.invalido input:focus + label,
.campo.invalido textarea:focus + label,
.campo.invalido input:not(:placeholder-shown) + label,
.campo.invalido textarea:not(:placeholder-shown) + label {
    color: var(--error);
}

.contador {
    display: block;
    margin-top: 0.3rem;
    text-align: right;
    font-size: 0.8rem;
    color: var(--muted);
}

.honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.error {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: var(--error);
}

.aviso {
    margin: 0 0 1rem;
    padding: 0.85rem 0.95rem;
    color: #6b3a12;
    background: #fff6ee;
    border: 1px solid #f0d2b4;
    border-radius: 12px;
}

.aviso p {
    margin: 0;
}

.acciones {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1.1rem;
    font-family: Poppins, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    color: var(--primario-oscuro);
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
}

.btn.primario {
    color: #fff;
    background: var(--primario);
}

.btn.primario:hover {
    background: var(--primario-oscuro);
}

.btn.primario.apagado {
    color: #243044;
    background: #c5d0e2;
    cursor: pointer;
}

.btn.secundario {
    color: var(--primario-oscuro);
    background: #fff;
    border-color: var(--primario);
}

.btn.secundario:hover,
.btn.fantasma:hover {
    background: #f3f7ff;
}

.btn.fantasma {
    min-height: 44px;
    background: transparent;
}

.btn:disabled {
    cursor: progress;
    opacity: 0.85;
}

.spinner {
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: girar 0.7s linear infinite;
}

.check-wrap {
    display: flex;
    justify-content: center;
    margin: 0.25rem 0 0.85rem;
}

.check {
    width: 84px;
    height: 84px;
}

.check-circulo,
.check-tilde {
    fill: none;
    stroke: var(--verde);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.check-circulo {
    stroke-dasharray: 201;
    stroke-dashoffset: 201;
    animation: dibujar-circulo 0.6s ease forwards;
}

.check-tilde {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: dibujar-tilde 0.4s ease 0.45s forwards;
}

.gracias h1 {
    margin-bottom: 0.45rem;
}

.gracias .subtitulo {
    margin-bottom: 0.25rem;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primario);
    outline-offset: 2px;
}

[x-cloak] {
    display: none !important;
}

@keyframes rebote {
    0% { transform: scale(1); }
    45% { transform: scale(1.24); }
    70% { transform: scale(1.08); }
    100% { transform: scale(1.15); }
}

@keyframes pulso-estrella {
    0% { transform: scale(1); }
    40% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

@keyframes dibujar-circulo {
    to { stroke-dashoffset: 0; }
}

@keyframes dibujar-tilde {
    to { stroke-dashoffset: 0; }
}

@media (hover: hover) {
    .carita:hover svg {
        transform: scale(1.06);
    }

    .carita.elegida:hover svg {
        transform: scale(1.15);
    }
}

@media (max-width: 380px) {
    .carita {
        font-size: 0.75rem;
    }

    .carita svg {
        width: 56px;
        height: 56px;
    }

    .pasos-nav li {
        font-size: 0.62rem;
    }
}

@media (min-width: 480px) {
    .card {
        padding: 1.75rem 1.5rem 1.5rem;
    }

    .fila-doble {
        grid-template-columns: 1fr 1fr;
    }

    h1 {
        font-size: 1.45rem;
    }

    .pasos-nav li {
        font-size: 0.78rem;
    }
}

@media (min-width: 640px) {
    .pagina {
        align-items: center;
        padding: 2rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .check-circulo,
    .check-tilde {
        animation: none;
        stroke-dashoffset: 0;
    }

    .carita.elegida svg,
    .carita:hover svg {
        animation: none;
        transform: none;
    }
}
