/* =========================================
   VARIABLES GLOBALES (Paleta de colores base)
   ========================================= */
:root {
    /* Color de acento base (Azul Turnea) */
    --primary-rgb: 37, 99, 235;
    --primary: rgb(var(--primary-rgb));

    /* Fondos con Transparencia (Modo Claro) */
    --bg-body: #E2E8F0;
    --bg-card: rgba(255, 255, 255, 0.7);
    /* Cristal blanco */
    --bg-input: rgba(255, 255, 255, 0.9);
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-strong: rgba(var(--primary-rgb), 0.05);
    /* Borde sutil del color elegido */

    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
}

/* EFECTO CRISTAL GLOBAL */
.stat-card,
.table-container,
.link-card,
.config-card,
.modal-content,
.sidebar {
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-strong) !important;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* =========================================
   ESTILOS BASE (Tipografía y reseteo)
   ========================================= */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    margin: 0;
    padding: 0;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Prevenir delay de 300ms al hacer tap en celulares */
a, button, input, select, .btn, .btn-primary, .btn-outline {
    touch-action: manipulation;
}

/* =========================================
   INPUTS, SELECTS Y LABELS
   ========================================= */
input,
select {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    font-size: 16px;
    background: var(--bg-input);
    color: var(--text-main);
    transition: 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    outline: none;
}

label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

/* =========================================
   BOTONES GENÉRICOS (Redondeados y con hover)
   ========================================= */
/* 1. BOTONES DINÁMICOS (Reaccionan a la paleta) */

/* Botón Primario Estándar: Usa el color de la paleta */
.btn,
.btn-primary,
.btn-success,
.btn-outline,
.btn-danger,
.btn-pdf,
.btn-nuevo {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    outline: none;
    height: 45px;
    text-decoration: none !important;
    /* Altura uniforme para todos */
}

/* 2. BOTONES SÓLIDOS (Acciones principales) */
.btn-primary,
.btn-success,
.btn-nuevo {
    background-color: var(--primary);
    color: white !important;
}

.btn-success {
    background-color: var(--success);
    /* Ahora sí verde para guardar/confirmar */
}

/* 3. BOTONES OUTLINE (Acciones secundarias) */
.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

/* 4. BOTONES DE PELIGRO/BORRAR */
.btn-danger,
.btn-cancelar {
    background-color: var(--danger);
    color: white;
}

/* 5. BOTÓN PDF (Estilo neutro) */
.btn-pdf {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* =========================================
   UTILIDADES
   ========================================= */
.hidden {
    display: none !important;
}

/* =========================================
   EXCEPCIONES (Checkboxes y Radios)
   ========================================= */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    -webkit-appearance: auto;
    appearance: auto;
    padding: 0;
    margin: 0 8px 0 0;
    display: inline-block;
}

/* =========================================
   EFECTO DE GRADIENTE ANIMADO ULTRA SUAVE (Apple Style)
   ========================================= */

/* Capa de fondo animada */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Se mantiene detrás de todo */
    background-image:
        radial-gradient(at 10% 10%, rgba(var(--primary-rgb), 0.12) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(var(--primary-rgb), 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(var(--primary-rgb), 0.08) 0px, transparent 50%);
    filter: blur(120px);
    /* Desenfoque extremo para suavidad total */
    animation: backgroundGradientMove 25s ease-in-out infinite;
    /* Movimiento ultra lento */
    opacity: 0.15;
    /* Sutil transparencia global */
    pointer-events: none;
}

/* Animación de movimiento lento */
@keyframes backgroundGradientMove {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(5%, 5%) scale(1.05);
    }

    50% {
        transform: translate(-3%, 8%) scale(1.1);
    }

    75% {
        transform: translate(6%, -4%) scale(1.02);
    }
}

/* Optimización para móviles (evitar lag por blur/animación pesada) */
@media (max-width: 768px) {
    body::before {
        animation: none;
        filter: blur(60px);
    }
}

nav, footer {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

footer {
    position: relative;
    z-index: 10;
}

/* =========================================
   FORMULARIOS DE AUTENTICACIÓN GLOBALES
   ========================================= */

.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-card h1, .auth-card h2 {
    color: var(--text-main);
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 8px;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    margin-bottom: 0;
}

.toggle-eye {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.toggle-eye:hover {
    color: var(--text-main);
}

.slug-preview {
    font-size: 12px;
    color: var(--primary);
    margin-top: 5px;
    display: block;
}

.links {
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
}

.links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.links a:hover {
    text-decoration: underline;
}

.link-volver {
    display: block;
    margin-top: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.link-volver:hover {
    color: var(--primary);
    text-decoration: underline;
}