/* ============================================================
   ESOULTERIC — Design System
   Tipografía: Cinzel (títulos) + Inter (cuerpo)
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────── */
:root {
    --bg:            #0d0d14;
    --bg-surface:    #13131e;
    --bg-elevated:   #1a1a2a;
    --border:        rgba(168, 85, 247, 0.18);
    --border-hover:  rgba(168, 85, 247, 0.45);

    --purple:        #a855f7;
    --purple-deep:   #7c3aed;
    --purple-glow:   rgba(168, 85, 247, 0.25);
    --purple-muted:  rgba(168, 85, 247, 0.12);

    --text:          #f0eeff;
    --text-muted:    #94a3b8;
    --text-faint:    #4a5568;

    --radius-sm:     6px;
    --radius-md:     12px;
    --radius-lg:     20px;
    --radius-pill:   999px;

    --transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
    --shadow-md:     0 8px 24px rgba(0,0,0,0.5);
    --shadow-glow:   0 0 20px rgba(168, 85, 247, 0.2);

    /* legacy aliases (mantiene compatibilidad con otros CSS) */
    --color-bg:        var(--bg);
    --color-primary:   var(--purple);
    --color-secondary: var(--bg-elevated);
    --color-light:     var(--text);
    --color-accent:    var(--purple);
    --button-radius:   var(--radius-sm);
    --button-padding:  10px 22px;
    --button-font-size: 0.9rem;
    --button-hover-bg: var(--purple-deep);
    --button-hover-border: var(--purple);
}

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

a { color: var(--purple); text-decoration: none; transition: var(--transition); }
a:hover { color: #c084fc; }

img { max-width: 100%; height: auto; display: block; }

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple-deep); border-radius: 3px; }

/* ── Utility ──────────────────────────────────────────── */
.d-none { display: none !important; }
.text-muted { color: var(--text-muted); }

/* ── Botones ──────────────────────────────────────────── */
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

/* Botón primario */
.btn-primary, button.btn-primary {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
    box-shadow: 0 0 0 0 var(--purple-glow);
}
.btn-primary:hover, button.btn-primary:hover {
    background: var(--purple-deep);
    border-color: var(--purple-deep);
    box-shadow: 0 0 16px var(--purple-glow);
    color: #fff;
    transform: translateY(-1px);
}

/* Botón secundario */
.btn-secondary, button.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-hover);
}
.btn-secondary:hover, button.btn-secondary:hover {
    background: var(--purple-muted);
    border-color: var(--purple);
    color: var(--text);
}

/* Botón peligro */
.btn-danger, button.btn-danger {
    background: transparent;
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
    font-size: 0.8rem;
    padding: 7px 14px;
}
.btn-danger:hover, button.btn-danger:hover {
    background: rgba(248, 113, 113, 0.1);
}

button:active { transform: scale(0.97); }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
    background: rgba(13, 13, 20, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 200;
    gap: 1.5rem;
}

.logo {
    height: 52px;
    width: auto;
    flex-shrink: 0;
    transition: var(--transition);
}
.logo:hover { opacity: 0.85; }

/* ── Menu ─────────────────────────────────────────────── */
.menu-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    position: relative;
}

.menu-list {
    list-style: none;
    display: flex;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.menu-list a {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.menu-list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 1px;
    background: var(--purple);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.menu-list a:hover {
    color: var(--text);
    background: var(--purple-muted);
}
.menu-list a:hover::after { transform: scaleX(1); }

/* Hamburguesa */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.2rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    line-height: 1;
}
.menu-toggle:hover { background: var(--purple-muted); border-color: var(--border-hover); }

/* ── Popup Auth (oculto, reservado para reactivación) ─ */
.popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    z-index: 500;
}

.popup-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 2.5rem;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.popup-content input,
.popup-content select {
    width: 100%;
    padding: 10px 14px;
    margin: 6px 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: var(--transition);
}
.popup-content input:focus,
.popup-content select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-muted);
}

.popup-content button {
    width: 100%;
    margin-top: 10px;
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 3rem 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 2rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: var(--transition);
}
.footer-links a:hover { color: var(--purple); }

.footer p {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin: 0;
}

/* ── Section titles ───────────────────────────────────── */
.section-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 600;
    text-align: center;
    color: var(--text);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--purple);
    margin: 12px auto 0;
    border-radius: 1px;
}

/* ── Popup messages ───────────────────────────────────── */
.popup-message {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 600;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    border: 1px solid;
    white-space: nowrap;
}

.popup-message.success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
}
.popup-message.error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
.popup-message.warning {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.4);
    color: #fde68a;
}

/* ── Responsivo Mobile ────────────────────────────────── */
@media (max-width: 768px) {
    .topbar { padding: 0 1rem; gap: 0.75rem; }

    .menu-toggle { display: flex; }

    .menu-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        width: 220px;
        padding: 0.5rem;
        box-shadow: var(--shadow-md);
        z-index: 300;
    }

    .menu-list.active {
        display: flex;
        animation: menuSlide 0.2s ease forwards;
    }

    .menu-list a {
        font-size: 0.85rem;
        padding: 10px 14px;
        border-radius: var(--radius-sm);
    }
    .menu-list a::after { display: none; }

    .menu-container { justify-content: flex-end; }

    .section-title { margin-bottom: 2rem; }
    .footer { padding: 2rem 1.5rem; }
}

@keyframes menuSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Animaciones de entrada ───────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.5s ease forwards; }
