/* ============================================ */
/* RESET & BASE - ESTILO PREMIUM RENOVADO */
/* NUEVO DISEÑO: VIDEO FULLSCREEN + CARD TRANSPARENTE Y ESTRECHA */
/* + EFECTO IMAGEN CENTRAL QUE REVELA EL LOGIN */
/* + CIERRE AL SALIR DEL CONTENEDOR */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ============================================ */
/* PALETA DE COLORES */
/* ============================================ */
:root {
    --primary-wine: #9f2240;
    --primary-wine-dark: #7a1a32;
    --primary-wine-light: #c93a5c;
    --gold-muted: #c4a86b;
    --gold-dark: #9e7e48;
    --gold-light: #e8d5a3;
    --cream-light: #fffdf7;
    --cream-base: #fef8ed;
    --cream-warm: #faf3e2;
    --text-dark: #2c2418;
    --text-muted: #6b5a48;
    --white-pure: #ffffff;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 35px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.1);
    --glow-wine: 0 0 20px rgba(159, 34, 64, 0.15);
    --glow-gold: 0 0 20px rgba(196, 168, 107, 0.2);
    --transition-default: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

/* ============================================ */
/* VIDEO FULLSCREEN */
/* ============================================ */
.fullscreen-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.fullscreen-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

.video-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

/* ============================================ */
/* IMAGEN EFECTO - BOTÓN CENTRAL (INICIAL) */
/* ============================================ */
.effect-trigger-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.effect-image {
    max-width: 280px;
    width: 90%;
    height: auto;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 20px;
}

.effect-image:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
}

.effect-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 30px;
    background: rgba(196, 168, 107, 0.15);
    animation: pulseRing 2s infinite;
    pointer-events: none;
}

@keyframes pulseRing {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }
    70% {
        width: 130%;
        height: 130%;
        opacity: 0;
    }
    100% {
        width: 100%;
        height: 100%;
        opacity: 0;
    }
}

.effect-hint {
    margin-top: 20px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--gold-light);
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 8px 18px;
    border-radius: 40px;
    border: 1px solid rgba(196, 168, 107, 0.5);
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* CLASE PARA OCULTAR EL TRIGGER (CUANDO SE MUESTRA EL LOGIN) */
.effect-trigger-container.hide-trigger {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
}

/* CLASE PARA MOSTRAR EL TRIGGER NUEVAMENTE */
.effect-trigger-container.show-trigger {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* ============================================ */
/* CONTENEDOR PRINCIPAL - INICIALMENTE OCULTO */
/* ============================================ */
.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.9, 0.4, 1.1), 
                visibility 0.6s ease,
                transform 0.6s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.main-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-container.hiding {
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.40);
    backdrop-filter: blur(2px);
    border-radius: 48px;
    width: 100%;
    max-width: 580px;
    padding: 45px 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(196, 168, 107, 0.2);
    transition: var(--transition-default);
    animation: cardAppear 0.6s ease-out;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.50);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(196, 168, 107, 0.3);
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================ */
/* SECCIÓN DE LOGOS - SIEMPRE LADO A LADO CON TAMAÑOS PROPORCIONALES */
/* ============================================ */
.logos-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    flex-wrap: nowrap;
    width: 100%;
}

.logo-item {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
    flex: 1;
    min-width: 0;
}

.logo-item:hover {
    transform: scale(1.02);
}

.logo-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
    transition: filter 0.3s ease;
}

.logo-img:hover {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
}

/* Tamaños específicos para cada logo manteniendo proporción */
#logoIxtapaluca {
    max-width: 180px;
    width: 100%;
    height: auto;
}

#logoRocio {
    max-width: 240px;
    width: 100%;
    height: auto;
}

.logo-divider {
    width: 1px;
    height: 70px;
    background: linear-gradient(to bottom, transparent, var(--gold-muted), transparent);
    flex-shrink: 0;
}

/* ============================================ */
/* TÍTULO INSTITUCIONAL */
/* ============================================ */
.title-section {
    text-align: center;
    margin-bottom: 35px;
}

.main-title {
    margin-bottom: 16px;
}

.title-sub {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--gold-dark);
    text-transform: uppercase;
}

.title-main {
    display: block;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--primary-wine) 0%, var(--gold-muted) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-top: 8px;
}

.elegant-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 18px 0 14px;
}

.divider-line {
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-muted), transparent);
}

.divider-icon {
    color: var(--gold-muted);
    font-size: 11px;
    opacity: 0.8;
}

.institutional-slogan {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============================================ */
/* FORMULARIO PREMIUM */
/* ============================================ */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-wine);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.input-icon {
    width: 16px;
    height: 16px;
    color: var(--gold-muted);
}

.input-field {
    position: relative;
}

.input-field input {
    width: 100%;
    padding: 15px 20px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(196, 168, 107, 0.4);
    border-radius: 40px;
    color: var(--text-dark);
    font-family: inherit;
    transition: var(--transition-default);
    outline: none;
}

.input-field input:focus {
    border-color: var(--gold-muted);
    box-shadow: 0 0 0 3px rgba(196, 168, 107, 0.15);
    background: var(--white-pure);
}

.input-field input::placeholder {
    color: rgba(107, 90, 72, 0.4);
    font-size: 14px;
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold-muted), var(--gold-light), var(--gold-muted));
    transition: var(--transition-default);
    border-radius: 2px;
}

.input-field input:focus ~ .input-border {
    width: calc(100% - 40px);
    left: 20px;
}

.password-field {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
    color: var(--gold-muted);
}

.login-btn {
    background: linear-gradient(135deg, var(--primary-wine) 0%, var(--primary-wine-dark) 100%);
    border: 1px solid rgba(196, 168, 107, 0.5);
    padding: 15px 28px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gold-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition-default);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    width: 100%;
    margin-top: 8px;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232, 213, 163, 0.25), transparent);
    transition: left 0.5s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-3px);
    border-color: var(--gold-light);
    box-shadow: 0 10px 25px rgba(159, 34, 64, 0.3);
    background: linear-gradient(135deg, #b82e50 0%, #8a2038 100%);
}

.login-btn:active {
    transform: translateY(1px);
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.login-btn:hover .btn-icon {
    transform: translateX(5px);
}

.footer {
    margin-top: 35px;
    text-align: center;
}

.footer-lines {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.footer-lines span {
    width: 35px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-muted), transparent);
}

.footer p {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.footer-year {
    margin-top: 6px;
    font-size: 10px;
    opacity: 0.7;
    color: var(--gold-dark);
}

.login-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.login-btn.loading .btn-text::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid var(--gold-light);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shakeCard {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.shake {
    animation: shakeCard 0.4s ease-in-out;
}

/* ============================================ */
/* SISTEMA DE MENSAJES PREMIUM */
/* ============================================ */
.message-container {
    position: relative;
    margin-top: 20px;
    z-index: 100;
}

.message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 60px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(12px);
    animation: messageSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: opacity 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(196, 168, 107, 0.3);
}

.message.error {
    background: rgba(159, 34, 64, 0.45);
    color: #ffffff;
    border-left: 4px solid #e8d5a3;
    border-right: 1px solid rgba(232, 213, 163, 0.2);
}

.message.success {
    background: rgba(196, 168, 107, 0.45);
    color: #2c2418;
    border-left: 4px solid #9f2240;
    border-right: 1px solid rgba(159, 34, 64, 0.2);
}

.message.warning {
    background: rgba(232, 213, 163, 0.45);
    color: #2c2418;
    border-left: 4px solid #9f2240;
}

.message.error::before {
    content: "⚠️";
}

.message.success::before {
    content: "✓";
    font-weight: bold;
    font-size: 16px;
    background: rgba(44, 36, 24, 0.8);
    color: #c4a86b;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.message.warning::before {
    content: "🔒";
}

@keyframes messageSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message.connection-error {
    background: rgba(200, 60, 30, 0.45);
    color: #ffffff;
    border-left: 4px solid #ffd700;
    padding: 16px 24px;
    font-size: 13px;
}

.message.connection-error::before {
    content: "🔌";
    font-size: 20px;
}

.message.success {
    position: relative;
    overflow: hidden;
}

.message.success::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.loading-message {
    background: rgba(107, 90, 72, 0.45);
    color: #e8d5a3;
    padding: 14px 20px;
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(196, 168, 107, 0.3);
}

.loading-message::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid #e8d5a3;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(250, 243, 226, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-wine), var(--gold-muted));
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-wine-dark), var(--gold-dark));
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--gold-muted) rgba(250, 243, 226, 0.5);
}

/* ============================================ */
/* RESPONSIVE COMPLETO - LOGOS CON TAMAÑOS ADECUADOS */
/* ============================================ */
@media (min-width: 1600px) {
    .glass-card {
        max-width: 620px;
        padding: 50px 45px;
    }
    .logos-section {
        gap: 30px;
    }
    .logo-divider {
        height: 85px;
    }
    #logoIxtapaluca {
        max-width: 220px;
    }
    #logoRocio {
        max-width: 280px;
    }
    .title-main {
        font-size: 38px;
    }
    .effect-image {
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 30px 16px;
    }
    .glass-card {
        max-width: 520px;
        padding: 35px 30px;
        border-radius: 40px;
    }
    .logos-section {
        gap: 15px;
    }
    .logo-divider {
        height: 60px;
    }
    #logoIxtapaluca {
        max-width: 140px;
    }
    #logoRocio {
        max-width: 180px;
    }
    .title-main {
        font-size: 30px;
    }
    .effect-image {
        max-width: 220px;
    }
    .effect-hint {
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .glass-card {
        max-width: 100%;
        padding: 30px 24px;
        border-radius: 36px;
    }
    .logos-section {
        gap: 12px;
    }
    .logo-divider {
        height: 50px;
    }
    #logoIxtapaluca {
        max-width: 110px;
    }
    #logoRocio {
        max-width: 140px;
    }
    .title-main {
        font-size: 26px;
    }
    .title-sub {
        font-size: 11px;
    }
    .effect-image {
        max-width: 180px;
    }
    .effect-hint {
        font-size: 10px;
        padding: 6px 14px;
    }
    .input-field input {
        padding: 12px 18px;
        font-size: 14px;
    }
    .login-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 25px 20px;
        border-radius: 32px;
    }
    .logos-section {
        gap: 10px;
    }
    .logo-divider {
        height: 45px;
    }
    #logoIxtapaluca {
        max-width: 90px;
    }
    #logoRocio {
        max-width: 115px;
    }
    .title-main {
        font-size: 24px;
    }
    .title-sub {
        font-size: 10px;
        letter-spacing: 2px;
    }
    .institutional-slogan {
        font-size: 10px;
    }
    .elegant-divider {
        gap: 8px;
    }
    .divider-line {
        width: 30px;
    }
    .effect-image {
        max-width: 150px;
    }
    .effect-hint {
        font-size: 9px;
        margin-top: 12px;
        padding: 5px 12px;
    }
}

@media (max-width: 400px) {
    .logos-section {
        gap: 8px;
    }
    .logo-divider {
        height: 38px;
    }
    #logoIxtapaluca {
        max-width: 75px;
    }
    #logoRocio {
        max-width: 95px;
    }
    .title-main {
        font-size: 20px;
    }
    .effect-image {
        max-width: 130px;
    }
    .input-group {
        gap: 6px;
    }
    .input-label {
        font-size: 11px;
    }
    .input-field input {
        padding: 10px 16px;
        font-size: 13px;
    }
    .login-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    .footer p {
        font-size: 9px;
    }
    .footer-year {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .logos-section {
        gap: 6px;
    }
    .logo-divider {
        height: 32px;
    }
    #logoIxtapaluca {
        max-width: 65px;
    }
    #logoRocio {
        max-width: 80px;
    }
    .title-main {
        font-size: 18px;
    }
    .effect-image {
        max-width: 110px;
    }
    .glass-card {
        padding: 18px 14px;
    }
}