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

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.88);
    --border-glass: rgba(255, 255, 255, 0.75);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --primary: #1A55A3;
    --primary-hover: #14407E;
    --secondary: #3FC0EF;
    --secondary-hover: #2FA5D3;
    --accent: #14800D;
    --danger: #ef4444;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 30px rgba(26, 85, 163, 0.12);
}

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

html, body {
    height: 100%;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    line-height: 1.45;
}

/* Fondo con efecto de Orbes Luminosos */
body::before, body::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.18;
    pointer-events: none;
}

body::before {
    background: var(--primary);
    top: -5%;
    left: -5%;
}

body::after {
    background: var(--secondary);
    bottom: -5%;
    right: -5%;
}

/* Header & Navbar Ampliado y Reducido en Bordes */
header {
    width: 100%;
    padding: 0.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
    height: 56px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.logo-icon {
    width: 2.3rem;
    height: 2.3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(26, 85, 163, 0.25);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 1.1rem;
    border-radius: 0.5rem;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(26, 85, 163, 0.08), rgba(63, 192, 239, 0.08));
    border-color: rgba(26, 85, 163, 0.18);
    color: var(--primary);
}

/* Contenedor Principal Amplio (Márgenes Laterales Mínimos) */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1rem;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

/* Layout del Registro Más Ancho */
.registration-container {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 1.75rem;
    width: 100%;
    align-items: center;
    max-width: 1400px;
}

/* Info del Evento */
.event-info-section {
    width: 100%;
}

.badge-container {
    margin-bottom: 0.7rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.95rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(26, 85, 163, 0.08);
    color: var(--primary);
    border: 1px solid rgba(26, 85, 163, 0.2);
    box-shadow: 0 2px 8px rgba(26, 85, 163, 0.08);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.badge-success {
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.18);
}

.event-title {
    font-size: 2.35rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 0.65rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.event-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
    line-height: 1.45;
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.meta-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.5rem;
    background: rgba(26, 85, 163, 0.06);
    border: 1px solid rgba(26, 85, 163, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

/* Habeas Data Box Con Fuente Más Grande */
.habeas-box {
    padding: 0.85rem 1.1rem;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 0.75rem;
    font-size: 0.84rem;
    line-height: 1.38;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.habeas-box p {
    margin-bottom: 0.4rem;
    text-align: justify;
}

.habeas-box p:last-child {
    margin-bottom: 0;
}

.habeas-title {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Tarjeta Glassmorphism Formulario Ampliada */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    padding: 1.4rem 1.75rem;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg), 0 0 35px rgba(26, 85, 163, 0.15);
}

/* Tarjeta de Login Compacta */
.login-card {
    max-width: 420px;
    margin: 0 auto;
}

/* Header del Formulario */
.form-header {
    margin-bottom: 0.75rem;
}

.form-title {
    font-size: 1.55rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    color: var(--primary);
}

.form-subtitle {
    color: var(--text-secondary);
    font-size: 0.925rem;
}

/* Form Grid en 2 Columnas */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 0.95rem;
    margin-bottom: 0.8rem;
}

.col-span-2 {
    grid-column: span 2;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.22rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

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

.input-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0.45rem 0.75rem 0.45rem 2.4rem;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 0.55rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

select.form-control {
    cursor: pointer;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 12px rgba(26, 85, 163, 0.15);
}

.form-control:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* Botón Premium Ampliado */
.form-actions {
    display: flex;
    align-items: stretch;
}

.form-actions .btn {
    flex: 1;
}

.form-actions .btn + .btn {
    margin-left: 1.25rem;
}

.btn {
    width: 100%;
    height: 44px;
    padding: 0.65rem 1.25rem;
    border-radius: 0.65rem;
    border: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 14px rgba(26, 85, 163, 0.28);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn.btn-pay {
    background: linear-gradient(135deg, #14800D, #18A01E);
    color: #fff;
    box-shadow: 0 4px 14px rgba(20, 128, 13, 0.3);
}

.btn.btn-pay:hover {
    background: linear-gradient(135deg, #10690C, #14800D);
    color: #fff;
    box-shadow: 0 6px 18px rgba(20, 128, 13, 0.45);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26, 85, 163, 0.38);
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary-hover));
}

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

.btn-secondary {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: none;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

/* Spinner de Carga */
.spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mensajes de Alerta */
.alert {
    padding: 0.65rem 0.85rem;
    border-radius: 0.55rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.18);
    color: #047857;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.18);
    color: #b91c1c;
}

/* Card de Éxito */
.success-card {
    text-align: center;
    padding: 0.5rem 0;
}

.success-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.success-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.success-text {
    font-size: 0.925rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Footer Compacto */
footer {
    padding: 0.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background-color: rgba(241, 245, 249, 0.55);
    margin-top: auto;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dashboard de Administración */
.admin-container {
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-title-section h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
}

.admin-title-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-actions {
    display: flex;
    gap: 0.75rem;
}

.admin-actions .btn {
    width: auto;
    height: 38px;
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
}

/* Grid de Estadísticas Admin */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: rgba(26, 85, 163, 0.08);
    border: 1px solid rgba(26, 85, 163, 0.18);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Panel de Tabla Admin */
.table-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.table-panel-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.4);
}

.table-panel-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.table-responsive {
    overflow-x: auto;
    max-height: calc(100vh - 340px);
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: rgba(241, 245, 249, 0.8);
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    font-size: 0.875rem;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(26, 85, 163, 0.02);
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-icon {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Responsividad para Móviles */
@media (max-width: 968px) {
    body, html {
        height: auto;
    }
    
    main {
        padding: 1.5rem 0.75rem;
        height: auto;
    }
    
    .registration-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .event-info-section {
        max-width: 100%;
        text-align: center;
    }

    .badge-container {
        display: flex;
        justify-content: center;
    }

    .event-title {
        font-size: 1.85rem;
    }

    .meta-item {
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .col-span-2 {
        grid-column: span 1;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn + .btn {
        margin-left: 0;
        margin-top: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
