@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=DM+Sans:wght@300;400;500;700&display=swap');

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

:root {
    --azul-profundo: #071628;
    --azul-medio:    #1a3a6b;
    --azul-acento:   #1e6eb5;
    --azul-claro:    #4a9fd4;
    --blanco:        #ffffff;
    --gris-suave:    #f8fafc; /* Ligeramente más claro para mayor contraste */
    --gris-texto:    #64748b;
    --error:         #ef4444; /* Rojo de error más moderno y vibrante */
}

html, body {
    height: 100%;
    font-family: 'DM Sans', sans-serif;
    background: var(--azul-profundo);
    -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT PRINCIPAL ── */
.layout {
    display: flex;
    min-height: 100dvh; /* dvh evita problemas con las barras de navegación móviles */
}

/* ══════════════════════════════════════
   LADO IZQUIERDO — video + bienvenida
══════════════════════════════════════ */
.lado-video {
    flex: 1.2; /* Toma un poco más de espacio visual que el formulario */
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(32px, 5vw, 64px);
    min-height: 100dvh;
}

/* Overlay degradado sobre el video con desenfoque */
/* Overlay degradado sobre el video */
.lado-video::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(7,22,40,0.3) 0%,
        rgba(7,22,40,0.7) 60%,
        rgba(7,22,40,0.95) 100%
    );
    /* ELIMINAMOS la línea de backdrop-filter para quitar el efecto borroso */
    z-index: 1;
}

/* ── VIDEO ── */
.video-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.video-wrap iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, calc(100vh * 16 / 9));
    height: max(100%, calc(100vw * 9 / 16));
    transform: translate(-50%, -50%);
    border: none;
}

/* ── CONTENIDO SOBRE EL VIDEO ── */
.contenido-video {
    position: relative;
    z-index: 2;
    color: var(--blanco);
    max-width: 600px;
}

.bienvenida-tag {
    font-size: clamp(10px, 1vw, 12px);
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--azul-claro);
    margin-bottom: 12px;
}

.linea-acento {
    width: 48px;
    height: 4px;
    background: var(--azul-claro);
    border-radius: 4px;
    margin-bottom: 20px;
}

.bienvenida-titulo {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 16px;
}

.bienvenida-subtitulo {
    font-size: clamp(14px, 1.2vw, 16px);
    font-weight: 300;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
}

/* ══════════════════════════════════════
   LADO DERECHO — formulario
══════════════════════════════════════ */
.lado-form {
    width: clamp(340px, 35vw, 480px); /* Ligeramente más ancho  */
    flex-shrink: 0;
    background: var(--blanco);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px) clamp(24px, 3.5vw, 48px);
    position: relative;
    box-shadow: -20px 0 60px rgba(7,22,40,0.4);
    overflow-y: auto;
}

.contenedor-logos {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(16px, 3vh, 32px);
}

/* Logo principal */
.logo-principal {
    height: clamp(60px, 5vh, 60px);
    object-fit: contain;
}

/* Logo secundario */
.logo-secundario {
    height: 52px;
    object-fit: contain;
    margin-left: 16px;
}


/* 🔥 RESPONSIVE (AQUÍ ESTÁ LO PRO) */
@media (max-width: 480px) {

    .contenedor-logos {
        flex-direction: column;      /* los pone uno debajo del otro */
        align-items: flex-start;     /* alineados a la izquierda */
        gap: 8px;
    }

    .logo-principal {
        height: 50px;
    }

    .logo-secundario {
        height: 32px;
        margin-left: 0;              
        opacity: 0.85;               
    }
}

/* Franja azul lateral simplificada */
.lado-form::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: var(--azul-acento);
}

.form-logo {
    display: block;
    height: clamp(60px, 5vh, 60px);
    object-fit: contain;
    object-position: left center;
    margin-bottom: clamp(16px, 3vh, 32px);
}

.form-titulo {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(20px, 2vw, 25px);
    font-weight: 700;
    color: var(--azul-profundo);
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.form-subtitulo {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--gris-texto);
    font-weight: 400;
    margin-bottom: clamp(24px, 3vh, 32px);
    line-height: 1.5;
}

/* Alertas de Error */
.alerta-error {
    background: #fef2f2;
    border-left: 4px solid var(--error);
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 13.5px;
    color: var(--error);
    line-height: 1.5;
}

/* Campos de Formulario */
.campo { margin-bottom: 20px; }

.campo label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--azul-profundo);
    margin-bottom: 8px;
}

.campo input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: var(--azul-profundo);
    background: var(--gris-suave);
    transition: all 0.3s ease;
    outline: none;
}

.campo input:focus {
    border-color: var(--azul-acento);
    background: var(--blanco);
    box-shadow: 0 0 0 4px rgba(30,110,181,0.1);
}

.campo input.error-input { border-color: var(--error); }

.msg-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 6px;
    font-weight: 500;
}

/* Botón Principal */
.btn-ingresar {
    width: 100%;
    padding: 14px;
    background: var(--azul-acento);
    color: var(--blanco);
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.btn-ingresar:hover {
    background: var(--azul-medio);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 58, 107, 0.25);
}

.btn-ingresar:active { 
    transform: translateY(0); 
    box-shadow: none; 
}

/* Nota de ayuda */
.nota {
    margin-top: 28px;
    padding: 16px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    color: var(--gris-texto);
    line-height: 1.6;
    border: 1px solid #e2e8f0;
}

.nota strong { 
    color: var(--azul-profundo); 
    font-weight: 600; 
}

/* Pie de página */
.pie-form {
    margin-top: auto; /* Empuja el footer hacia abajo si hay espacio extra */
    padding-top: 32px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.5;
}

/* ══════════════════════════════════════
   RESPONSIVO — tablet y móvil
══════════════════════════════════════ */

/* Tablet y Móvil */
@media (max-width: 900px) {
    .lado-video { display: none; }

    .layout {
        justify-content: center;
        align-items: center;
        background: linear-gradient(135deg, var(--azul-profundo) 0%, var(--azul-medio) 100%);
        padding: 24px;
    }

    .lado-form {
        width: 100%;
        max-width: 440px;
        min-height: auto; /* Permite que el formulario sea una tarjeta */
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.3);
        padding: 40px 32px;
    }

    .lado-form::before { display: none; }
}

@media (max-width: 480px) {
    .layout {
        padding: 16px;
    }

    .lado-form {
        padding: 32px 24px;
        border-radius: 12px;
    }

    .form-logo {
        height: 36px;
    }
}