/* ==========================================================================
   Variables y Reset
   ========================================================================== */
:root {
    --primary-green: #43732d;
    --dark-green: #2d4d1e;
    --text-color: #333;
    --glass-bg: rgba(255, 255, 255, 0.9);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    /* Padding para iPhone X+ Notch */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    overflow: hidden;
}

/* ==========================================================================
   Header y Footer
   ========================================================================== */
.main-header h1 {
    color: white;
    font-weight: 300;
    font-size: 1.2rem;
    margin-bottom: 25px;
    letter-spacing: 1px;
    text-align: center;
}
.main-header span { font-weight: 600; color: var(--primary-green); }

.footer {
    position: fixed;
    bottom: 20px;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==========================================================================
   Contenedor Principal (Tarjeta Glass)
   ========================================================================== */

.box_ingreso {
		background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    
    /* Centrado y Capas */
    position: relative; /* Importante para que el z-index funcione */
    z-index: 10;        /* Valor alto para estar por encima del video */
    
    width: 100%;         /* Responsivo */
    max-width: 450px;   /* Tamaño máximo en escritorio */
    margin: 20px auto;  /* Centrado horizontal */
    
    text-align: center;
    border: 1px solid rgba(255,255,255,0.3);
    box-sizing: border-box;


}

/* Ajuste específico para pantallas muy pequeñas */
@media (max-width: 480px) {
    .box_ingreso {
        width: 90%;        /* Deja un pequeño margen a los lados en el móvil */
        padding: 30px 20px;
    }
}

.video-background {
    position: fixed; /* Se queda fijo mientras haces scroll */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;     /* Envía el video al fondo de todo */
    overflow: hidden;
    background-color: #000; /* Fondo negro mientras carga el video */
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Evita que el buque se estire feo */
}


.video-background::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Capa oscura para resaltar el formulario */
}


#logo img {
    width: 200px;
    margin-bottom: 30px;
}

h3 {
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 10px;
}

/* ==========================================================================
   INPUT MODAL (Etiqueta Flotante)
   ========================================================================== */
.input-group-modern {
    position: relative;
    margin-top: 30px;
    margin-bottom: 35px;
    width: 100%;
    text-align: left;
}

.input-group-modern input {
    font-size: 16px;
    padding: 10px 10px 10px 5px;
    display: block;
    width: 100%;
    border: none;
    border-bottom: 1.5px solid #999;
    background: transparent;
    box-sizing: border-box;
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

/* Quitar bordes de enfoque por defecto */
.input-group-modern input:focus {
    outline: none;
}

/* Estilo de la etiqueta que flota */
.input-group-modern label {
    color: #888;
    font-size: 16px;
    font-weight: normal;
    position: absolute;
    pointer-events: none;
    left: 5px;
    top: 10px;
    transition: 0.2s ease all;
    -moz-transition: 0.2s ease all;
    -webkit-transition: 0.2s ease all;
}

/* EFECTO: Cuando el usuario hace clic o hay texto escrito */
.input-group-modern input:focus ~ label,
.input-group-modern input:not(:placeholder-shown) ~ label {
    top: -20px;
    font-size: 13px;
    color: var(--primary-green);
    font-weight: 600;
}

/* BARRA DE COLOR ANIMADA AL ENFOCAR */
.input-group-modern .bar { 
    position: relative; 
    display: block; 
    width: 100%; 
}

.input-group-modern .bar:before, 
.input-group-modern .bar:after {
    content: '';
    height: 2.5px; 
    width: 0;
    bottom: 0px; 
    position: absolute;
    background: var(--primary-green); 
    transition: 0.3s ease all; 
    -moz-transition: 0.3s ease all; 
    -webkit-transition: 0.3s ease all;
}

.input-group-modern .bar:before { left: 50%; }
.input-group-modern .bar:after { right: 50%; }

/* Acción de expandir barra */
.input-group-modern input:focus ~ .bar:before, 
.input-group-modern input:focus ~ .bar:after {
    width: 50%;
}

/* ==========================================================================
   Botón y Enlaces
   ========================================================================== */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(67, 115, 45, 0.3);
}

.btn-submit:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Mensaje de error/respuesta del login */
#respuesta:not(:empty) {
    margin-top: 15px;
    padding: 12px 16px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    animation: fadeInError 0.3s ease;
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

#opciones {
    margin-top: 25px;
    font-size: 0.85rem;
}

.link-opt {
    color: #555;
    text-decoration: none;
    transition: color 0.2s;
}

.link-opt:hover {
    color: var(--primary-green);
}

.separator {
    margin: 0 10px;
    color: #ccc;
}

.seal-container {
    margin-top: 20px;
}

/* Media Query para Dispositivos Móviles */
@media (max-width: 480px) {
    .login-container {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px; /* Evita que el cuadro toque los bordes del celular */
    }

    .box_ingreso {
        width: 100% !important; /* Ocupa el ancho disponible */
        max-width: 350px;       /* Pero no se estira de más */
        margin: 0 auto !important; /* Centrado horizontal absoluto */
        padding: 30px 20px;     /* Ajusta el aire interno */
        box-sizing: border-box; /* Asegura que el padding no rompa el ancho */
    }

    #logo img {
        width: 80%;            /* Logo un poco más pequeño en móvil */
        height: auto;
    }
}

.footer p {
	font-size: 0.75rem;
  padding-bottom: 20px;
	text-align:center;
}


/* Estilo para el contenedor del título Intranet */
.main-header h1 {
    background: rgba(255, 255, 255, 0.3); /* Fondo blanco al 30% */
    backdrop-filter: blur(8px);           /* Desenfoque del video al pasar */
    -webkit-backdrop-filter: blur(8px);
    display: inline-block;                /* Para que el fondo solo cubra el texto */
    padding: 8px 25px;
    border-radius: 50px;                  /* Forma de píldora */
    color: #ffffff;
    font-size: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-top: 20px;
}

/* Estilo para el texto inferior (Desarrollo Cafetero) */
.footer-text {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: inline-block;
    padding: 6px 15px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}
