/* ================================================================
   Hipnótica Mega Club — formulario público
   Estética: negro profundo, polvo dorado y anillo de luz dorada.
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

:root {
    --gold-1: #fbe7a8;
    --gold-2: #e2b65a;
    --gold-3: #b9862f;
    --gold-4: #7a5418;
    --gold-grad: linear-gradient(135deg, #fff1c1 0%, #e9c46a 28%, #b9862f 52%, #f3d488 74%, #9a6b22 100%);
    --ink: #0a0806;
    --panel: rgba(14, 11, 7, 0.78);
    --line: rgba(226, 182, 90, 0.35);
}

body {
    margin: 0;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    color: #f4ead2;
    background-color: var(--ink);
    /* Imagen subida en "config fondo" (images/fondo.jpg) con un velo oscuro para legibilidad.
       formulario.php repite esta regla con ?v=fecha del archivo para evitar la caché. */
    background-image:
        linear-gradient(rgba(8, 6, 3, 0.35), rgba(8, 6, 3, 0.55)),
        url('images/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ---- Capas decorativas (anillo de luz + polvo dorado) ---- */
.fx-ring, .fx-dust, .fx-dust-2 {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}
.fx-ring {
    top: 50%; left: 50%;
    width: 150vmax; height: 150vmax;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 36%, rgba(233, 196, 106, 0.0) 38%, rgba(233, 196, 106, 0.22) 40.5%,
                        rgba(255, 228, 160, 0.38) 41.3%, rgba(233, 196, 106, 0.16) 42.5%, transparent 46%);
    filter: blur(6px);
    opacity: 0.55;
    animation: ring-spin 40s linear infinite;
}
.fx-dust {
    inset: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, #ffe9a8 50%, transparent 51%),
        radial-gradient(1px 1px at 27% 62%, #e9c46a 50%, transparent 51%),
        radial-gradient(2px 2px at 41% 33%, #fff1c1 50%, transparent 51%),
        radial-gradient(1px 1px at 58% 12%, #e2b65a 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 66% 71%, #fbe7a8 50%, transparent 51%),
        radial-gradient(1px 1px at 79% 41%, #e9c46a 50%, transparent 51%),
        radial-gradient(2px 2px at 88% 83%, #fff1c1 50%, transparent 51%),
        radial-gradient(1px 1px at 8% 88%, #e2b65a 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 34% 91%, #fbe7a8 50%, transparent 51%),
        radial-gradient(1px 1px at 93% 9%, #e9c46a 50%, transparent 51%);
    background-size: 340px 340px;
    opacity: 0.75;
    animation: dust-twinkle 4s ease-in-out infinite;
}
.fx-dust-2 {
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, #fff1c1 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 70% 20%, #e9c46a 50%, transparent 51%),
        radial-gradient(1px 1px at 45% 75%, #fbe7a8 50%, transparent 51%),
        radial-gradient(1px 1px at 85% 60%, #e2b65a 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 10% 55%, #fff1c1 50%, transparent 51%);
    background-size: 220px 220px;
    opacity: 0.5;
    animation: dust-twinkle 5.5s ease-in-out infinite reverse, dust-drift 60s linear infinite;
}
@keyframes ring-spin   { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes dust-twinkle { 0%,100% { opacity: .35; } 50% { opacity: .85; } }
@keyframes dust-drift  { to { background-position: 220px -440px; } }

/* --- Contenedor principal --- */
.page-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 15px 90px;
    min-height: 100vh;
}

.login-link {
    align-self: flex-end;
    margin-bottom: 15px;
    padding: 8px 18px;
    background: rgba(20, 15, 8, 0.6);
    backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    border-radius: 20px;
    color: var(--gold-1);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .04em;
    transition: background 0.3s, transform 0.2s, border-color .3s;
}
.login-link:hover {
    background: rgba(226, 182, 90, 0.14);
    border-color: var(--gold-2);
    transform: scale(1.03);
}
.login-link i { margin-right: 5px; }


.alert-box {
    width: 100%;
    max-width: 420px;
    margin-bottom: 15px;
}
.alert-box .alert-error {
    background: rgba(140, 24, 12, 0.92);
    border: 1px solid rgba(255, 140, 110, 0.4);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 8px;
}
.alert-box .alert-success {
    background: rgba(20, 110, 50, 0.92);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
}


/* --- Tarjeta del formulario --- */
.form-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px 26px;
    border-radius: 18px;
    border: 1px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 0 0 1px rgba(226, 182, 90, 0.45),
        0 0 30px rgba(226, 182, 90, 0.12),
        0 18px 50px rgba(0, 0, 0, 0.7);
}

.brand {
    text-align: center;
    margin: 4px 0 22px;
}
.form-card h3 {
    margin: 0;
    font-family: 'Poiret One', 'Montserrat', sans-serif;
    font-size: 40px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1.05;
    background: var(--gold-grad);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(233, 196, 106, 0.35));
    animation: gold-shine 6s linear infinite;
}
.brand-sub {
    display: block;
    margin-top: 8px;
    font-family: 'Poiret One', 'Montserrat', sans-serif;
    font-size: 15px;
    letter-spacing: 0.6em;
    padding-left: 0.6em; /* compensa el letter-spacing para centrar */
    text-transform: lowercase;
    color: var(--gold-2);
}
.brand::after {
    content: '';
    display: block;
    width: 120px;
    height: 1px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}
@keyframes gold-shine { to { background-position: 200% center; } }


.evento-preview {
    margin-top: 6px;
    font-size: 12px;
    color: #d8c79c;
    text-align: center;
}
.evento-preview img {
    max-width: 100%;
    max-height: 280px;
    border-radius: 10px;
    margin-top: 8px;
    border: 1px solid var(--line);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}


/* --- Campos --- */
.select-wrapper {
    margin-bottom: 15px;
}
.select-wrapper select {
    width: 100%;
    height: 46px;
    padding: 8px 36px 8px 14px;
    font-size: 14px;
    font-family: inherit;
    border-radius: 12px;
    border: 1px solid var(--line);
    background-color: rgba(0, 0, 0, 0.45);
    color: #f4ead2;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23e2b65a' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6.5 6.5 6.5-6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.select-wrapper select:focus {
    border-color: var(--gold-2);
    box-shadow: 0 0 0 3px rgba(226, 182, 90, 0.18);
}
.select-wrapper select option {
    background: #15110b;
    color: #f4ead2;
}

.input-field {
    position: relative;
    margin-bottom: 15px;
}
.input-field input {
    width: 100%;
    height: 46px;
    padding: 0 14px 0 48px;
    font-size: 15px;
    font-family: inherit;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.45);
    color: #f4ead2;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.input-field input::placeholder {
    color: rgba(226, 200, 140, 0.55);
}
.input-field input:focus {
    border-color: var(--gold-2);
    box-shadow: 0 0 0 3px rgba(226, 182, 90, 0.18);
}
.input-field input[readonly] {
    opacity: 0.75;
}
/* Íconos SVG negros → dorados */
.input-field .icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    pointer-events: none;
    filter: brightness(0) saturate(100%) invert(79%) sepia(39%) saturate(658%) hue-rotate(354deg) brightness(93%) contrast(88%);
    opacity: 0.9;
}


/* --- Botón principal dorado --- */
.btn-submit {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 50px;
    margin-top: 6px;
    border: none;
    border-radius: 12px;
    background: var(--gold-grad);
    background-size: 200% auto;
    color: #1b1206;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    cursor: pointer;
    box-shadow: 0 6px 22px rgba(226, 182, 90, 0.35);
    transition: transform 0.2s, box-shadow 0.3s, background-position 0.6s;
}
.btn-submit:hover {
    transform: translateY(-2px);
    background-position: right center;
    box-shadow: 0 10px 28px rgba(226, 182, 90, 0.5);
}
.btn-submit:active {
    transform: translateY(0);
}


/* --- Sección mapa --- */
.map-section {
    margin-top: 40px;
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 0 0 1px rgba(226, 182, 90, 0.35), 0 18px 50px rgba(0, 0, 0, 0.6);
}
.map-section h4 {
    text-align: center;
    margin: 0 0 12px;
    font-family: 'Poiret One', 'Montserrat', sans-serif;
    font-size: 20px;
    letter-spacing: .12em;
    color: var(--gold-1);
    font-weight: 400;
}
.map-section h4 i { color: var(--gold-2); }
.map-section iframe {
    width: 100%;
    height: 275px;
    border: 0;
    border-radius: 12px;
    filter: saturate(0.85);
}


/* --- Botón WhatsApp --- */
.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    padding: 9px 24px;
    background: rgba(20, 15, 8, 0.75);
    color: var(--gold-1);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 30px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .04em;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s, border-color 0.2s;
}
.whatsapp-btn:hover {
    transform: scale(1.05);
    border-color: var(--gold-2);
}
.whatsapp-btn i { font-size: 18px; color: #25D366; }


.fb-widget {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
}
.fb-widget .fb-page,
.fb-widget span,
.fb-widget iframe {
    max-width: 100% !important;
}


@media (max-width: 480px) {
    .page-wrapper {
        padding: 15px 10px 50px;
    }
    .form-card {
        padding: 24px 18px;
        border-radius: 14px;
    }
    .form-card h3 {
        font-size: 32px;
    }
    .brand-sub {
        font-size: 13px;
        letter-spacing: 0.5em;
    }
    .login-link {
        font-size: 12px;
        padding: 6px 14px;
    }
    .map-section {
        padding: 15px;
    }
}

/* ============================================================
   TIPO DOCUMENTO TOGGLE (DNI / C.E.)
   ============================================================ */
.tipo-doc-toggle {
    display: flex; gap: 0.5rem; margin: 0 0 0.7rem 0;
}
.tipo-doc-btn {
    flex: 1; padding: 0.55rem 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    color: var(--gold-1); border: 1px solid var(--line);
    border-radius: 0.6rem; font-size: 0.85rem; font-weight: 600;
    font-family: inherit;
    cursor: pointer; transition: all 0.18s ease;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
}
.tipo-doc-btn:hover {
    background: rgba(226, 182, 90, 0.12);
    border-color: var(--gold-2);
}
.tipo-doc-btn.active {
    background: var(--gold-grad);
    color: #1b1206; border-color: transparent;
    box-shadow: 0 4px 14px rgba(226, 182, 90, 0.35);
}

/* ============================================================
   DNI OVERLAY — Bloqueo de pantalla durante consulta API
   ============================================================ */
.dni-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 4, 2, 0.82);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: center; justify-content: center;
    animation: dni-fade-in 0.25s ease;
}
.dni-overlay.is-active { display: flex; }

.dni-overlay-box {
    background: linear-gradient(145deg, #1a140b, #0d0a06);
    border: 1px solid rgba(226, 182, 90, 0.45);
    border-radius: 1rem;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(226, 182, 90, 0.2);
    min-width: 260px;
}
.dni-spinner {
    width: 56px; height: 56px;
    border: 4px solid rgba(226, 182, 90, 0.18);
    border-top-color: var(--gold-2);
    border-radius: 50%;
    margin: 0 auto 1.2rem;
    animation: dni-spin 0.8s linear infinite;
}
.dni-overlay-text {
    color: var(--gold-1); font-size: 1.05rem; font-weight: 600;
    margin: 0 0 0.35rem 0;
}
.dni-overlay-sub {
    color: #cdb98a; font-size: 0.82rem; margin: 0; opacity: 0.85;
}

@keyframes dni-spin {
    to { transform: rotate(360deg); }
}
@keyframes dni-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .fx-ring, .fx-dust, .fx-dust-2, .form-card h3 { animation: none; }
}
