/* --- RESET BÁSICO --- */
:root {
    --primary: #ff5e00;       /* Naranja Neón Deportivo */
    --primary-dark: #cc4b00;
    --dark: #0a0a0a;
    --glass: rgba(20, 20, 20, 0.85);
    --border: rgba(255, 255, 255, 0.1);
    --text: #ffffff;
    --text-muted: #888888;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: var(--dark);
}

/* --- FONDOS --- */
.bg-image {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://images.unsplash.com/photo-1532444458054-01a7dd3e9fca?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    z-index: -2;
    transform: scale(1.05);
}

.bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 100%);
    z-index: -1;
    backdrop-filter: blur(4px);
}

/* --- TARJETA DE LOGIN/REGISTRO --- */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: slideUp 0.8s ease-out;
}

.login-card {
    background: var(--glass);
    padding: 3rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
    color: var(--text);
}

/* Efecto de luz superior */
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* --- CABECERA --- */
.icon-circle {
    width: 70px; height: 70px;
    background: rgba(255, 94, 0, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.3);
}

.icon-circle i {
    font-size: 30px;
    color: var(--primary);
}

h1 {
    font-weight: 800;
    font-size: 2rem;
    color: var(--text);
    line-height: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: -1px;
}

h1 span {
    color: var(--primary);
}

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

/* --- INPUTS --- */
.input-container {
    position: relative;
    margin-bottom: 20px;
}

.input-container .icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: 0.3s;
}

.input-container input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 2px solid #333;
    padding: 16px 20px 16px 55px; /* Espacio para el icono */
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.input-container input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0,0,0,0.6);
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.1);
}

.input-container input:focus + .icon {
    color: var(--primary);
}

/* Input especial para el código */
.code-container input {
    text-align: center;
    letter-spacing: 3px;
    padding-left: 20px; /* Centrado, ignoramos icono */
    text-transform: uppercase;
    font-size: 1.1rem;
    border-color: rgba(255, 94, 0, 0.3);
}
.code-container .icon { display: none; }

/* --- BOTÓN --- */
.btn-login {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 94, 0, 0.2);
}

/* --- FOOTER Y MENSAJES --- */
#mensajeError {
    color: #ff4d4d;
    margin-top: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 20px;
}

.copyright {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Enlaces de cambio de modo (Login <-> Registro) */
.switch-mode {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 1000;
}

.switch-mode a {
    color: var(--primary);
    font-weight: bold;
    text-decoration: underline;
}

/* --- ANIMACIONES --- */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 480px) {
    .login-card { padding: 2rem 1.5rem; }
    h1 { font-size: 1.8rem; }
}

/* =========================================
   ESTILOS ESPECÍFICOS DEL PANEL ADMIN
   ========================================= */

/* --- Contenedor Principal Admin --- */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 130px 20px 100px 20px; /* Espacio para navbar fija y footer */
    position: relative;
    z-index: 10;
}

/* --- Tarjetas de Sección (Cajas grises) --- */
.admin-section {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.admin-section h2 {
    color: var(--primary); /* Naranja */
    text-transform: uppercase;
    font-weight: 800;
    font-size: 1.5rem;
    border-bottom: 2px solid #333;
    padding-bottom: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Controles de Edición (Selector + Botón Cargar) --- */
.edit-controls {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #333;
}

/* Selectores e Inputs Oscuros */
select, input[type="text"], input[type="number"], input[type="date"] {
    width: 100%;
    padding: 12px;
    background-color: #050505 !important;
    border: 1px solid #444 !important;
    color: white !important;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

select:focus, input:focus {
    border-color: var(--primary) !important;
}

/* --- Grid del Formulario (2 columnas) --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid .full-width {
    grid-column: span 2;
}

.form-grid label {
    display: block;
    color: #aaa;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* --- Lista Visual de Participantes (Lineup Box) --- */
.lineup-box {
    background: #000;
    border: 1px dashed #555;
    padding: 15px;
    min-height: 80px;
    margin-top: 15px;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.lineup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    color: white;
    transition: background 0.2s;
}

.lineup-item:hover {
    background: #222;
}

/* Inputs pequeños dentro de la lista (Marca y Puntos) */
.result-text {
    background: #050505 !important;
    border: 1px solid #444 !important;
    color: #ccc !important;
    width: 120px !important;
    padding: 6px !important;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

.result-points {
    background: #050505 !important;
    border: 1px solid var(--primary) !important;
    color: var(--primary) !important;
    width: 70px !important;
    padding: 6px !important;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    font-size: 0.9rem;
}

/* --- Botones de Acción --- */
.btn-action {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-action:hover {
    background: #e65100; /* Naranja más oscuro */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 94, 0, 0.3);
}

.btn-delete {
    background: #d63031 !important; /* Rojo */
}
.btn-delete:hover {
    background: #b71c1c !important;
    box-shadow: 0 5px 15px rgba(214, 48, 49, 0.3);
}

.btn-secondary {
    background: #444 !important; /* Gris */
}
.btn-secondary:hover {
    background: #666 !important;
}

/* Botón Grande Cerrar Jornada */
.btn-close-round {
    background: linear-gradient(45deg, #ff5e00, #ff9100) !important;
    color: white !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    border: none !important;
    padding: 20px !important;
    margin-top: 30px !important;
    width: 100% !important;
    border-radius: 50px !important;
    box-shadow: 0 10px 30px rgba(255, 94, 0, 0.3) !important;
    letter-spacing: 1px;
}

.btn-close-round:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 94, 0, 0.5) !important;
}

/* --- Navbar Admin Específica --- */
.admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #000;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-back-btn {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
}

.nav-back-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* --- Responsive Móvil --- */
@media (max-width: 768px) {
    .admin-container {
        padding-top: 100px; /* Menos padding en móvil */
        padding-left: 10px;
        padding-right: 10px;
    }

    .form-grid {
        grid-template-columns: 1fr; /* Todo a 1 columna */
    }

    .form-grid .full-width {
        grid-column: span 1;
    }

    .edit-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .edit-controls button {
        width: 100%;
        margin-top: 10px;
    }

    .lineup-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lineup-item div {
        width: 100%;
    }

    .lineup-item input {
        width: 100% !important; /* Inputs ancho completo en móvil */
    }
    
    .lineup-item i {
        align-self: flex-end; /* Icono papelera a la derecha */
        margin-top: -30px; /* Truco visual para subirlo */
    }
}

/* --- Estilos para la lista de Checkboxes (Jornada Multi-Compe) --- */
.checklist-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    max-height: 300px;
    overflow-y: auto;
    background: #000;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 8px;
}

.check-item {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #444;
    cursor: pointer;
    transition: 0.2s;
}

.check-item:hover {
    background: #222;
    border-color: var(--primary);
}

.check-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    accent-color: var(--primary); /* Checkbox naranja */
    cursor: pointer;
}

.check-item label {
    cursor: pointer;
    width: 100%;
    color: white;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
}

.check-date {
    color: #888;
    font-size: 0.8rem;
    margin-left: 10px;
}