:root {
    --primary: #2563eb;
    --secondary: #1d4ed8;
    --bg-color: #0f172a;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh; 
    width: 100vw;
    position: relative; 
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    background-color: var(--bg-color); 
    background-image: url('/INICIO_FLEX/frontend/fhlex.png'); 
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow: hidden; 

    background-size: 180% auto !important; 
    background-position: center top !important; 
}

/* 🚀 ESTILO EXCLUSIVO MARCA BLANCA PARA SUBDOMINIOS DE CLIENTES */
body.tenant-mode {
    background-image: radial-gradient(circle at 50% 35%, #1e293b 0%, #080e1a 100%) !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

body.tenant-mode .login-container {
    border: 1px solid var(--primary) !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 25px color-mix(in srgb, var(--primary) 20%, transparent) !important;
    z-index: 20; /* Asegura que el login esté por encima del logo de fondo */
}

/* --- HERO / LOGO GRANDE DE FONDO (MARCA DE AGUA PROFESIONAL) --- */
.tenant-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Detrás de la tarjeta de login pero sobre el fondo */
    pointer-events: none;
    opacity: 0.22; /* Sutil, elegante y profesional */
    gap: 15px;
    padding: 0 20px;
}

#tenant-hero-logo {
    max-width: min(55vw, 450px);
    max-height: 35vh;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.6));
}

.tenant-hero-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 900;
    letter-spacing: 6px;
    color: #ffffff;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

/* --- BRANDING DE LA EMPRESA EN CABECERA --- */
.tenant-brand-header {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-transform: uppercase;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    z-index: 100;
}

/* Media Queries PC */
@media (min-width: 768px) {
    body {
        background-size: cover !important;
        background-position: center -12vh !important; 
    }

    .login-container {
        top: auto !important; 
        bottom: 2px !important; 
        padding: 12px 22px !important;
    }

    .input-group {
        margin-bottom: 8px !important;
    }

    label {
        font-size: 0.75rem !important;
        margin-bottom: 3px !important;
    }

    input {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }

    button#btn-ingresar {
        padding: 10px !important;
        margin-top: 5px !important;
        font-size: 0.95rem !important;
    }
}

/* --- LOGO MEDIANO DENTRO DE LA TARJETA --- */
.logo-tenant-wrapper {
    text-align: center;
    margin-bottom: 12px;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#tenant-logo {
    max-width: 180px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

/* --- CABECERA Y BOTONES --- */
.main-header {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

.global-nav-buttons {
    display: flex;
    gap: 15px;
}

.nav-button {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 20px; 
    text-decoration: none;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
}

.nav-button.red-outline {
    color: var(--primary);
    border-color: var(--primary);
}

.nav-button.red-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px var(--primary);
}

/* --- CONTENEDOR DE LOGIN --- */
.login-container {
    position: absolute;
    top: 42vh; 
    bottom: auto; 
    left: 50%;
    transform: translateX(-50%); 
    margin: 0 !important; 
    width: 90%;
    max-width: 320px;
    background: rgba(15, 23, 42, 0.9); 
    padding: 18px 22px; 
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    z-index: 10;
}

.input-group {
    margin-bottom: 14px; 
    text-align: left;
}

label {
    display: block;
    color: #94a3b8; 
    margin-bottom: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.3); 
    color: white; 
    transition: border 0.3s ease;
}

input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

button#btn-ingresar {
    margin-top: 10px;
    width: 100%;
    padding: 12px;
    background: var(--primary); 
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s;
}

button#btn-ingresar:hover {
    background: var(--secondary);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 10px 0;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.divider span {
    padding: 0 10px;
    color: #94a3b8;
    font-size: 0.75rem;
}

.google-btn {
    width: 100%;
    padding: 10px;
    background: #ffffff;
    color: #333333;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.3s;
}

.google-btn:hover {
    background: #f1f5f9;
}

.google-icon {
    width: 18px;
    height: 18px;
}

#errorMsg {
    color: #ef4444; 
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- MODAL DE CONTACTO --- */
.contact-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center; z-index: 1000;
}
.contact-modal.hidden { display: none; }
.contact-content {
    background-color: #1e293b; color: white; padding: 30px; border-radius: 12px;
    position: relative; max-width: 400px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.1);
}
.close-contact {
    position: absolute; top: 10px; right: 15px; font-size: 1.5rem;
    font-weight: bold; cursor: pointer; color: #94a3b8;
}
.contact-link {
    display: block; margin-top: 10px; font-size: 1.1rem; font-weight: 600;
    color: var(--primary); text-decoration: none; margin-bottom: 20px;
}