/*
ESTE SOLO ES UN DISEÑO QUE TENIA ANTERIOR MENTE LOS GUARDO PORQUE QUIERO HACER CAMBIOS YA QUE A MIS COMPAÑEROS NOS LES GUSTO MI SISTEMA Y LO DEBO DE HACER MAS SIMPLE Y INTERCATIVO 
*/

:root {
    --morado_principal: #6a11cb;
    --morado_secundario: #8f94fb;
    --azul_principal: #2575fc;
    --blanco_puro: #ffffff;

    --rojo_peligro: #ff3333;

    --fondo_cristal: rgba(255, 255, 255, 0.1);
    --borde_cristal: rgba(255, 255, 255, 0.2);

    --borde_focus: rgba(255, 255, 255, 0.9);
    --sombra_suave: 0 10px 20px rgba(0,0,0,0.15);
    --sombra_fuerte: 0 15px 25px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(-45deg, var(--morado_principal), var(--morado_secundario), var(--azul_principal), #4a00e0);
    background-size: 400% 400%;
    animation: fondo_animado 15s ease infinite;
    color: var(--blanco_puro);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

@keyframes fondo_animado {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/*
  un fondo decorativo para que se vea muy bien 
*/
#animacion_fondo {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
}

#animacion_fondo ul { width: 100%; height: 100%; position: relative; list-style: none; }

#animacion_fondo li {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.1);
    animation: animar_iconos 25s linear infinite;
    bottom: -150px;
}

#animacion_fondo li:nth-child(1) { left: 15%; font-size: 80px; animation-delay: 0s; }
#animacion_fondo li:nth-child(2) { left: 85%; font-size: 40px; animation-delay: 2s; animation-duration: 12s; }
#animacion_fondo li:nth-child(3) { left: 50%; font-size: 60px; animation-delay: 4s; }
#animacion_fondo li:nth-child(4) { left: 25%; font-size: 100px; animation-delay: 0s; animation-duration: 18s; }

@keyframes animar_iconos {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(-1200px) rotate(720deg); opacity: 0; }
}

/*
  un contenedor de cristal 
*/
#contenedor_app {
    width: 100%;
    max-width: 450px;
    min-height: 100vh;
    z-index: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 1px solid var(--borde_cristal);
    border-right: 1px solid var(--borde_cristal);
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0,0,0,0.2);
}

/*
  una barra superior
*/
#barra_superior {
    padding: 18px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: rgba(106, 17, 203, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
    border-bottom: 1px solid var(--borde_cristal);
}

#btn_regresar {
    background: transparent;
    border: none;
    color: var(--blanco_puro);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
    padding: 8px 10px;
    border-radius: 12px;
    visibility: hidden;
    opacity: 0.95;
}

#btn_regresar:hover { transform: scale(1.06); background: rgba(255,255,255,0.08); opacity: 1; }
#btn_regresar:focus-visible { outline: 3px solid var(--borde_focus); outline-offset: 3px; }
#btn_regresar:active { transform: scale(0.98); }

#indicador_paso { font-weight: 800; letter-spacing: 1px; font-size: 0.9rem; }

#btn_cerrar {
    color: var(--blanco_puro);
    font-size: 1.35rem;
    text-decoration: none;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
    padding: 8px 10px;
    border-radius: 12px;
    opacity: 0.95;
}

#btn_cerrar:hover { transform: scale(1.06); background: rgba(255,255,255,0.08); opacity: 1; }
#btn_cerrar:focus-visible { outline: 3px solid var(--borde_focus); outline-offset: 3px; }
#btn_cerrar:active { transform: scale(0.98); }

/*
  el logo
*/
#caja_logo_registro { text-align: center; margin-top: 12px; }
#imagen_logo_registro { width: 44px; height: 44px; opacity: 0.85; }

/*
  nuestro formulario y los pasos
*/
#formulario_principal {
    flex: 1;
    padding: 18px 18px 24px 18px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Fieldsets: sólo uno visible por data_activo */
fieldset { border: none; display: none; }
fieldset[data_activo="verdadero"] { display: block; }

/* Animaciones direccionales inyectadas por JS */
fieldset[data_animacion="derecha"] { animation: deslizar_derecha 0.4s ease forwards; }
fieldset[data_animacion="izquierda"] { animation: deslizar_izquierda 0.4s ease forwards; }

@keyframes deslizar_derecha {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes deslizar_izquierda {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Títulos */
h2 { font-size: 1.8rem; font-weight: 900; margin-bottom: 6px; text-transform: uppercase; }
h2 + p { font-size: 0.92rem; opacity: 0.82; margin-bottom: 18px; }

/* Inputs */
#formulario_principal input[type="text"],
#formulario_principal input[type="email"],
#formulario_principal input[type="password"],
#formulario_principal input[type="number"],
#formulario_principal input[type="date"],
#formulario_principal select {
    width: 100%;
    background: var(--fondo_cristal);
    border: 1px solid var(--borde_cristal);
    color: var(--blanco_puro);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
}

#formulario_principal input::placeholder { color: rgba(255,255,255,0.6); }

#formulario_principal input:focus,
#formulario_principal select:focus {
    background: rgba(255,255,255,0.2);
    border-color: var(--blanco_puro);
    box-shadow: 0 0 15px rgba(255,255,255,0.18);
    outline: none;
    transform: translateY(-1px);
}

#formulario_principal select option { color: #333; }

#formulario_principal label {
    display: block;
    margin-left: 8px;
    margin-bottom: 6px;
    font-size: 0.86rem;
    opacity: 0.95;
}

/* Caja inputs dobles */
#caja_medidas_dobles,
#caja_fecha_cvc {
    display: flex;
    gap: 14px;
    width: 100%;
}
#caja_medidas_dobles input,
#caja_fecha_cvc input {
    flex: 1;
}

/*
   Tarjetas de prugustas
*/
#pregunta_cuerpo,
#pregunta_meta,
#pregunta_lugar,
#pregunta_plan,
#pregunta_credenciales {
    margin: 10px 0 10px 8px;
    font-weight: 900;
    font-size: 0.9rem;
    opacity: 0.95;
}

/* ocultar radio */
label input[type="radio"] { display: none; }

/* tarjeta base */
label[id^="etiqueta_"] > div[id^="tarjeta_"] {
    background: var(--fondo_cristal);
    border: 2px solid var(--borde_cristal);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, border-color 0.22s ease;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

/* hover */
label[id^="etiqueta_"] > div[id^="tarjeta_"]:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

/* checked */
label input[type="radio"]:checked + div[id^="tarjeta_"] {
    background: rgba(255,255,255,0.3);
    border-color: var(--blanco_puro);
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 10px 22px rgba(0,0,0,0.16);
}

/* focus visible del label */
label:has(input[type="radio"]:focus-visible) > div[id^="tarjeta_"] {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
}

/* icono y texto */
div[id^="icono_"] { font-size: 1.5rem; margin-right: 15px; width: 30px; text-align: center; }
div[id^="texto_"] h5 { margin: 0; font-size: 1rem; font-weight: 900; }
div[id^="texto_"] p { margin: 0; font-size: 0.82rem; opacity: 0.82; }

/* NO MERCY estilo */
#tarjeta_extrema { border-color: rgba(255, 51, 51, 0.5); }
#radio_sin_piedad:checked + #tarjeta_extrema {
    background: rgba(255, 51, 51, 0.2);
    border-color: var(--rojo_peligro);
    box-shadow: 0 0 22px rgba(255, 51, 51, 0.4);
}
#icono_extremo i, #tit_extremo { color: var(--rojo_peligro); }
#desc_extremo { color: #ffb3b3; opacity: 1; }

/* plan pro estilo */
#tarjeta_pro { border-color: #ffd700; }
#icono_pro i, #tit_pro { color: #ffd700; }

/*
  7) Botones
*/
button[id^="btn_siguiente_"],
#btn_enviar_final {
    margin-top: 16px;
    margin-bottom: 10px;
    width: 100%;
    border-radius: 50px;
    padding: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
    border: none;
    cursor: pointer;
    background: var(--blanco_puro);
    color: var(--morado_principal);
    box-shadow: var(--sombra_suave);
    font-family: inherit;
}

button[id^="btn_siguiente_"]:hover,
#btn_enviar_final:hover {
    transform: translateY(-3px);
    box-shadow: var(--sombra_fuerte);
    background-color: #f8f9fa;
}

button[id^="btn_siguiente_"]:focus-visible,
#btn_enviar_final:focus-visible,
#btn_escanear:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
}

button[id^="btn_siguiente_"]:active,
#btn_enviar_final:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

/* escáner */
#btn_escanear {
    width: 100%;
    border-radius: 50px;
    padding: 15px;
    font-weight: 900;
    cursor: pointer;
    background: linear-gradient(45deg, #00c6ff, #0072ff);
    color: white;
    border: none;
    margin-bottom: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    font-family: inherit;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

#btn_escanear:hover { transform: translateY(-2px); box-shadow: 0 15px 28px rgba(0,0,0,0.18); }
#btn_escanear:active { transform: translateY(0); }

#separador_manual { text-align: center; margin: 14px 0; opacity: 0.78; font-size: 0.88rem; }

/* loader */
#caja_carga_escaneo {
    display: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
#caja_carga_escaneo::after {
    content: '';
    position: absolute;
    left: -50%;
    top: 0;
    height: 100%;
    width: 50%;
    background: #00c6ff;
    animation: escaneo 1s linear infinite;
    box-shadow: 0 0 10px #00c6ff;
}
@keyframes escaneo { 100% { left: 100%; } }

#texto_escaneo {
    display: none;
    text-align: center;
    font-size: 0.86rem;
    margin-top: 8px;
    color: #00c6ff;
    font-weight: 900;
}

/*
  8) Pagos + términos
*/
#caja_pagos_oculta {
    display: none;
    animation: aparecer_pago 0.35s ease forwards;
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 15px;
    margin-top: 14px;
    margin-bottom: 16px;
}

@keyframes aparecer_pago {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

#titulo_pagos { margin-bottom: 12px; font-size: 1rem; font-weight: 900; }

#separador_final {
    border: 0;
    border-top: 1px solid var(--borde_cristal);
    margin: 18px 0;
}

#caja_terminos {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 16px 8px;
    font-size: 0.86rem;
}

#casilla_terminos {
    width: 18px;
    height: 18px;
    accent-color: var(--azul_principal);
}

#casilla_terminos:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
    border-radius: 6px;
}

#mensaje_estado {
    margin-top: 10px;
    min-height: 18px;
    font-size: 0.9rem;
    opacity: 0.92;
}

/*
  9) Enlaces del sitio (evaluador) - discreto
*/
#enlaces_sitio {
    padding: 10px 18px 22px 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    opacity: 0.9;
}

#enlaces_sitio a {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.22);
    padding: 7px 12px;
    border-radius: 999px;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

#enlaces_sitio a:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.35);
    transform: translateY(-2px);
}

#enlaces_sitio a:focus-visible {
    outline: 3px solid var(--borde_focus);
    outline-offset: 4px;
}

/*
  10) Modal (dialog) NO MERCY
*/
#modal_advertencia_extrema {
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 20px;
    background: transparent;
    max-width: 420px;
    width: 92%;
    z-index: 100;
}

#modal_advertencia_extrema::backdrop {
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(5px);
}

#contenido_advertencia {
    background: #1a1a1a;
    color: white;
    border: 2px solid var(--rojo_peligro);
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.3);
    padding: 22px;
    text-align: center;
}

#titulo_peligro { color: var(--rojo_peligro); font-size: 1.15rem; margin-bottom: 14px; font-weight: 900; }
#icono_peligro_gigante { font-size: 4rem; color: var(--rojo_peligro); display: block; margin-bottom: 10px; }
#texto_peligro_principal { font-size: 1.15rem; margin-bottom: 10px; font-weight: 900; }
#texto_peligro_secundario { font-size: 0.88rem; opacity: 0.75; margin-bottom: 18px; }

#caja_botones_peligro { display: flex; flex-direction: column; gap: 10px; }

#btn_aceptar_peligro,
#btn_rechazar_peligro {
    width: 100%;
    padding: 12px;
    border-radius: 50px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.22s ease, opacity 0.22s ease, background-color 0.22s ease;
    font-family: inherit;
}

#btn_aceptar_peligro { background: var(--rojo_peligro); color: white; border: none; }
#btn_aceptar_peligro:hover { transform: translateY(-2px); }
#btn_aceptar_peligro:active { transform: translateY(0); }

#btn_rechazar_peligro { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.5); }
#btn_rechazar_peligro:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); }
#btn_rechazar_peligro:active { transform: translateY(0); }

#btn_aceptar_peligro:focus-visible,
#btn_rechazar_peligro:focus-visible {
    outline: 3px solid rgba(255,255,255,0.85);
    outline-offset: 4px;
}

/*
  11) Breakpoints extra
*/
@media (max-width: 360px) {
    #formulario_principal { padding: 16px 14px 20px 14px; }
    h2 { font-size: 1.6rem; }
}

@media (max-width: 640px) {
    #contenedor_app { max-width: 480px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #contenedor_app { max-width: 520px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
    #animacion_fondo li { animation: none; opacity: 0.12; }
    fieldset[data_animacion="derecha"],
    fieldset[data_animacion="izquierda"] { animation: none; }
    #caja_pagos_oculta { animation: none; }
}