/*
 * La portada de accesos: el mapa 3D a pantalla completa y el panel con los pasos.
 * Primero el móvil (mapa arriba, panel debajo) y desde 900 px el ordenador (mapa de
 * fondo y panel a la derecha). Sin compilar.
 */

:root {
    color-scheme: dark;
    --fondo: #050d1c;
    --marino: #0c2340;
    --azul: #2f86ff;
    --azul-oscuro: #1a5fb4;
    --cian: #38bdf8;
    --cian-claro: #7dd3fc;
    --verde: #34d399;
    --verde-oscuro: #059669;
    --rojo: #f87171;
    --texto: #eef4fb;
    --tenue: #93a4bd;
    --linea: rgba(148, 190, 255, 0.14);
    --caja: rgba(255, 255, 255, 0.045);
    --radio: 14px;
    --panel: 432px;
    /* En el móvil, el alto del mapa: lo justo para que el mapa, los datos y el paso con su
       botón quepan en la pantalla de un móvil normal sin bajar. */
    --escena: clamp(236px, 40svh, 420px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--fondo); }

body.portada {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--fondo);
    color: var(--texto);
    font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
p, h2, ol { margin: 0; }
[hidden] { display: none !important; }

.oculto {
    position: absolute !important;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ---------- El escenario del mapa ---------- */

.escena {
    position: relative;
    height: 40vh;
    height: var(--escena);
    overflow: hidden;
    background:
        radial-gradient(900px 520px at 50% 62%, rgba(31, 84, 160, 0.42), transparent 70%),
        radial-gradient(1400px 900px at 50% 40%, #0b1f3d 0%, #071328 55%, var(--fondo) 100%);
}

.escena::after {
    /* Se funde con el panel por abajo. */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 56px;
    background: linear-gradient(to bottom, transparent, var(--fondo));
    pointer-events: none;
}

.escena__mapa { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.escena__marcas { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }

/* En el móvil va montada en el borde del panel: así no le quita sitio al mapa. */
.escena__estado {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 11px;
    border-radius: 999px;
    background: rgba(5, 14, 30, 0.72);
    border: 1px solid var(--linea);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color 0.4s, color 0.4s;
}

.escena__punto {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cian);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6);
    animation: latir 1.4s infinite;
}

.escena__estado[data-estado="listo"] { border-color: rgba(52, 211, 153, 0.45); color: #d1fae5; }
.escena__estado[data-estado="listo"] .escena__punto { background: var(--verde); animation-name: latir-verde; }

/* Las etiquetas del mapa: la conexión de la persona y el servidor. */
.marca {
    position: absolute;
    left: 0; top: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: transform;
}

.marca--visible { opacity: 1; }

.marca__caja {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px 6px 6px;
    border-radius: 12px;
    background: rgba(6, 18, 38, 0.88);
    border: 1px solid rgba(125, 211, 252, 0.4);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    animation: marca-entra 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}


.marca__icono {
    width: 30px; height: 30px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
}

.marca__icono svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.marca__textos { display: flex; flex-direction: column; line-height: 1.15; }
.marca__textos small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tenue); }
.marca__textos b { font-size: 13.5px; font-weight: 700; }

.marca--origen .marca__icono { background: linear-gradient(140deg, #5cc2ff, #2468e8); }
.marca--servidor .marca__caja { border-color: rgba(52, 211, 153, 0.55); }
.marca--servidor .marca__icono { background: linear-gradient(140deg, #34d399, #047857); }
.marca--servidor .marca__textos b { letter-spacing: 0.08em; }

/* ---------- La cabecera ---------- */

.cabecera {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(env(safe-area-inset-top) + 14px) 16px 0;
    pointer-events: none;
}

.cabecera__emblema { width: 36px; height: auto; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)); }
.cabecera__titulo { display: flex; flex-direction: column; line-height: 1.15; }
.cabecera__empresa { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--tenue); }
.cabecera__nombre { font-size: 16px; font-weight: 600; }
.cabecera__nombre b { color: var(--cian-claro); font-weight: 800; }
.cabecera__sin { white-space: nowrap; }

.cabecera__cifrado {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.cabecera__cifrado svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- El panel ---------- */

.panel {
    position: relative;
    z-index: 4;
    margin-top: -24px;
    padding: 28px 14px calc(env(safe-area-inset-bottom) + 16px);
    border-radius: 24px 24px 0 0;
    background: linear-gradient(to bottom, rgb(10, 24, 47), rgb(6, 15, 31) 40%);
    border-top: 1px solid rgba(148, 190, 255, 0.16);
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.35);
    min-height: calc(100svh - var(--escena) + 24px);
}

/* Lo que se ha detectado de la conexión */
.deteccion {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.dato {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 58px;
    padding: 9px 10px;
    border-radius: var(--radio);
    background: var(--caja);
    border: 1px solid var(--linea);
    transition: border-color 0.4s, background-color 0.4s;
}

.dato--ancho { grid-column: 1 / -1; min-height: 54px; }

.dato__icono {
    position: relative;
    flex: none;
    width: 38px; height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--cian-claro);
    background: rgba(125, 211, 252, 0.09);
    overflow: hidden;
}

.dato__icono svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.dato__icono img { display: block; width: 100%; height: 100%; object-fit: contain; }

.dato--logo .dato__icono {
    background: #fff;
    padding: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.dato__icono .dos { display: flex; gap: 3px; }

.dato__texto { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }

.dato__titulo { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--tenue); }

.dato__valor {
    margin-top: 2px;
    font-size: 14.5px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dato__detalle { font-size: 12px; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dato:not(.dato--listo) .dato__valor {
    color: transparent;
    background: linear-gradient(90deg, rgba(147, 164, 189, 0.35) 0%, rgba(220, 235, 255, 0.85) 50%, rgba(147, 164, 189, 0.35) 100%) 0 0 / 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: brillo 1.3s linear infinite;
}

.dato:not(.dato--listo) .dato__icono::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(125, 211, 252, 0.25) 50%, transparent 70%) 0 0 / 250% 100%;
    animation: brillo 1.3s linear infinite;
}

.dato--listo { border-color: rgba(125, 211, 252, 0.26); background: rgba(125, 211, 252, 0.05); }
.dato--listo .dato__icono { animation: salta 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }
.dato--listo .dato__valor { animation: aparece 0.45s ease both; }

.dato__sello {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.4);
    background: rgba(16, 185, 129, 0.1);
    animation: aparece 0.4s ease both;
}

.dato__sello::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--verde); }

/* Solo en local, con la IP de prueba. */
.dato__detalle--prueba { color: #fcd34d; }
.dato:has(.dato__detalle--prueba) .dato__sello { color: #fde68a; border-color: rgba(251, 191, 36, 0.45); background: rgba(245, 158, 11, 0.12); }
.dato:has(.dato__detalle--prueba) .dato__sello::before { background: #fbbf24; }

.dato--ip .dato__valor { font-family: "SF Mono", ui-monospace, Consolas, Menlo, monospace; font-size: 15.5px; letter-spacing: 0.02em; }

/* ---------- Los pasos ---------- */

.pasos { margin-top: 18px; }

.paso { animation: entra 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.paso__titulo { font-size: 20px; line-height: 1.25; font-weight: 750; margin-bottom: 4px; }
.paso__texto { color: var(--tenue); font-size: 14.5px; margin-bottom: 16px; }

.formulario { display: block; }

.etiqueta { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 650; color: #c8d6ea; margin: 0 0 7px; }
.etiqueta__mas { font-weight: 500; color: var(--tenue); font-size: 12px; }

.correo, .clave {
    display: flex;
    align-items: center;
    height: 54px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 190, 255, 0.22);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.correo:focus-within, .clave:focus-within {
    border-color: var(--cian);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
    background: rgba(255, 255, 255, 0.07);
}

.correo input, .clave input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 6px 0 14px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 17px;
    color: #fff;
}

.correo input::placeholder, .clave input::placeholder { color: rgba(147, 164, 189, 0.6); }

.correo__dominio {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 62%;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 36px;
    margin-right: 9px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tenue);
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(148, 190, 255, 0.28);
    white-space: nowrap;
    transition: color 0.3s, background-color 0.3s, border-color 0.3s;
}

.correo__texto { overflow: hidden; text-overflow: ellipsis; }

/* Sin buscar todavía no se enseña dominio ninguno. */
.correo[data-estado="vacio"] .correo__dominio,
.correo[data-estado="escribiendo"] .correo__dominio { display: none; }
.correo__arroba { opacity: 0.7; }
.correo__bien { display: none; width: 16px; height: 16px; flex: none; fill: none; stroke: var(--verde); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.correo[data-estado="buscando"] .correo__texto {
    color: transparent;
    background: linear-gradient(90deg, rgba(147, 164, 189, 0.4), rgba(220, 235, 255, 0.95), rgba(147, 164, 189, 0.4)) 0 0 / 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: brillo 1s linear infinite;
}

.correo[data-estado="ok"] .correo__dominio {
    color: #d1fae5;
    background: rgba(16, 185, 129, 0.13);
    border: 1px solid rgba(52, 211, 153, 0.55);
    animation: salta 0.45s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.correo[data-estado="ok"] .correo__bien { display: block; stroke-dasharray: 24; stroke-dashoffset: 24; animation: trazo 0.45s 0.1s ease forwards; }
.correo[data-estado="ok"] { border-color: rgba(52, 211, 153, 0.55); }

/* Ha tecleado la @: no entra y la caja se sacude. */
.correo--arroba { animation: sacudir 0.4s; }

.correo[data-estado="no"] .correo__dominio { color: #fecaca; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.45); }

.opciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.opcion {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 190, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.opcion[aria-pressed="true"] { border-color: var(--verde); background: rgba(16, 185, 129, 0.14); color: #d1fae5; }

.aviso { margin-top: 8px; color: #fca5a5; font-size: 13.5px; }
.aviso:empty { display: none; }
/* Una indicación, no un error (por ejemplo, que no hace falta la @). */
.aviso--info { color: var(--cian-claro); animation: aparece 0.3s ease both; }
/* Le toca esperar: el tiempo que queda va contando. */
.aviso__espera { display: block; margin-top: 3px; color: #fde68a; font-weight: 600; font-variant-numeric: tabular-nums; }

.reconocido {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: #6ee7b7;
    font-size: 13.5px;
    font-weight: 600;
    animation: aparece 0.4s ease both;
}

.reconocido svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.boton {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    margin-top: 16px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #3b8fff, #1a5fb4);
    color: #fff;
    font-size: 16.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(47, 134, 255, 0.35);
    transition: transform 0.15s, opacity 0.25s, box-shadow 0.25s, filter 0.2s;
    overflow: hidden;
}

.boton:hover:not(:disabled) { filter: brightness(1.08); }
.boton:active:not(:disabled) { transform: scale(0.985); }
.boton:disabled { opacity: 0.38; cursor: default; box-shadow: none; }
.boton:focus-visible { outline: 3px solid var(--cian-claro); outline-offset: 2px; }

.boton--entrar { background: linear-gradient(135deg, #22c38e, #047857); box-shadow: 0 10px 28px rgba(16, 185, 129, 0.33); }
.boton--claro { background: rgba(255, 255, 255, 0.08); box-shadow: none; border: 1px solid rgba(148, 190, 255, 0.25); }

.boton--cargando { pointer-events: none; }
.boton--cargando::before {
    content: "";
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2.4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: girar 0.75s linear infinite;
}
.boton--cargando::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.18) 50%, transparent 80%) 0 0 / 250% 100%;
    animation: brillo 1.1s linear infinite;
}

.nota { margin-top: 12px; color: var(--tenue); font-size: 13px; text-align: center; }

/* Lo que va a pasar al pulsar: que se lea bien, no como letra pequeña. */
.instruccion {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.3);
    color: #dbeafe;
    font-size: 14.5px;
    line-height: 1.45;
    transition: background-color 0.3s, border-color 0.3s;
}

.instruccion svg { width: 22px; height: 22px; flex: none; margin-top: 1px; fill: none; stroke: var(--cian-claro); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.instruccion b { color: #fff; font-weight: 700; }
.instruccion__correo { overflow-wrap: anywhere; }
.instruccion--lista { background: rgba(56, 189, 248, 0.12); border-color: rgba(125, 211, 252, 0.5); }

.enlace {
    padding: 8px 2px;
    border: 0;
    background: none;
    color: var(--cian-claro);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.enlace:disabled { color: var(--tenue); text-decoration: none; cursor: default; }
.enlace--centro { display: block; margin: 10px auto 0; }

/* El código va de camino */
.paso--envio { text-align: center; padding: 6px 0 10px; }

.vuelo { position: relative; height: 92px; margin: 4px auto 12px; max-width: 340px; }

.vuelo__punta {
    position: absolute;
    top: 50%;
    width: 54px; height: 54px;
    margin-top: -27px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: #fff;
}

.vuelo__punta svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vuelo__punta--origen { left: 0; background: linear-gradient(140deg, #5cc2ff, #2468e8); box-shadow: 0 10px 26px rgba(47, 134, 255, 0.4); }
.vuelo__punta--destino { right: 0; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(148, 190, 255, 0.3); transition: background 0.4s, border-color 0.4s, box-shadow 0.4s; }

.vuelo__camino {
    position: absolute;
    left: 64px; right: 64px; top: 50%;
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(125, 211, 252, 0.55) 0 7px, transparent 7px 14px);
    background-size: 28px 2px;
    animation: camino 0.6s linear infinite;
}

.vuelo__sobre {
    position: absolute;
    top: 50%;
    left: 64px;
    width: 38px; height: 38px;
    margin-top: -19px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    color: var(--azul-oscuro);
    box-shadow: 0 8px 22px rgba(125, 211, 252, 0.45);
    animation: volar 1.15s cubic-bezier(0.45, 0, 0.3, 1) infinite;
}

.vuelo__sobre svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.vuelo--hecho .vuelo__sobre, .vuelo--hecho .vuelo__camino { animation: none; opacity: 0; transition: opacity 0.25s; }
.vuelo--hecho .vuelo__punta--destino { background: linear-gradient(140deg, #34d399, #047857); border-color: transparent; box-shadow: 0 10px 26px rgba(16, 185, 129, 0.45); animation: salta 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); }

/* La contraseña y el código */
.enviado {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 9px 10px 9px 12px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #d1fae5;
    font-size: 13.5px;
}

.enviado > span { min-width: 0; overflow-wrap: anywhere; }
.enviado svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--verde); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.enviado .enlace { margin-left: auto; padding: 4px 2px; font-size: 13px; flex: none; }

.clave__ver {
    flex: none;
    width: 46px; height: 46px;
    margin-right: 4px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--tenue);
    cursor: pointer;
}

.clave__ver svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.clave__ver[aria-pressed="true"] { color: var(--cian-claro); }

.formulario .aviso + .etiqueta, .clave + .etiqueta, #aviso-password + .etiqueta { margin-top: 16px; }

.cifras {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-width: 300px;
}

.cifras input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px;
    opacity: 0.01;
    cursor: text;
}

.cifra {
    position: relative;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 190, 255, 0.22);
    font: 700 27px/1 "SF Mono", ui-monospace, Consolas, Menlo, monospace;
    color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.cifra--llena { border-color: rgba(125, 211, 252, 0.45); animation: salta 0.3s ease; }
.cifras--foco .cifra--actual { border-color: var(--cian); box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15); }
.cifras--foco .cifra--actual:empty::after {
    content: "";
    width: 2px; height: 26px;
    background: var(--cian-claro);
    animation: cursor 1s step-end infinite;
}

.cifras--bien .cifra { border-color: rgba(52, 211, 153, 0.6); }
.cifras--mal .cifra { border-color: rgba(248, 113, 113, 0.7); animation: sacudir 0.4s; }
.clave--mal { border-color: rgba(248, 113, 113, 0.7); animation: sacudir 0.4s; }

/* Cuando no se puede seguir */
.paso--fin { text-align: center; padding: 6px 0; }
.paso--fin .paso__texto { margin-bottom: 4px; }

.problema {
    display: inline-grid;
    place-items: center;
    width: 56px; height: 56px;
    margin-bottom: 10px;
    border-radius: 18px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fcd34d;
}

.problema svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Ya tiene acceso: quién, cuánto le queda y lo que se ha hecho. */
.dentro { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }

.dentro__escudo {
    flex: none;
    display: grid;
    place-items: center;
    width: 54px; height: 54px;
    border-radius: 17px;
    background: linear-gradient(140deg, #22c38e, #047857);
    box-shadow: 0 10px 26px rgba(16, 185, 129, 0.35);
    color: #fff;
    animation: salta 0.5s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.dentro__escudo svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dentro__quien { min-width: 0; }
.dentro__quien .paso__titulo { margin-bottom: 2px; }
.dentro__correo { color: #c8d6ea; font-size: 14.5px; font-weight: 600; word-break: break-all; }

.tiempo {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.32);
}

.tiempo__fila { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #a7f3d0; font-size: 14px; font-weight: 600; }
.tiempo__fila b { color: #fff; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tiempo__barra { height: 7px; margin: 10px 0 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tiempo__barra span { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #34d399, #7dd3fc); transition: width 0.8s ease; }
.tiempo__hasta { color: #c8d6ea; font-size: 13.5px; }

.hechos { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.hechos li { display: flex; align-items: flex-start; gap: 10px; color: #dbe6f5; font-size: 14px; line-height: 1.4; }

.hechos__marca {
    flex: none;
    width: 18px; height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: rgba(52, 211, 153, 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%2334d399' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
    border: 1px solid rgba(52, 211, 153, 0.5);
}

.paso--dentro .boton { margin-top: 18px; }
.paso--dentro .enlace--centro { width: fit-content; text-align: center; }

/* La mención que pide la licencia de las bases de IP, como el pie de un mapa. */
.credito {
    display: block;
    padding: 0 16px calc(env(safe-area-inset-bottom) + 10px);
    background: rgb(6, 15, 31);
    color: rgba(147, 164, 189, 0.45);
    font-size: 10px;
    text-align: center;
    text-decoration: none;
}

/* ---------- La pantalla final ---------- */

.seguridad {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at 50% 38%, rgba(15, 42, 84, 0.97), rgba(3, 9, 20, 0.985) 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.seguridad--visible { opacity: 1; }

.seguridad__centro { width: 100%; max-width: 400px; text-align: center; }

.escudo { position: relative; width: 136px; height: 136px; margin: 0 auto 20px; }

.escudo__onda {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.5);
    opacity: 0;
    animation: onda 2.4s ease-out infinite;
}

.escudo__onda:nth-child(2) { animation-delay: 0.8s; }
.escudo__onda:nth-child(3) { animation-delay: 1.6s; }

.escudo__dibujo {
    position: relative;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 14px 32px rgba(47, 134, 255, 0.55));
    animation: escudo-entra 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.escudo__borde { stroke-dasharray: 330; stroke-dashoffset: 330; animation: trazo 1.3s 0.15s ease forwards; }
.escudo__arco { transform: translateY(-7px); transition: transform 0.45s cubic-bezier(0.5, 1.8, 0.5, 1); }
.escudo stop { transition: stop-color 0.6s ease; }

.seguridad--cerrado .escudo__arco { transform: translateY(0); }
.seguridad--listo .escudo__onda { border-color: rgba(52, 211, 153, 0.55); }
.seguridad--listo .escudo__dibujo { filter: drop-shadow(0 14px 34px rgba(16, 185, 129, 0.55)); }
.seguridad--listo #escudo-relleno stop:first-child { stop-color: #34d399; }
.seguridad--listo #escudo-relleno stop:last-child { stop-color: #047857; }

.seguridad__titulo { font-size: 22px; font-weight: 750; line-height: 1.25; }

.comprobaciones {
    list-style: none;
    margin: 18px auto 0;
    padding: 0;
    max-width: 330px;
    text-align: left;
}

.comprobaciones li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: var(--tenue);
    opacity: 0.45;
    font-size: 15px;
    transition: opacity 0.3s, color 0.3s;
}

.comprobacion__marca {
    position: relative;
    flex: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(148, 190, 255, 0.35);
}

.comprobaciones li.en-curso { opacity: 1; color: #fff; }
.comprobaciones li.en-curso .comprobacion__marca { border-color: rgba(56, 189, 248, 0.25); border-top-color: var(--cian-claro); animation: girar 0.7s linear infinite; }

.comprobaciones li.hecho { opacity: 1; color: #d1fae5; }
.comprobaciones li.hecho .comprobacion__marca { border: 0; background: var(--verde-oscuro); animation: salta 0.4s cubic-bezier(0.2, 1.5, 0.4, 1); }
.comprobaciones li.hecho .comprobacion__marca::after {
    content: "";
    position: absolute;
    left: 7px; top: 3.5px;
    width: 6px; height: 11px;
    border: solid #fff;
    border-width: 0 2.4px 2.4px 0;
    transform: rotate(45deg);
}

.comprobaciones li.aviso-c { opacity: 1; color: #fde68a; }
.comprobaciones li.aviso-c .comprobacion__marca { border-color: #fbbf24; }

.seguridad__pie { margin-top: 16px; min-height: 2.9em; color: #c8d6ea; font-size: 14.5px; }
.seguridad__pie b { color: #fff; }
.seguridad__pie .alerta { display: block; margin-top: 10px; color: #fde68a; font-size: 13.5px; }
/* Si no llega a GB Online: con los datos del móvil puede no funcionar, que pruebe con wifi. */
.seguridad__pie .pista-wifi {
    display: block;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(125, 211, 252, 0.4);
    color: #e0f2fe;
    font-size: 14px;
    line-height: 1.45;
}
.seguridad__boton { margin-top: 18px; }

.sin-js { position: fixed; inset: auto 16px 16px; z-index: 60; padding: 14px; border-radius: 12px; background: #7f1d1d; color: #fff; text-align: center; }

/* ---------- Ordenador ---------- */

@media (min-width: 900px) {
    .escena {
        position: fixed;
        inset: 0;
        height: auto;
        min-height: 0;
        max-height: none;
        background:
            radial-gradient(1000px 640px at calc(50% - var(--panel) / 2) 58%, rgba(31, 84, 160, 0.42), transparent 70%),
            radial-gradient(1600px 1000px at 40% 45%, #0b1f3d 0%, #071328 55%, var(--fondo) 100%);
    }

    .escena::after { display: none; }

    .escena__estado { left: 32px; bottom: 28px; transform: none; }

    .credito { position: fixed; right: 30px; bottom: 5px; z-index: 3; padding: 0; background: none; }

    .cabecera { position: fixed; left: 28px; top: 24px; right: auto; padding: 0; gap: 12px; }
    .cabecera__emblema { width: 44px; }
    .cabecera__nombre { font-size: 19px; }
    .cabecera__cifrado { margin-left: 14px; }

    .panel {
        position: fixed;
        top: 50%;
        right: 28px;
        width: var(--panel);
        max-height: calc(100vh - 48px);
        overflow-y: auto;
        margin: 0;
        padding: 22px 22px 18px;
        border-radius: 24px;
        border: 1px solid rgba(148, 190, 255, 0.16);
        background: rgba(8, 20, 40, 0.8);
        backdrop-filter: blur(18px) saturate(140%);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
        box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
        min-height: 0;
        transform: translateY(-50%);
        scrollbar-width: thin;
    }
}

@media (min-width: 900px) and (max-height: 700px) {
    .dato { min-height: 52px; padding: 7px 10px; }
    .pasos { margin-top: 14px; }
}

/* En el móvil, los datos más recogidos: así el paso y su botón caben sin bajar. */
@media (max-width: 899px) {
    .deteccion { gap: 6px; }
    .dato { min-height: 50px; padding: 6px 8px; gap: 9px; }
    .dato--ancho { min-height: 46px; }
    .dato__icono { width: 34px; height: 34px; border-radius: 10px; }
    .dato__icono svg { width: 18px; height: 18px; }
    .dato--logo .dato__icono { padding: 5px; }
    .dato__titulo { font-size: 10px; }
    .dato__valor { margin-top: 1px; font-size: 14px; }
    .dato__detalle { font-size: 11.5px; }
    .dato--ip .dato__valor { font-size: 15px; }
    .pasos { margin-top: 14px; }
    .marca__caja { padding: 4px 9px 4px 4px; gap: 6px; border-radius: 10px; }
    .marca__icono { width: 24px; height: 24px; border-radius: 7px; }
    .marca__icono svg { width: 15px; height: 15px; }
    .marca__textos b { font-size: 12px; }
    .marca__textos small { font-size: 9px; }
}

@media (max-width: 370px) {
    .correo__dominio { font-size: 12.5px; padding: 0 7px; }
    .dato__valor { font-size: 13.5px; }
    .dato__icono { width: 34px; height: 34px; }
    .cabecera__cifrado span { display: none; }
}

/* ---------- Movimientos ---------- */

@keyframes latir { 0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(56, 189, 248, 0); } }
@keyframes latir-verde { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes aparece { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes entra { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes salta { 0% { transform: scale(0.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes trazo { to { stroke-dashoffset: 0; } }
@keyframes cursor { 50% { opacity: 0; } }
@keyframes sacudir { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes camino { to { background-position: 28px 0; } }
@keyframes volar {
    0% { left: 64px; opacity: 0; transform: translateY(0) scale(0.7) rotate(-8deg); }
    15% { opacity: 1; }
    50% { transform: translateY(-16px) scale(1) rotate(0deg); }
    85% { opacity: 1; }
    100% { left: calc(100% - 102px); opacity: 0; transform: translateY(0) scale(0.75) rotate(8deg); }
}
@keyframes onda { 0% { transform: scale(0.85); opacity: 0.85; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes escudo-entra { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes marca-entra { from { opacity: 0; margin-top: 10px; } to { opacity: 1; margin-top: 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ---------- Móvil: el teclado ---------- */

@media (max-width: 899px) {
    /* Con el teclado abierto (en el iPhone tapa la parte de abajo sin mover la página): sitio
       debajo para poder subir lo que se está escribiendo. Lo pone portada.js. */
    .panel { padding-bottom: calc(env(safe-area-inset-bottom) + 16px + var(--teclado, 0px)); }
}
