/* ═══════════════════════════════════════════════════════════
   PANEL FÉNIX PRO - DISEÑO BASE UNIFICADO V3.9.2
   Este archivo controla TODA la estetica del sistema
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Paleta de colores principal */
    --fenix-primary: #0a0e27;
    --fenix-secondary: #1a1f3a;
    --fenix-accent: #00d9ff;
    --fenix-accent-glow: #00ffff;
    --fenix-dark: #050714;
    --fenix-card: #0f1429;
    --fenix-border: rgba(0, 217, 255, 0.25);
    --fenix-text: #e8eef7;
    --fenix-text-muted: #8892a6;
    --fenix-success: #00ff88;
    --fenix-warning: #ffaa00;
    --fenix-danger: #ff3366;
    
    /* Tipografía */
    --font-display: 'Rajdhani', sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ═════════════════════════════════════════════════════════
   RESET Y BASE
   ═════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, #020205 0%, #0a0e1a 100%);
    background-attachment: fixed;
    color: var(--fenix-text);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Patrón de fondo Cyber */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 217, 255, 0.03) 0%, transparent 50%);
    opacity: 0.4;
    z-index: 0;
    pointer-events: none;
}

/* ═════════════════════════════════════════════════════════
   CLASES DE TEXTO COMUNES
   ═════════════════════════════════════════════════════════ */
.neon-text-blue {
    color: var(--fenix-accent);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.green-glow {
    color: var(--fenix-success) !important;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.welcome-msg {
    color: var(--fenix-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ═════════════════════════════════════════════════════════
   HUD SUPERIOR
   ═════════════════════════════════════════════════════════ */
.hud-top {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--fenix-border);
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.85rem;
}

.hud-top b { 
    color: var(--fenix-accent); 
}

/* ═════════════════════════════════════════════════════════
   CONTENEDOR PRINCIPAL
   ═════════════════════════════════════════════════════════ */
.main-hud, .welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* ═════════════════════════════════════════════════════════
   CAJAS Y TARJETAS
   ═════════════════════════════════════════════════════════ */
.welcome-box, .bienvenida-box {
    background: linear-gradient(135deg, rgba(15, 18, 25, 0.98) 0%, rgba(10, 14, 20, 0.95) 100%);
    border: 1px solid var(--fenix-border);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* ═════════════════════════════════════════════════════════
   GRID DE TARJETAS (INDEX) - CORREGIDO PARA QUE NO SE ALARGUE
   ═════════════════════════════════════════════════════════ */
.grid-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start; /* EVITA EL ALARGAMIENTO VERTICAL */
    gap: 1.5rem;
    padding: 2.5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
}

.card, .ficha-cyber {
    flex: 0 1 280px;
    background: linear-gradient(135deg, rgba(15, 18, 25, 0.95) 0%, rgba(10, 14, 20, 0.98) 100%);
    border: 1px solid var(--fenix-border);
    border-radius: 12px;
    padding: 1.8rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    height: auto !important; /* SE CIERRA JUSTO DEBAJO DEL BOTÓN */
}

.card:hover, .ficha-cyber:hover {
    transform: translateY(-8px);
    border-color: var(--fenix-accent);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 217, 255, 0.2);
}

.card h3, .ficha-cyber h3 {
    font-family: var(--font-display);
    color: var(--fenix-accent);
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.card p, .ficha-cyber p {
    color: var(--fenix-text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

/* ═════════════════════════════════════════════════════════
   FORMULARIOS E INPUTS UNIFICADOS
   ═════════════════════════════════════════════════════════ */
.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.input-group label {
    margin-bottom: 8px;
    color: var(--fenix-accent);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-family: var(--font-display);
}

input[type="text"], 
input[type="password"], 
select {
    width: 90%;
    padding: 12px;
    background: rgba(10, 10, 10, 0.9) !important;
    border: 1px solid var(--fenix-accent) !important;
    color: var(--fenix-text) !important;
    border-radius: 5px;
    text-align: center;
    outline: none;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

input:focus, select:focus {
    border-color: var(--fenix-accent-glow) !important;
    background: rgba(0, 0, 0, 0.7) !important;
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.3);
}

select {
    cursor: pointer;
    text-align-last: center;
}

select option {
    background-color: #0a0a0a;
    color: var(--fenix-text);
}

/* ═════════════════════════════════════════════════════════
   HEADER DE MÓDULOS
   ═════════════════════════════════════════════════════════ */
.header-module {
    margin-bottom: 30px;
    text-align: center;
}

.header-module h2 {
    margin-bottom: 10px;
}

/* ═════════════════════════════════════════════════════════
   ALERTAS DE ERROR
   ═════════════════════════════════════════════════════════ */
.error-alert, .system-alert {
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid var(--fenix-danger);
    color: var(--fenix-danger);
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    animation: pulse-alert 2s infinite;
}

@keyframes pulse-alert {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ═════════════════════════════════════════════════════════
   ÁREA DE ACCIONES (BOTONES)
   ═════════════════════════════════════════════════════════ */
.action-area, .footer-module {
    margin-top: 25px;
    text-align: center;
}

.btn-container {
    margin: 10px 0;
}

/* ═════════════════════════════════════════════════════════
   CONTENEDOR PARA BOTÓN VOLVER
   ═════════════════════════════════════════════════════════ */
.contenedor-volver {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ═════════════════════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .hud-top { 
        flex-direction: column; 
        gap: 0.5rem; 
    }
    
    .card, .ficha-cyber { 
        flex: 1 1 100%; 
        max-width: 400px; 
    }
    
    .welcome-box, .bienvenida-box {
        padding: 2rem 1.5rem;
    }
    
    input[type="text"], 
    input[type="password"], 
    select {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .grid-container {
        padding: 1.5rem 3%;
    }
}
