/* ================================================
   EVENTOS ADD — Splash & Pantalla Éxito
   Design System: Onboarding (Negro/Blanco + Acento #a3f307)
   Compat: iOS Safari 14+, Android Chrome 88+, Edge, Firefox
   ================================================ */

:root {
    --es-accent:    #a3f307;
    --es-black:     #000000;
    --es-white:     #ffffff;
    --es-gray-900:  #1a1a1a;
    --es-gray-700:  #404040;
    --es-gray-500:  #737373;
    --es-radius:    16px;
    --es-radius-sm: 12px;
}

/* ================================================
   WELCOME SPLASH
   Flow: Negro → humo/pintura → blanco + partículas
   ================================================ */

#welcomeSplash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    transition: opacity 0.7s ease-out;
}

#welcomeSplash.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Smoke blobs — mix-blend-mode: screen crea efecto luz sobre negro */
.splash-smoke-blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
}

.splash-blob-1 {
    width: 130vw;
    height: 130vw;
    top: -35%;
    left: -25%;
    background: radial-gradient(circle at 40% 40%,
        rgba(255,255,255,0.92) 0%,
        rgba(210,210,210,0.45) 38%,
        transparent 68%);
    animation: smokeExpand1 2.2s 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.splash-blob-2 {
    width: 110vw;
    height: 110vw;
    bottom: -25%;
    right: -20%;
    background: radial-gradient(circle at 60% 60%,
        rgba(255,255,255,0.88) 0%,
        rgba(190,190,190,0.38) 42%,
        transparent 68%);
    animation: smokeExpand2 2.4s 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.splash-blob-3 {
    width: 90vw;
    height: 90vw;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center,
        rgba(255,255,255,0.82) 0%,
        rgba(220,220,220,0.32) 48%,
        transparent 70%);
    animation: smokeExpand3 2.6s 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.splash-blob-4 {
    width: 100vw;
    height: 100vw;
    top: 5%;
    right: -25%;
    background: radial-gradient(circle at 50% 50%,
        rgba(163,243,7,0.18) 0%,
        rgba(255,255,255,0.55) 38%,
        transparent 68%);
    animation: smokeExpand4 2.8s 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes smokeExpand1 {
    0%   { opacity: 0; transform: scale(0.35) translate(-8%, -8%); }
    25%  { opacity: 0.75; }
    100% { opacity: 0.95; transform: scale(1) translate(0%, 0%); }
}

@keyframes smokeExpand2 {
    0%   { opacity: 0; transform: scale(0.28) translate(10%, 10%); }
    25%  { opacity: 0.65; }
    100% { opacity: 0.9; transform: scale(1) translate(0%, 0%); }
}

@keyframes smokeExpand3 {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
    35%  { opacity: 0.55; }
    100% { opacity: 0.88; transform: translate(-50%, -50%) scale(1); }
}

@keyframes smokeExpand4 {
    0%   { opacity: 0; transform: scale(0.32) translate(8%, -8%); }
    30%  { opacity: 0.48; }
    100% { opacity: 0.78; transform: scale(1) translate(0%, 0%); }
}

/* Overlay blanco que revela el fondo final */
.splash-bg-white {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    animation: splashWhiteReveal 1.1s 1.9s ease-in-out forwards;
}

@keyframes splashWhiteReveal {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* Partículas tipo focos de fiesta difusos (sobre el blanco) */
.splash-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(45px);
    opacity: 0;
}

.sp-1 {
    width: 38vw;
    height: 38vw;
    top: -2%;
    left: -5%;
    background: rgba(163, 243, 7, 0.38);
    animation: particleFloat 5s 2.6s ease-in-out infinite;
}

.sp-2 {
    width: 28vw;
    height: 28vw;
    top: 12%;
    right: -4%;
    background: rgba(236, 72, 153, 0.26);
    animation: particleFloat 5.5s 2.9s ease-in-out infinite;
}

.sp-3 {
    width: 42vw;
    height: 42vw;
    bottom: 5%;
    left: 8%;
    background: rgba(245, 158, 11, 0.22);
    animation: particleFloat 6s 3.2s ease-in-out infinite;
}

.sp-4 {
    width: 24vw;
    height: 24vw;
    bottom: 18%;
    right: 6%;
    background: rgba(99, 102, 241, 0.22);
    animation: particleFloat 4.5s 3.5s ease-in-out infinite;
}

@keyframes particleFloat {
    0%   { opacity: 0; transform: translateY(0) scale(1); }
    15%  { opacity: 1; }
    50%  { opacity: 0.82; transform: translateY(-18px) scale(1.06); }
    85%  { opacity: 1; }
    100% { opacity: 0.7; transform: translateY(0) scale(1); }
}

/* Contenido brutalista */
.splash-content {
    position: relative;
    z-index: 10;
    text-align: center;
    opacity: 0;
    animation: splashContentReveal 0.65s 2.5s ease-out forwards;
}

@keyframes splashContentReveal {
    0%   { opacity: 0; transform: translateY(18px); }
    100% { opacity: 1; transform: translateY(0); }
}

.splash-greeting {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(4rem, 18vw, 8rem);
    font-weight: 900;
    letter-spacing: -6px;
    line-height: 0.92;
    color: #000;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.splash-name {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(1.1rem, 4.5vw, 1.9rem);
    font-weight: 400;
    color: var(--es-gray-700);
    letter-spacing: -0.3px;
    font-size: 2rem;
}


/* ================================================
   PANTALLA ÉXITO EVENTO
   Flow: Negro + GIF (placebo 1.8s) → humo → blanco
         + confeti + microcopy + botones Onboarding
   ================================================ */

#pantalla-exito-evento {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    display: block !important;
    overflow: hidden !important;
    background: #000;
    /* Fix Bootstrap scrollbar-compensation padding */
    padding-right: 0 !important;
}

#pantalla-exito-evento .modal-dialog {
    /* Override Bootstrap --bs-modal-margin y default width:auto */
    margin: 0 auto !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100% !important;
    position: relative;
    z-index: 10;
    --bs-modal-margin: 0;
}

#pantalla-exito-evento .modal-content {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

#pantalla-exito-evento .modal-body {
    width: 100% !important;
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    position: relative;
    box-sizing: border-box;
}

/* Smoke blobs para pantalla éxito (activados por JS) */
.exito-smoke-blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    pointer-events: none;
    will-change: transform, opacity;
    opacity: 0;
}

.exito-blob-1 {
    width: 130vw;
    height: 130vw;
    top: -35%;
    left: -25%;
    background: radial-gradient(circle at 40% 40%,
        rgba(255,255,255,0.92) 0%,
        rgba(210,210,210,0.45) 38%,
        transparent 68%);
}

.exito-blob-2 {
    width: 110vw;
    height: 110vw;
    bottom: -25%;
    right: -20%;
    background: radial-gradient(circle at 60% 60%,
        rgba(255,255,255,0.88) 0%,
        rgba(190,190,190,0.38) 42%,
        transparent 68%);
}

.exito-blob-3 {
    width: 90vw;
    height: 90vw;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center,
        rgba(163,243,7,0.18) 0%,
        rgba(255,255,255,0.82) 40%,
        transparent 70%);
}

/* Animaciones de humo activadas por JS con clase .smoke-on */
.exito-smoke-blob.smoke-on.eb-1 {
    animation: exitoSmoke1 1.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.exito-smoke-blob.smoke-on.eb-2 {
    animation: exitoSmoke2 1.8s 0.15s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.exito-smoke-blob.smoke-on.eb-3 {
    animation: exitoSmoke3 2.1s 0.35s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes exitoSmoke1 {
    0%   { opacity: 0; transform: scale(0.35) translate(-8%, -8%); }
    30%  { opacity: 0.8; }
    100% { opacity: 0.95; transform: scale(1) translate(0%, 0%); }
}

@keyframes exitoSmoke2 {
    0%   { opacity: 0; transform: scale(0.28) translate(10%, 10%); }
    30%  { opacity: 0.7; }
    100% { opacity: 0.9; transform: scale(1) translate(0%, 0%); }
}

@keyframes exitoSmoke3 {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
    40%  { opacity: 0.6; }
    100% { opacity: 0.88; transform: translate(-50%, -50%) scale(1); }
}

/* Overlay blanco de revelación */
#exitoBgWhite {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.95s ease-in-out;
    z-index: 1;
}

#exitoBgWhite.reveal {
    opacity: 1;
}

/* Partículas focos de fiesta */
.exito-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(55px);
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
    z-index: 2;
}

.ep-1 { width: 40vw; height: 40vw; top: -2%;  left: -5%;  background: rgba(163, 243, 7,  0.35); }
.ep-2 { width: 30vw; height: 30vw; top: 10%;  right: -5%; background: rgba(236, 72,  153, 0.24); }
.ep-3 { width: 45vw; height: 45vw; bottom: 4%; left: 8%;  background: rgba(245, 158, 11, 0.22); }
.ep-4 { width: 26vw; height: 26vw; bottom: 14%;right: 5%; background: rgba(99,  102, 241, 0.22); }

.exito-particle.ep-visible {
    opacity: 1;
}

/* ---- Fase 1: Placebo (GIF + dots) ---- */
.exito-fase-1 {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    transition: opacity 0.55s ease-out;
}

.exito-fase-1.oculta {
    opacity: 0;
    pointer-events: none;
}

.gif-celebracion {
    max-width: 260px;
    width: 82%;
    height: auto;
    border-radius: 20px;
}

.exito-placebo-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.98rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.2px;
}

.placebo-dots span {
    display: inline-block;
    animation: dotBlink 1.4s ease-in-out infinite;
}

.placebo-dots span:nth-child(2) { animation-delay: 0.22s; }
.placebo-dots span:nth-child(3) { animation-delay: 0.44s; }

@keyframes dotBlink {
    0%, 80%, 100% { opacity: 0.25; }
    40%            { opacity: 1; }
}

/* ---- Fase 2: Éxito (título + botones) ---- */
.exito-fase-2 {
    position: relative;
    z-index: 10;
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    opacity: 0;
    display: none;
    transition: opacity 0.7s ease-out;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

.exito-fase-2.visible {
    opacity: 1;
}

/* Barra acento encima del título */
.exito-fase-2::before {
    content: '';
    display: block;
    width: 40px;
    height: 5px;
    background: var(--es-accent);
    margin: 0 auto 1rem;
    border-radius: 3px;
}

.titulo-exito {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(2rem, 7.5vw, 3rem);
    font-weight: 900;
    letter-spacing: -3.5px;
    line-height: 1.0;
    color: var(--es-black);
    margin-bottom: 0.65rem;
}

.mensaje-exito {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    color: var(--es-gray-700);
    line-height: 1.55;
    margin-bottom: 1.75rem;
}

/* Acento verde en el @usuario del mensaje */
.mensaje-exito strong {
    color: var(--es-accent);
    -webkit-text-stroke: 0.4px var(--es-black);
    font-weight: 800;
    font-size: 2rem;
}

/* ---- Botones estilo Onboarding + hover cómic ---- */

.btn-exito-primario,
.btn-exito-secundario {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: var(--es-radius);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.96rem;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid var(--es-black);
    cursor: pointer;
    gap: 0.25rem;
    -webkit-tap-highlight-color: transparent;
    transition:
        background   0.18s ease,
        color        0.18s ease,
        box-shadow   0.18s ease,
        border-color 0.18s ease,
        transform    0.12s ease;
}

.btn-exito-primario {
    background: var(--es-black);
    color: var(--es-white);
    margin-bottom: 0.75rem;
}

.btn-exito-primario small {
    font-weight: 400;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.18s ease;
}

.btn-exito-primario:hover,
.btn-exito-primario:focus-visible {
    background: var(--es-accent);
    color: var(--es-black);
    border-color: var(--es-black);
    box-shadow: 4px 4px 0 0 var(--es-black);
    text-decoration: none;
    transform: translate(-1px, -1px);
}

.btn-exito-primario:hover small,
.btn-exito-primario:focus-visible small {
    color: var(--es-black);
}

.btn-exito-secundario {
    background: var(--es-white);
    color: var(--es-black);
    margin-bottom: 1.25rem;
}

.btn-exito-secundario small {
    font-weight: 400;
    font-size: 0.82rem;
    color: var(--es-gray-500);
    transition: color 0.18s ease;
}

.btn-exito-secundario:hover,
.btn-exito-secundario:focus-visible {
    background: var(--es-accent);
    color: var(--es-black);
    border-color: var(--es-black);
    box-shadow: 4px 4px 0 0 var(--es-black);
    text-decoration: none;
    transform: translate(-1px, -1px);
}

.btn-exito-secundario:hover small,
.btn-exito-secundario:focus-visible small {
    color: var(--es-black);
}

.link-discreto-exito {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.88rem;
    color: var(--es-gray-500);
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s ease;
}

.link-discreto-exito:hover {
    color: var(--es-black);
    text-decoration: underline !important;
}

/* Confeti z-index sobre pantalla */
.confetti-piece {
    position: fixed;
    pointer-events: none;
    z-index: 100001;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 480px) {
    .splash-greeting {
        letter-spacing: -4px;
    }

    .titulo-exito {
        font-size: 1.85rem;
        letter-spacing: -2.5px;
    }

    .gif-celebracion {
        max-width: 200px;
    }

    .btn-exito-primario,
    .btn-exito-secundario {
        padding: 0.9rem 1.2rem;
    }

    .exito-fase-2 {
        padding: 0 1rem;
    }
}

@media (min-width: 768px) {
    .sp-1, .sp-2, .sp-3, .sp-4,
    .ep-1, .ep-2, .ep-3, .ep-4 {
        width: 22vw;
        height: 22vw;
    }
}
