:root {
    --primary-green: #00ff8c;
    --warning-yellow: #ffd700;
    --danger-red: #ff4757;
    --primary-blue: #0096ff;
    --black: #000000;
    --dark-gray: #1a1a1a;
    --medium-gray: #2d2d2d;
    --light-gray: #888888;
    --white: #ffffff;
}

/* ===== ESTILOS UNIFICADOS PARA PÁGINAS DE ERROR ===== */

/* Contenedor principal de error */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--black);
    color: var(--white);
    font-family: 'Roboto', sans-serif;
    padding-top: 80px; /* CORRECCIÓN: Compensa header fijo */
}

.error-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 5%;
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 80px); /* CORRECCIÓN: Ajusta altura */
}

/* Animación de fondo para errores */
.error-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
    pointer-events: none;
}

/* Código de error */
.error-code {
    font-size: clamp(8rem, 20vw, 12rem);
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1;
    text-shadow: 0 0 30px rgba(0, 255, 140, 0.5);
    animation: error-pulse 2s infinite;
    position: relative;
    z-index: 1;
}

/* Colores específicos por tipo de error */
.error-401 .error-code { color: var(--warning-yellow); }
.error-403 .error-code { color: var(--danger-red); }
.error-404 .error-code { color: var(--primary-green); }
.error-500 .error-code { color: var(--danger-red); }
.error-503 .error-code { color: var(--primary-blue); }

/* Título del error */
.error-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
    color: var(--white);
    position: relative;
    z-index: 1;
}

/* Descripción del error */
.error-description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--light-gray);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Acciones principales */
.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

/* Botones específicos para errores de autenticación */
.error-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

/* Tarjetas de enlaces útiles */
.error-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.error-link-card {
    background: linear-gradient(145deg, var(--dark-gray), var(--medium-gray));
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.error-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.error-link-card:hover::before {
    left: 100%;
}

.error-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Colores de borde al hover según tipo de error */
.error-401 .error-link-card:hover { border-color: var(--warning-yellow); }
.error-403 .error-link-card:hover { border-color: var(--danger-red); }
.error-404 .error-link-card:hover { border-color: var(--primary-green); }
.error-500 .error-link-card:hover { border-color: var(--danger-red); }
.error-503 .error-link-card:hover { border-color: var(--primary-blue); }

.error-link-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

/* Colores de iconos según tipo de error */
.error-401 .error-link-icon { color: var(--warning-yellow); }
.error-403 .error-link-icon { color: var(--danger-red); }
.error-404 .error-link-icon { color: var(--primary-green); }
.error-500 .error-link-icon { color: var(--danger-red); }
.error-503 .error-link-icon { color: var(--primary-blue); }

.error-link-card:hover .error-link-icon {
    transform: scale(1.1);
}

.error-link-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.error-link-description {
    font-size: 0.9rem;
    color: var(--light-gray);
    line-height: 1.4;
}

/* Footer específico para errores */
.error-footer {
    padding: 2rem 5%;
    text-align: center;
    background-color: var(--dark-gray);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

/* Animaciones */
@keyframes error-pulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 30px currentColor;
    }
    50% {
        opacity: 0.8;
        text-shadow: 0 0 40px currentColor;
    }
}

@keyframes error-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Estados de sesión para errores 401/403 */
.session-status {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

.session-status p {
    margin: 0;
    color: var(--light-gray);
}

/* ===== ESTILOS ESPECÍFICOS PARA MANTENIMIENTO (503) ===== */
.maintenance-animation {
    max-width: 300px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

.maintenance-gif {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.maintenance-icon {
    font-size: 8rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    animation: maintenance-bounce 2s infinite;
}

.progress-container {
    width: 100%;
    max-width: 400px;
    background: var(--dark-gray);
    border-radius: 10px;
    padding: 3px;
    margin: 2rem auto;
    position: relative;
    z-index: 1;
}

.progress-bar {
    height: 20px;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-green));
    border-radius: 8px;
    width: 65%;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: progress-shine 2s infinite;
}

.progress-text {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--light-gray);
    font-size: 0.9rem;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem auto;
    position: relative;
    z-index: 1;
}

.countdown-item {
    background: var(--dark-gray);
    padding: 1rem;
    border-radius: 10px;
    min-width: 80px;
    text-align: center;
    border: 1px solid rgba(0, 150, 255, 0.3);
}

.countdown-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-blue);
    display: block;
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--light-gray);
    text-transform: uppercase;
}

.status-updates {
    background: rgba(0, 150, 255, 0.1);
    border: 1px solid rgba(0, 150, 255, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.status-title {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.status-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-item:last-child {
    border-bottom: none;
}

.status-item.completed {
    color: var(--primary-green);
}

.status-item.in-progress {
    color: var(--warning-yellow);
}

.status-item.pending {
    color: var(--light-gray);
}

@keyframes maintenance-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes progress-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes pulse-blue {
    0%, 100% {
        text-shadow: 0 0 30px rgba(0, 150, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 40px rgba(0, 150, 255, 0.8);
    }
}

.error-503 .error-code {
    animation: pulse-blue 2s infinite;
}

/* ===== CORRECCIÓN PARA HEADER FIXED ===== */
.service-nav {
    height: 80px; /* Altura fija para calcular padding */
}

/* Asegurar que el contenido no quede oculto detrás del header */
.error-content > *:first-child {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-links {
        grid-template-columns: 1fr;
    }
    
    .error-auth-actions {
        width: 100%;
    }
    
    .session-status {
        margin: 0 1rem 2rem;
    }
    
    /* CORRECCIÓN: Ajustes para móviles */
    .error-page {
        padding-top: 70px;
    }
    
    .error-content {
        min-height: calc(100vh - 70px);
        padding: 1rem;
    }
    
    .service-nav {
        height: 70px;
    }
    
    .maintenance-icon {
        font-size: 6rem;
    }
    
    .countdown {
        gap: 0.5rem;
    }
    
    .countdown-item {
        min-width: 70px;
        padding: 0.8rem;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .error-content {
        padding: 1rem;
    }
    
    .error-code {
        font-size: 6rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .error-description {
        font-size: 1rem;
    }
    
    .maintenance-icon {
        font-size: 5rem;
    }
    
    .countdown {
        flex-wrap: wrap;
    }
    
    .countdown-item {
        min-width: 60px;
        padding: 0.6rem;
    }
    
    .countdown-value {
        font-size: 1.3rem;
    }
}