@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    /* MODO CLARO */
    --bg: #ecf4f9;
    --accent: #17c3a5;
    --accent-glow: rgba(23, 195, 165, 0.3);
    --card: rgba(255, 255, 255, 0.85);
    --border: rgba(255, 255, 255, 0.5);
    --text: #1a202c;
    --icon-op: 0.35;
    --illu-bg: rgba(255, 255, 255, 0.3);
    --title-gradient: linear-gradient(135deg, #0f1c4d 0%, #2563eb 100%);
}

body.dark-mode {
    /* MODO OSCURO */
    --bg: #0a0f1a;
    --card: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --icon-op: 0.2;
    --illu-bg: rgba(255, 255, 255, 0.03);
    --title-gradient: linear-gradient(to bottom, #ffffff, #ffffff);
}

/* 1. BLOQUEO DE ESTRUCTURA (EVITA SALTOS) */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden !important; /* Prohibido el scroll */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    align-items: center;      /* Centro vertical */
    justify-content: center;   /* Centro horizontal */
    background-color: var(--bg);
    position: relative;
    /* Sin transiciones en el body para evitar que la tarjeta "viaje" al cargar */
}

/* 2. ICONOS DE FONDO (AISLADOS COMPLETAMENTE) */
.pos-bg-icons {
    position: fixed; /* Se queda pegado al fondo, no afecta a la tarjeta */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Detr��s de todo */
    pointer-events: none;
    overflow: hidden;
}

.pos-bg-icons i {
    position: absolute;
    color: var(--accent);
    opacity: var(--icon-op);
    animation: floatAnim 20s infinite linear;
    bottom: -150px;
    will-change: transform;
}

/* Distribuci��n de iconos */
.pos-bg-icons i:nth-child(1) { left: 5%; font-size: 3rem; animation-duration: 15s; }
.pos-bg-icons i:nth-child(2) { left: 15%; font-size: 2rem; animation-delay: 2s; }
.pos-bg-icons i:nth-child(3) { left: 25%; font-size: 4rem; animation-delay: 4s; }
.pos-bg-icons i:nth-child(4) { left: 35%; font-size: 2.5rem; animation-delay: 1s; }
.pos-bg-icons i:nth-child(5) { left: 45%; font-size: 3.5rem; animation-delay: 6s; }
.pos-bg-icons i:nth-child(6) { left: 55%; font-size: 2.2rem; animation-delay: 3s; }
.pos-bg-icons i:nth-child(7) { left: 65%; font-size: 3.8rem; animation-delay: 8s; }
.pos-bg-icons i:nth-child(8) { left: 75%; font-size: 2.8rem; animation-delay: 5s; }
.pos-bg-icons i:nth-child(9) { left: 85%; font-size: 3.2rem; animation-delay: 2s; }
.pos-bg-icons i:nth-child(10) { left: 95%; font-size: 2.5rem; animation-delay: 7s; }

@keyframes floatAnim {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: var(--icon-op); }
    90% { opacity: var(--icon-op); }
    100% { transform: translateY(-130vh) rotate(360deg); opacity: 0; }
}

/* 3. TARJETA PRINCIPAL (EST�0�9TICA) */
.login-container {
    display: flex;
    width: 90%;
    max-width: 950px;
    height: 600px;
    background: var(--card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 35px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.1);
    z-index: 10;
    overflow: hidden;
    position: relative;
    /* Aparece con un fundido simple, sin moverse de posici��n */
    animation: fadeInStatic 0.4s ease-in forwards;
}

@keyframes fadeInStatic {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-illustration {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--illu-bg);
}

.floating-logo {
    width: 65%;
    z-index: 5;
    animation: float 6s ease-in-out infinite;
}

.glow-bg {
    position: absolute;
    width: 250px; height: 250px;
    background: var(--accent);
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.3;
}

.login-box {
    flex: 1.2; padding: 4rem;
    display: flex; flex-direction: column; justify-content: center;
}

.text-center { text-align: center; margin-bottom: 2rem; width: 100%; }

.login-title {
    font-size: 2.2rem; font-weight: 700;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}
.login-title .pos-highlight {
    color: #17c3a5 !important;
    -webkit-text-fill-color: initial !important; /* ESTO CANCELA LA TRANSPARENCIA */
    font-weight: 800;
}

.login-subtitle {
    color: var(--accent); text-transform: uppercase;
    letter-spacing: 4px; font-size: 0.8rem; font-weight: 600;
}

/* 4. FORMULARIO E INPUTS */
.input-group { position: relative; margin-bottom: 1.2rem; }

.login-form input {
    width: 100%; height: 56px; padding: 0 55px;
    border-radius: 16px; border: 1px solid var(--border);
    background: rgba(0,0,0,0.02); color: var(--text); 
    outline: none; font-size: 1rem; transition: 0.3s ease;
}

body.dark-mode .login-form input { background: rgba(255,255,255,0.05); }

.input-icon {
    position: absolute; left: 20px; top: 50%;
    transform: translateY(-50%); color: var(--accent); font-size: 1.3rem;
}

.password-toggle-btn {
    position: absolute; right: 0; top: 0;
    height: 56px; width: 55px; display: flex;
    align-items: center; justify-content: center;
    cursor: pointer; color: var(--accent);
}

.signin-btn {
    width: 100%; padding: 18px; border: none; border-radius: 16px;
    background: var(--accent); color: white; font-weight: 700;
    text-transform: uppercase; cursor: pointer; transition: 0.3s ease;
    box-shadow: 0 10px 20px var(--accent-glow); margin-top: 10px;
}

.signin-btn:hover { transform: translateY(-2px); box-shadow: 0 15px 30px var(--accent-glow); }

.theme-switch {
    position: fixed; top: 20px; right: 20px;
    width: 45px; height: 45px; background: var(--card);
    border: 1px solid var(--border); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--accent); z-index: 100;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* 5. RESPONSIVO CELULAR (FIJO AL CENTRO) */
@media (max-width: 850px) {
    body {
        padding: 10px;
        align-items: center !important;
        justify-content: center !important;
    }

    .login-container {
        flex-direction: column;
        width: 100%;
        max-width: 380px;
        height: auto;
        border-radius: 30px;
        margin: 0 !important; /* Cero margen para que el flex lo centre */
        position: relative !important;
        top: 0 !important; /* Se asegura de no estar arriba */
        transform: none !important;
    }

    .login-illustration { height: 120px; padding-top: 20px; background: transparent; }
    .floating-logo { width: 90px; }
    .glow-bg { width: 120px; height: 120px; filter: blur(40px); }
    .login-box { padding: 2.5rem 1.8rem; }
    .login-title { font-size: 1.8rem; }
    .login-subtitle { margin-bottom: 1.5rem; }
}

/* ALERTAS BASE */
.alert-container {
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

/* ERROR */
.alert-container.error {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid #ff4757;
    color: #ff4757;
}

.alert-container.error i{
    color: #ff4757;
}

/* SUCCESS */
.alert-container.success {
    background: rgba(34,197,94,0.12);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.alert-container.success i{
    color: #22c55e;
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    margin-top: 12px;
    padding: 12px 18px;

    background: rgba(23, 195, 165, 0.08);
    color: #17c3a5;

    border: 1px solid rgba(23, 195, 165, 0.25);
    border-radius: 14px;

    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition: all 0.25s ease;

    width: fit-content;
    max-width: 100%;
}

.btn-whatsapp i {
    font-size: 1.1rem;
    opacity: 0.9;
}

.btn-whatsapp:hover {
    background: rgba(23, 195, 165, 0.15);
    border-color: rgba(23, 195, 165, 0.5);
    color: #1ddbb8;

    transform: translateY(-1px);
}

.whatsapp-container {
    display: flex;
    justify-content: center;
    margin-top: 3px;
    margin-bottom: 18px; 
}

.alert-container.text-center {
    text-align: center;
    justify-content: center;
}

@media (max-width: 850px) {
    .btn-whatsapp {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        border-radius: 16px;
    }
}

.password-rules{
margin-top:10px;
font-size:12px;
color:#94a3b8;
}

.password-valid{
color:#22c55e;
}

.password-invalid{
color:#ef4444;
}

/* =========================
   MODAL ALERTAS
========================= */

.modal{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(0,0,0,0.6);
display:flex;
align-items:center;
justify-content:center;
z-index:9999;
opacity:0;
pointer-events:none;
transition:.3s;
}

.modal.activo{
opacity:1;
pointer-events:auto;
}

.glass-modal{
background:rgba(15,23,42,.9);
backdrop-filter:blur(20px);
padding:25px;
border-radius:16px;
width:90%;
max-width:400px;
color:white;
box-shadow:0 20px 50px rgba(0,0,0,.5);
}

.modal-buttons{
margin-top:20px;
display:flex;
justify-content:center;
gap:10px;
}

.btn-primary{
background:#17c3a5;
border:none;
padding:10px 20px;
border-radius:8px;
color:white;
cursor:pointer;
}

.btn-secondary{
background:#334155;
border:none;
padding:10px 20px;
border-radius:8px;
color:white;
cursor:pointer;
}

.alert-form{
margin-top: 14px;
margin-bottom: 10px;
}
/* Separación alerta contraseña */
#alertaPassword{
margin-top: 12px;
margin-bottom: 8px;
}

/* Mejor separación entre inputs */
.login-form .input-group{
margin-bottom: 16px;
}


.alert-success{
background: rgba(34, 197, 94, 0.1);
border: 1px solid #22c55e;
padding: 12px;
border-radius: 12px;
margin-bottom: 5px;

display: flex;
align-items: center;
gap: 10px;
font-size: 0.9rem;

color: #22c55e !important;
}

.alert-success span{
color:#22c55e !important;
}

.alert-success i{
color:#22c55e !important;
}

.forgot-password{
margin-top: 15px;
text-align: center;
}

/* Busca .forgot-password al final de tu archivo y cámbialo por esto: */

.forgot-password {
    margin-top: 15px;
    text-align: center;
}

.forgot-password a {
    color: var(--accent); /* Usa el verde turquesa de tu marca */
    text-decoration: none; /* Quita el subrayado feo */
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.forgot-password a:hover {
    color: var(--text); /* Cambia al color de texto principal (blanco en dark mode) */
    text-decoration: underline; /* Se subraya solo cuando pasas el mouse */
    opacity: 0.8;
}

/* ================= PLANES ================= */

.planes-grid{
display:grid;
grid-template-columns:repeat(2,1fr);
gap:20px;
margin-top:25px;
align-items:stretch;
}
.plan-card{
background:var(--card-bg);
padding:25px;
border-radius:16px;
text-align:center;
position:relative;
border:1px solid var(--border-color);
transition:.3s;
display:flex;
flex-direction:column;
justify-content:flex-start;
height:auto;
}

.plan-card:hover{
transform:translateY(-3px);
box-shadow:0 10px 25px rgba(0,0,0,.08);
}

.plan-card.featured{
border:2px solid #3381DF;
}

.plan-badge{
position:absolute;
top:-12px;
right:20px;
background:#3381DF;
color:white;
padding:6px 14px;
border-radius:20px;
font-size:12px;
font-weight:600;
}

.plan-card h2{
margin-bottom:5px;
}

.plan-price{
font-size:34px;
font-weight:700;
margin:15px 0;
}

.plan-price span{
font-size:14px;
opacity:.7;
font-weight:400;
}

.plan-features{
list-style:none;
padding:0;
margin:15px 0 20px;
text-align:left;
flex-grow:1;
}

.plan-features li{
margin:10px 0;
display:flex;
align-items:center;
gap:8px;
word-break:break-word;
}

.plan-features i{
color:#3381DF;
}

.plan-card .signin-btn{
margin-top:auto;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 900px){

.planes-grid{
grid-template-columns:1fr;
gap:18px;
}

.plan-card{
width:100%;
}

}

@media (max-width: 600px){

.login-box{
padding:20px;
}

.plan-card{
padding:20px;
}

.plan-price{
font-size:28px;
}

.plan-features li{
font-size:14px;
}

}

/* MODO OSCURO PLANES */

.dark-mode .plan-card{
color:#fff;
}

.dark-mode .plan-card h2{
color:#fff;
}

.dark-mode .plan-features li{
color:#fff;
}

.dark-mode .plan-price{
color:#fff;
}

@media (max-width:768px){

.planes-grid{
grid-template-columns:1fr;
gap:15px;
}

.plan-card{
width:100%;
}

}


/* ARREGLO PARA MÓVIL: OLVIDASTE CONTRASEÑA */
.forgot-password a {
    color: var(--accent) !important; /* Fuerza el color verde turquesa */
    text-decoration: none !important; /* Quita el subrayado azul */
    -webkit-text-decoration: none !important; /* Refuerzo para Safari/iPhone */
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block; /* Mejora el área de clic en móvil */
}

/* Para que cuando lo toquen con el dedo no se ponga azul tampoco */
.forgot-password a:visited, 
.forgot-password a:active, 
.forgot-password a:focus {
    color: var(--accent) !important;
    text-decoration: none !important;
}

.forgot-password a:hover {
    color: var(--text) !important; /* O el color que quieras al pasar el mouse */
    text-decoration: underline !important;
}

