:root {
    --primary: #00A4DC;
    --bg: #101010;
    --bg-image: none;
    --card-bg: rgba(26, 26, 26, 0.7);
    --text: #ffffff;
    --muted: #b3b3b3;
    --radius: 12px;
    --banner-mobile: none;
    --banner-pc: none;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    background-image: var(--bg-image);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text);
    padding-bottom: 70px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }

/* Efecto Glassmorphism */
.glass {
    background: rgba(15, 15, 15, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 30;
    flex-wrap: wrap;
    transition: background 0.3s ease;
}
.nav .logo img { height: 40px; display: block; }
.nav .title { font-weight: 900; font-size: 1.6em; color: var(--text); letter-spacing: -0.5px;}

/* Banner Estático */
.banner {
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--card-bg);
}
@media (max-width: 767px) {
    .banner { aspect-ratio: 1 / 1; background-image: var(--banner-mobile); }
}
@media (min-width: 768px) {
    .banner { aspect-ratio: 16 / 9; max-height: 500px; background-image: var(--banner-pc); }
}

/* Botones Globales con BLUR DINÁMICO */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
    border: none;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 40%, transparent);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* --- Banner Dinámico --- */
.banner-dynamic {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #000;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

@media (min-width: 768px) {
    .banner-dynamic {
        aspect-ratio: 16 / 9;
        max-height: 550px;
    }
}
@media (max-width: 767px) {
    .banner-dynamic {
        aspect-ratio: 1 / 1;
        max-height: 100vw;
    }
}

.banner-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center top;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.banner-slide.active {
    opacity: 1;
    z-index: 2;
}

.banner-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(10,10,10,1) 0%, rgba(10,10,10,0.7) 40%, rgba(0,0,0,0) 100%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    text-align: center;
    padding: 40px 20px;
    min-height: 60%;
}

.banner-title {
    margin: 0 0 10px 0;
    font-size: 3em;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9);
    line-height: 1.1;
}

.banner-meta {
    margin: 0 0 25px 0;
    font-size: 1.1em;
    color: #ddd;
    font-weight: 600;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.9);
    display: flex;
    gap: 10px;
    align-items: center;
}

.banner-actions {
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

@media (max-width: 767px) {
    .banner-title { font-size: 1.8em; }
    .banner-meta { font-size: 0.9em; margin-bottom: 15px; }
    .banner-overlay { padding: 20px 15px; }
    .banner-actions { gap: 10px; width: 100%; }
    .banner-actions .btn-primary, .banner-actions .btn-secondary { flex: 1; padding: 10px 15px; font-size: 0.9em; }
}

.banner-actions-static {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: -10px;
}

/* Buscador */
.hero {
    text-align: center;
    padding: 40px 15px 20px;
}
.hero-title { font-size: 1.8em; margin: 0 0 8px; font-weight: 800; }
.hero-search { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }
.hero-search input {
    flex: 1;
    padding: 14px 24px;
    font-size: 1em;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.hero-search input:focus { 
    outline: none; 
    border-color: var(--primary); 
    background: rgba(255,255,255,0.1); 
    box-shadow: 0 0 15px color-mix(in srgb, var(--primary) 20%, transparent);
}
.hero-search button {
    padding: 0 30px;
    font-size: 1em;
    font-weight: 700;
    border-radius: 999px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    transition: filter 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 40%, transparent);
}
.hero-search button:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Grid de Tarjetas */
.section-title { padding: 20px 20px 10px; font-size: 1.4em; margin: 0; font-weight: 700;}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px 20px;
    max-width: 1500px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px;}
}
@media (min-width: 1200px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 12px 20px rgba(0,0,0,0.6);
}
.card img {
    width: 100%;
    height: auto;
    max-height: 300px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: #222;
}
.card h3 {
    font-size: 0.95em;
    margin: 12px 12px 4px;
    font-weight: 700;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}
.card .year { color: var(--muted); font-size: 0.85em; margin: 0 12px 12px; margin-top: auto; }

/* Formulario solicitud */
.solicitud-box {
    padding: 40px 30px;
    background: rgba(20, 20, 20, 0.8);
    margin: 50px auto;
    border-radius: 20px;
    max-width: 600px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}
.solicitud-box h3 { margin-top: 0; text-align: center; font-size: 1.5em; margin-bottom: 25px;}
.solicitud-box input {
    display: block;
    width: 100%;
    margin: 15px 0;
    padding: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: var(--radius);
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.solicitud-box input:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary) 20%, transparent);
}
.solicitud-box .btn-primary {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
}

.msg-ok    { color: #7CFC7C; padding: 0 20px; text-align: center; font-weight: bold; font-size: 1.1em;}
.msg-error { color: #ff6b6b; padding: 0 20px; text-align: center; font-size: 1.1em;}

/* WhatsApp flotante */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25D366;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.5);
    z-index: 40;
    transition: transform 0.2s;
}
.whatsapp-float:hover { transform: scale(1.1); }

/* Footer fijo */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10,10,10,0.9);
    backdrop-filter: blur(10px);
    text-align: center;
    padding: 15px;
    font-size: 0.85em;
    color: var(--muted);
    z-index: 30;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Popup */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    backdrop-filter: blur(5px);
}
.popup-overlay.active { display: flex; }
.popup-box {
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
}
.popup-box h3 { margin-top: 0; color: var(--primary); font-size: 1.5em;}

/* Admin */
.admin-wrap { 
    max-width: 1100px; 
    margin: 40px auto; 
    padding: 30px; 
    background: rgba(15,15,15,0.95); 
    border-radius: 20px; 
    backdrop-filter: blur(15px); 
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
    margin-bottom: 25px;
}
.admin-header h2 { margin: 0; color: var(--primary); font-size: 1.8em; }
.admin-links { display: flex; gap: 15px; font-weight: 600; }

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    flex-wrap: wrap;
}
.tab-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #aaa;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s;
}
.tab-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--primary) 30%, transparent);
}

.tab-content { display: none; animation: fadeIn 0.4s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Grids y Cajas */
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
@media (max-width: 768px) {
    .admin-grid-2 { grid-template-columns: 1fr; }
}
.admin-box {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}
.admin-box h4 { margin-top: 0; color: #fff; margin-bottom: 15px; }

/* Inputs del Admin */
.admin-wrap label { display: block; margin: 15px 0 8px; color: #ddd; font-weight: 500; font-size: 0.95em;}
.admin-wrap input[type="text"],
.admin-wrap input[type="password"],
.admin-wrap input[type="url"],
.admin-wrap input[type="date"],
.admin-wrap input[type="number"],
.admin-wrap textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 8px;
    margin-bottom: 5px;
    font-family: inherit;
    font-size: 0.95em;
    transition: border-color 0.2s;
}
.admin-wrap input:focus, .admin-wrap textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
}
.admin-wrap input[type="file"] { margin-bottom: 15px; color: #888; font-size: 0.9em;}
.admin-wrap input[type="checkbox"] { transform: scale(1.2); margin-right: 8px; cursor: pointer; }

.admin-preview {
    display: block;
    margin-top: 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 5px;
    background: #000;
}

/* Tablas Profesionales */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    overflow: hidden;
}
.admin-table th {
    background: rgba(255,255,255,0.05);
    color: var(--primary);
    text-align: left;
    padding: 15px;
    font-weight: 600;
}
.admin-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: rgba(255,255,255,0.02); }

/* Badges (Etiquetas de estado) */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.badge-green { background: rgba(124, 252, 124, 0.15); color: #7CFC7C; border: 1px solid rgba(124, 252, 124, 0.3);}
.badge-red { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.3);}
.badge-blue { background: rgba(0, 164, 220, 0.15); color: #00A4DC; border: 1px solid rgba(0, 164, 220, 0.3);}

.btn-danger { color: #ff6b6b !important; border-color: rgba(255,107,107,0.3) !important; }
.btn-danger:hover { background: rgba(255,107,107,0.1) !important; }

/* Alertas */
.alert-ok { background: rgba(124, 252, 124, 0.1); border: 1px solid rgba(124, 252, 124, 0.3); color: #7CFC7C; padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }
.alert-error { background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.3); color: #ff6b6b; padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }

/* Captcha Matemático */
.captcha-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.captcha-box label {
    color: #ddd;
    font-size: 0.95em;
    margin: 0;
    line-height: 1.4;
}
.captcha-box strong {
    color: var(--primary);
    font-size: 1.3em;
    letter-spacing: 1.5px;
    display: inline-block;
    margin-top: 5px;
}
.captcha-box input {
    margin: 0 !important; 
    padding: 12px;
    font-size: 1.1em;
    text-align: center;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
}
.captcha-box input:focus {
    border-color: var(--primary);
}