/* ================================================================
   25-welcome.css — Módulo de Bienvenida
   Scope: .confia-welcome-scope
   Toda regla está bajo el scope o usa body.dark-mode como prefijo
   para no interferir con Divi.
   ================================================================ */

/* ── Contenedor raíz ─────────────────────────────────────────── */
.confia-welcome-scope {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    font-family: 'Inter', sans-serif !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    transition: background-color 0.3s ease, color 0.3s ease !important;
    cursor: default !important;
    z-index: 99999 !important;
}

body.dark-mode .confia-welcome-scope {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}

/* ── Canvas de partículas ────────────────────────────────────── */
.confia-welcome-scope .cwel-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* ── Paths SVG flotantes ─────────────────────────────────────── */
.confia-welcome-scope .cwel-paths {
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    z-index: 2 !important;
    opacity: 0.6 !important;
    color: #274e9d !important;
}

body.dark-mode .confia-welcome-scope .cwel-paths {
    color: #3a6bc9 !important;
    opacity: 0.8 !important;
}

.confia-welcome-scope .cwel-paths svg {
    width: 100% !important;
    height: 100% !important;
}

/* ── Overlay gradiente radial ────────────────────────────────── */
.confia-welcome-scope .cwel-overlay {
    position: absolute !important;
    inset: 0 !important;
    background: radial-gradient(circle at center, transparent 0%, rgba(255,255,255,0.8) 100%) !important;
    z-index: 3 !important;
    pointer-events: none !important;
}

body.dark-mode .confia-welcome-scope .cwel-overlay {
    background: radial-gradient(circle at center, transparent 0%, rgba(15,23,42,0.9) 100%) !important;
}

/* ── Hero (capa de contenido) ────────────────────────────────── */
.confia-welcome-scope .cwel-hero {
    position: relative !important;
    min-height: 100vh !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
}

/* ── Bloque central ──────────────────────────────────────────── */
.confia-welcome-scope .cwel-content {
    position: relative !important;
    z-index: 10 !important;
    text-align: center !important;
    max-width: 1200px !important;
    padding: 2rem !important;
    animation: cwelFadeInUp 1s ease-out !important;
    pointer-events: auto !important;
}

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

/* ── Logo imagen ─────────────────────────────────────────────── */
.confia-welcome-scope .cwel-logo {
    margin-bottom: 1.5rem !important;
}

.confia-welcome-scope .cwel-logo-img {
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Modo claro: muestra logo-light, oculta logo-dark */
.confia-welcome-scope .cwel-logo-light { display: block !important; }
.confia-welcome-scope .cwel-logo-dark  { display: none  !important; }

/* Modo oscuro: muestra logo-dark, oculta logo-light */
body.dark-mode .confia-welcome-scope .cwel-logo-light { display: none  !important; }
body.dark-mode .confia-welcome-scope .cwel-logo-dark  { display: block !important; }

/* ── Logo texto (fallback sin imagen) ───────────────────────── */
.confia-welcome-scope .cwel-logo-text {
    font-size: 5rem !important;
    font-weight: 800 !important;
    letter-spacing: -2px !important;
    margin-bottom: 0 !important;
    display: inline-block !important;
}

.confia-welcome-scope .cwel-logo-text span {
    display: inline-block !important;
    background: linear-gradient(135deg, #274e9d 0%, #3a6bc9 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.dark-mode .confia-welcome-scope .cwel-logo-text span {
    background: linear-gradient(135deg, #ffffff 0%, #3a6bc9 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ── Título animado ──────────────────────────────────────────── */
.confia-welcome-scope .cwel-title {
    font-size: 4rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 0 1.5rem !important;
    padding: 0 !important;
    color: inherit !important;
}

@media (max-width: 768px) {
    .confia-welcome-scope .cwel-title     { font-size: 2.5rem !important; }
    .confia-welcome-scope .cwel-logo-text { font-size: 3.5rem !important; }
}

.confia-welcome-scope .cwel-title-line {
    display: block !important;
    overflow: hidden !important;
    margin-bottom: 0.5rem !important;
}

.confia-welcome-scope .cwel-title-line span {
    display: inline-block !important;
    animation: cwelSlideUp 0.8s ease both !important;
}

.confia-welcome-scope .cwel-title-line:nth-child(1) span { animation-delay: 0.2s !important; }
.confia-welcome-scope .cwel-title-line:nth-child(2) span { animation-delay: 0.4s !important; }
.confia-welcome-scope .cwel-title-line:nth-child(3) span { animation-delay: 0.6s !important; }

@keyframes cwelSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Descripción ─────────────────────────────────────────────── */
.confia-welcome-scope .cwel-desc {
    font-size: 1.2rem !important;
    max-width: 600px !important;
    margin: 2rem auto !important;
    line-height: 1.6 !important;
    padding: 0 !important;
    animation: cwelFadeIn 1s ease 0.8s both !important;
    color: inherit !important;
}

@keyframes cwelFadeIn {
    from { opacity: 0; }
    to   { opacity: 0.8; }
}

/* ── Botón CTA ───────────────────────────────────────────────── */
.confia-welcome-scope .cwel-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1rem !important;
    padding: 1.2rem 3rem !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 60px !important;
    background: #274e9d !important;
    color: #ffffff !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(39, 78, 157, 0.3) !important;
    animation: cwelPulse 2s 3 !important;
    margin-top: 2rem !important;
    text-decoration: none !important;
}

@keyframes cwelPulse {
    0%   { box-shadow: 0 10px 30px rgba(39, 78, 157, 0.3); }
    50%  { box-shadow: 0 20px 40px rgba(39, 78, 157, 0.5); }
    100% { box-shadow: 0 10px 30px rgba(39, 78, 157, 0.3); }
}

.confia-welcome-scope .cwel-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.6s, height 0.6s !important;
}

.confia-welcome-scope .cwel-btn:hover {
    transform: translateY(-5px) !important;
    background: #1a3670 !important;
    box-shadow: 0 20px 40px rgba(39, 78, 157, 0.5) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.confia-welcome-scope .cwel-btn:hover::before {
    width: 300px !important;
    height: 300px !important;
}

.confia-welcome-scope .cwel-btn i {
    transition: transform 0.3s ease !important;
}

.confia-welcome-scope .cwel-btn:hover i {
    transform: translateX(10px) !important;
}

/* ── Animación de salida (al hacer clic en el botón) ─────────── */
.confia-welcome-scope.cwel-exit .cwel-content {
    animation: cwelFadeOutDown 0.6s ease forwards !important;
}

@keyframes cwelFadeOutDown {
    to { opacity: 0; transform: translateY(30px); }
}

.confia-welcome-scope.cwel-exit .cwel-paths,
.confia-welcome-scope.cwel-exit .cwel-canvas {
    opacity: 0 !important;
    transition: opacity 0.6s ease !important;
}

/* ── Iconos luna / sol del toggle ────────────────────────────── */
/* Modo claro: muestra luna, oculta sol */
.confia-welcome-scope .cwel-icon-moon { display: block  !important; }
.confia-welcome-scope .cwel-icon-sun  { display: none   !important; }

/* Modo oscuro: muestra sol, oculta luna */
body.dark-mode .confia-welcome-scope .cwel-icon-moon { display: none  !important; }
body.dark-mode .confia-welcome-scope .cwel-icon-sun  { display: block !important; }

/* ── Loader de salida (nuevo estilo login) ───────────────────── */
.confia-welcome-scope .cwel-loader {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #ffffff !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

body.dark-mode .confia-welcome-scope .cwel-loader {
    background-color: #0f172a !important;
}

.confia-welcome-scope .cwel-loader.cwel-loader-show {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.confia-welcome-scope .cwel-loader-ring {
    position: relative !important;
    width: 60px !important;
    height: 60px !important;
}

.confia-welcome-scope .cwel-loader-ring::before,
.confia-welcome-scope .cwel-loader-ring::after {
    content: '' !important;
    position: absolute !important;
    border-radius: 50% !important;
    border-style: solid !important;
}

.confia-welcome-scope .cwel-loader-ring::before {
    inset: 0 !important;
    border-width: 3px !important;
    border-color: transparent !important;
    border-top-color: #274e9d !important;
    border-right-color: rgba(39, 78, 157, 0.35) !important;
    animation: cwelSpin 0.85s linear infinite !important;
}

.confia-welcome-scope .cwel-loader-ring::after {
    inset: 10px !important;
    border-width: 3px !important;
    border-color: transparent !important;
    border-bottom-color: #274e9d !important;
    border-left-color: rgba(39, 78, 157, 0.35) !important;
    animation: cwelSpin 1.3s linear infinite reverse !important;
}

body.dark-mode .confia-welcome-scope .cwel-loader-ring::before {
    border-top-color: #6aabff !important;
    border-right-color: rgba(106, 171, 255, 0.3) !important;
}

body.dark-mode .confia-welcome-scope .cwel-loader-ring::after {
    border-bottom-color: #6aabff !important;
    border-left-color: rgba(106, 171, 255, 0.3) !important;
}

/* Reutilizamos animación existente */
@keyframes cwelSpin {
    to { transform: rotate(360deg); }
}

/* ── Toggle modo oscuro ──────────────────────────────────────── */
.confia-welcome-scope .cwel-toggle {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    z-index: 9999 !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: #274e9d !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 10px 30px rgba(39, 78, 157, 0.3) !important;
    transition: all 0.3s ease !important;
}

.confia-welcome-scope .cwel-toggle:hover {
    transform: scale(1.1) rotate(15deg) !important;
    background: #1a3670 !important;
}

/* ── Hint de interacción ─────────────────────────────────────── */
.confia-welcome-scope .cwel-hint {
    position: fixed !important;
    bottom: 2rem !important;
    left: 2rem !important;
    z-index: 9999 !important;
    background: rgba(39, 78, 157, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 40px !important;
    font-size: 0.85rem !important;
    color: #274e9d !important;
    border: 1px solid rgba(39, 78, 157, 0.2) !important;
    pointer-events: none !important;
    opacity: 0 !important;
    animation: cwelHint 4s ease-in-out forwards !important;
}

body.dark-mode .confia-welcome-scope .cwel-hint {
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

@keyframes cwelHint {
    0%   { opacity: 0; transform: translateY(10px); }
    20%  { opacity: 1; transform: translateY(0); }
    80%  { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* ── Reset Divi dentro del scope ─────────────────────────────── */
.confia-welcome-scope p,
.confia-welcome-scope h1,
.confia-welcome-scope h2,
.confia-welcome-scope h3,
.confia-welcome-scope ul,
.confia-welcome-scope li {
    margin: 0 !important;
    padding: 0 !important;
}

/* ── :active en CTA ──────────────────────────────────────────── */
.confia-welcome-scope .cwel-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 4px 14px rgba(39, 78, 157, 0.3) !important;
}

/* ── Focus visible (teclado) ─────────────────────────────────── */
.confia-welcome-scope .cwel-btn:focus-visible {
    outline: 3px solid #7aa3e8 !important;
    outline-offset: 2px !important;
}

.confia-welcome-scope .cwel-toggle:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
}

/* ── Prefers reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .confia-welcome-scope .cwel-content    { animation: none !important; }
    .confia-welcome-scope .cwel-title-line span { animation: none !important; opacity: 1 !important; transform: none !important; }
    .confia-welcome-scope .cwel-desc       { animation: none !important; opacity: 0.8 !important; }
    .confia-welcome-scope .cwel-btn        { animation: none !important; transition: background 0.1s !important; }
    .confia-welcome-scope .cwel-hint       { animation: none !important; opacity: 1 !important; }
    .confia-welcome-scope .cwel-paths *    { animation-play-state: paused !important; }
}
