/**
 * ESTILOS PORTAL DE LOGIN - Sistema WBS Interactivo
 * Proyecto: APP La Dorada-Chiriguaná
 * Versión: 1.0 (Extraído de index.html - 12-Oct-2025)
 * Mejora: Separación de estilos para mejor mantenibilidad
 */

/* =========================================
   RESET Y ESTILOS GLOBALES
   ========================================= */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* =========================================
   CONTENEDOR DE LOGIN
   ========================================= */

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 30px;
    max-width: 450px;
    width: 100%;
    animation: slideIn 0.5s ease-out;
}

/* =========================================
   LOGO Y BRANDING
   ========================================= */

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 5px;
    font-weight: 700;
}

.logo p {
    color: #666;
    font-size: 14px;
}

.project-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
}

/* =========================================
   FORMULARIO DE LOGIN
   ========================================= */

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
}

input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

/* =========================================
   MENSAJES Y FEEDBACK
   ========================================= */

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
    font-size: 14px;
    border-left: 4px solid #c33;
}

.error-message.show {
    display: block;
    animation: shake 0.5s;
}

.info-box {
    background: #f0f4ff;
    padding: 15px;
    border-radius: 10px;
    margin-top: 25px;
    border-left: 4px solid #667eea;
}

.info-box h3 {
    color: #667eea;
    font-size: 14px;
    margin-bottom: 8px;
}

.info-box p {
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

.version {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 25px;
}

/* =========================================
   SPINNER DE CARGA
   ========================================= */

.spinner {
    display: none;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.spinner.show {
    display: block;
}

/* =========================================
   PORTAL PRINCIPAL (POST-LOGIN)
   ========================================= */

.portal-container {
    display: none;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    max-width: 900px;
    width: 100%;
}

.portal-container.show {
    display: block;
    animation: slideIn 0.5s ease-out;
}

.portal-header {
    text-align: center;
    margin-bottom: 40px;
}

.portal-header h1 {
    color: #667eea;
    font-size: 32px;
    margin-bottom: 10px;
}

.portal-header p {
    color: #666;
    font-size: 16px;
}

/* =========================================
   ESTADÍSTICAS (MÉTRICAS)
   ========================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

/* =========================================
   GRID DE TARJETAS DEL PORTAL
   ========================================= */

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.portal-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-color: #667eea;
}

.portal-card h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 10px;
}

.portal-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.portal-card .icon {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

/* =========================================
   BOTÓN DE LOGOUT
   ========================================= */

.btn-logout {
    width: 100%;
    padding: 12px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #d0d0d0;
}

/* =========================================
   ANIMACIONES
   ========================================= */

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   RESPONSIVE DESIGN - TABLETS (768px)
   ========================================= */

@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .login-container {
        padding: 20px;
        border-radius: 15px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .logo p {
        font-size: 14px;
    }
    
    .portal-container {
        padding: 20px;
        margin: 10px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .portal-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* =========================================
   RESPONSIVE DESIGN - MÓVILES (480px)
   ========================================= */

@media (max-width: 480px) {
    .login-container {
        padding: 15px;
        margin: 10px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .input-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .portal-container {
        padding: 12px;
        margin: 5px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .portal-header {
        padding: 15px 10px;
    }
    
    .portal-header h1 {
        font-size: 20px;
        word-wrap: break-word;
        line-height: 1.2;
    }
    
    .portal-header p {
        font-size: 12px;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    .stats-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 20px;
        width: 100%;
        max-width: 100%;
    }
    
    .stat-card {
        padding: 8px;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .stat-value {
        font-size: 16px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .stat-label {
        font-size: 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
    }
    
    .portal-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .portal-card {
        padding: 15px;
    }
    
    .portal-card h3 {
        font-size: 16px;
        word-wrap: break-word;
    }
    
    .portal-card p {
        font-size: 13px;
        word-wrap: break-word;
    }
    
    .portal-card .icon {
        font-size: 28px;
    }
    
    .btn-logout {
        padding: 10px 20px;
        font-size: 13px;
    }
}

