/* sirioLoginCss.css */
/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a2b4c 0%, #2d4a75 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden; /* Prevenir scroll del body */
    padding: 1rem;
    width: 100%;
    max-width: 100vw; /* No exceder el ancho de la ventana */
}

/* Patrón de fondo similar al logo */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.02) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.02) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255,255,255,0.01) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 80px 80px;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(360deg); }
}

/* Contenedor principal del login */
.login-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 370px;
    max-height: 150vh;
    overflow-y: auto;
    overflow-x: hidden; /* Prevenir scroll horizontal */
    position: relative;
    z-index: 10;
    animation: slideUpContainer 0.8s ease-out;
}

@keyframes slideUpContainer {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Contenedor del logo */
.logo-container {
    text-align: center;
    margin-bottom: 0.5rem;
    background-color: #0E2747; /* Color similar al fondo del logo */
    padding: 0.5rem 0.5rem; /* Padding ajustado */
    margin: -2rem -2rem 2rem -2rem; /* Ocupar todo el ancho del contenedor */
    border-radius: 10px 10px 0 0; /* Solo bordes superiores redondeados */
    overflow: hidden; /* Prevenir contenido que se desborde */
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.logo-image {
    max-width: 100px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.subtitle {
    color: rgba(255, 255, 255, 0.9); /* Color blanco semi-transparente para contraste */
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    margin-bottom: 0;
    margin-top: 1rem;
    font-family: 'Orbitron', monospace;
}

/* Texto de bienvenida */
.welcome-text {
    color: #1a2b4c;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.5rem; /* Cambiar de 0.8rem a 1.5rem */
    text-align: center;
    font-family: 'Orbitron', monospace;
    margin-top: 30px; /* Cambiar de 20px a 30px */
    margin-bottom: 40px; /* Cambiar de 30px a 40px */
}
/* Grupos de formulario */
.form-group {
    margin-bottom: 3rem; /* Cambiar de 1.5rem a 2rem */
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Inputs con iconos */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #0062FF;
    font-size: 1.1rem;
    z-index: 2;
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-group input {
    width: 100%;
    max-width: 100%; /* No exceder el contenedor padre */
    padding: 1rem 3rem 1rem 3rem; /* Espacio para el icono izquierdo */
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    box-sizing: border-box; /* Incluir padding en el ancho total */
}

.form-group input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: white;
}

.form-group input:focus ~ .input-icon,
.input-with-icon input:focus + .input-icon {
    color: #007AFF;
}

.form-group input:hover:not(:focus) {
    border-color: #c7d2fe;
}

/* Input de contraseña con espacio para ambos iconos */
#password {
    padding-right: 3.5rem; /* Espacio para el icono de mostrar/ocultar */
}

/* Toggle de contraseña */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    user-select: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.password-toggle:hover {
    color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
}

/* Sección de opciones del formulario */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem; /* Cambiar de 1.5rem a 2rem */

    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.remember-password {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* No encogerse */
}

.remember-password input[type="checkbox"] {
    width: auto;
    min-width: auto;
    margin: 0;
    padding: 0;
    transform: scale(1.2);
    accent-color: #007AFF;
    cursor: pointer;
    flex-shrink: 0;
}

.remember-password label {
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    white-space: nowrap; /* No romper línea */
}

.forgot-password {
    text-align: right;
    flex-shrink: 0;
}

.forgot-password a {
    color: #007AFF;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    white-space: nowrap; /* No romper línea */
}

.forgot-password a:hover {
    color: #0056cc;
    text-decoration: underline;
}

/* Botón de login */
.login-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #0362C8 0%, #0056cc 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(2 222 119 / 0.3);
}



.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.login-button:hover::before {
    left: 100%;
}

/* Divisor */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #999;
    font-size: 0.85rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
    z-index: -1;
}

.divider span {
    background: white;
    padding: 0 1rem;
}

/* Texto de soporte */
.support-text {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    margin-top: 1rem;
}

.support-text a {
    color: #007AFF;
    text-decoration: none;
}

.support-text a:hover {
    text-decoration: underline;
}

/* Elementos flotantes */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.floating-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.1);
    animation: floatIcon 15s infinite linear;
}

@keyframes floatIcon {
    0% { transform: translateY(100vh) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.floating-icon:nth-child(1) { left: 10%; animation-delay: 0s; font-size: 2rem; }
.floating-icon:nth-child(2) { left: 20%; animation-delay: 2s; font-size: 1.5rem; }
.floating-icon:nth-child(3) { left: 30%; animation-delay: 4s; font-size: 2.5rem; }
.floating-icon:nth-child(4) { left: 40%; animation-delay: 6s; font-size: 1.8rem; }
.floating-icon:nth-child(5) { left: 50%; animation-delay: 8s; font-size: 2rem; }
.floating-icon:nth-child(6) { left: 60%; animation-delay: 10s; font-size: 1.6rem; }
.floating-icon:nth-child(7) { left: 70%; animation-delay: 12s; font-size: 2.2rem; }
.floating-icon:nth-child(8) { left: 80%; animation-delay: 14s; font-size: 1.7rem; }
.floating-icon:nth-child(9) { left: 90%; animation-delay: 16s; font-size: 1.9rem; }

/* Mensajes flotantes */
.error-message,
.timeout-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 300px;
    max-width: calc(100vw - 40px); /* No exceder pantalla */
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    animation: slideDown 0.5s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    word-wrap: break-word; /* Romper palabras largas */
}

.error-message {
    background: rgba(254, 226, 226, 0.95);
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.timeout-message {
    background: rgba(255, 243, 205, 0.95);
    color: #d97706;
    border-left: 4px solid #f59e0b;
}

.message-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0 0 15px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.message-close:hover {
    opacity: 1;
}

.message-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

@keyframes slideDown {
    0% {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
}

.message-hiding {
    animation: slideUp 0.4s ease-in forwards;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    25% { transform: translateX(-50%) translateY(0) translateX(-5px); }
    75% { transform: translateX(-50%) translateY(0) translateX(5px); }
}

/* Información de seguridad */
.security-info {
    background: #e8f4fd;
    color: #0c5460;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #17a2b8;
    font-size: 0.85rem;
}

.security-info strong {
    display: block;
    margin-bottom: 0.5rem;
}

.security-features {
    list-style: none;
    padding-left: 0;
}

.security-features li {
    padding: 0.2rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.security-features li::before {
    content: '🛡️';
    position: absolute;
    left: 0;
    font-size: 0.8rem;
}

/* Responsive para pantallas pequeñas */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .login-container {
        margin: 0.5rem;
        padding: 1.5rem;
        max-width: calc(100vw - 1rem); /* Ajustar al viewport */
    }
    
    .logo-container {
        margin: -1.5rem -1.5rem 2rem -1.5rem; /* Ajustar a nuevo padding */
        padding: 1.5rem 1rem;
    }
    
    .logo-image {
        max-width: 180px;
        max-height: 70px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .forgot-password {
        text-align: left;
        width: 100%;
    }
    
    .error-message,
    .timeout-message {
        min-width: 280px;
        max-width: calc(100vw - 20px);
        left: 10px;
        right: 10px;
        transform: none;
        margin: 0 auto;
    }

    .welcome-text {
        font-size: 1.4rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
}

/* Responsive para pantallas muy altas */
@media (max-height: 700px) {
    .login-container {
        padding: 1.5rem;
        max-height: 90vh;
    }
    
    .logo-image {
        max-height: 60px;
    }

    .form-group {
        margin-bottom: 1rem;
    }
    
    .welcome-text {
        font-size: 1.4rem;
    }
}

/* Scroll personalizado para el contenedor */
.login-container::-webkit-scrollbar {
    width: 6px;
}

.login-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.login-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.login-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Desactivar autocompletado visual */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    -webkit-text-fill-color: #333 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Ocultar íconos de autocompletado */
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    display: none !important;
    pointer-events: none;
    height: 0;
    width: 0;
    margin: 0;
}

/* Desactivar sugerencias de datalist */
input::-webkit-list-button {
    display: none;
}
