/* Carp Industries — Aviso de bienvenida (solo Inicio). <dialog id="welcomeNotice">, ver includes/partials/welcome-modal.php */

.welcome {
    width: min(34rem, calc(100vw - 2rem));
    max-width: none;
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--on-dark);
    overflow: visible;
}
.welcome::backdrop {
    background: rgb(6 35 26 / 0.58);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
    backdrop-filter: blur(6px) saturate(120%);
}
.welcome[open] { animation: welcome-in 0.75s var(--ease-out) both; }
.welcome[open]::backdrop { animation: welcome-fade 0.5s var(--ease-out) both; }
html:has(.welcome[open]) { overflow: hidden; }

.welcome-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 2rem 2rem 1.9rem;
    border: 1px solid rgb(255 255 255 / 0.1);
    border-radius: var(--radius-card);
    background: var(--forest-950);
    box-shadow: var(--shadow-float), inset 0 1px 0 rgb(255 255 255 / 0.06);
}
.welcome-card::before { content: ""; position: absolute; inset: -45%; z-index: -2; background: var(--mesh); opacity: 0.9; }
.welcome-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--grain-url);
    opacity: 0.07;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* Integraciones «sincronizando»: web → IA → resultados, con un pulso que recorre la línea */
.welcome-sync { display: block; width: 11.5rem; height: auto; margin-bottom: 1.4rem; overflow: visible; }
.welcome-sync .ws-line { fill: none; stroke: rgb(246 244 238 / 0.18); stroke-width: 1.5; stroke-dasharray: 3 5; }
.welcome-sync .ws-flow {
    fill: none;
    stroke: var(--lime);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 26 162;
    filter: drop-shadow(0 0 4px rgb(212 242 90 / 0.7));
    animation: welcome-flow 2.6s var(--ease-std) infinite;
}
.welcome-sync .ws-node rect { fill: rgb(6 35 26 / 0.85); stroke: rgb(246 244 238 / 0.22); stroke-width: 1.25; }
.welcome-sync .ws-node path { fill: none; stroke: rgb(246 244 238 / 0.75); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.welcome-sync .ws-node--core rect { fill: var(--lime); stroke: none; filter: drop-shadow(0 0 10px rgb(212 242 90 / 0.45)); }
.welcome-sync .ws-node--core path { fill: var(--forest-950); stroke: none; }

.welcome-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.38rem 0.8rem;
    border: 1px solid rgb(212 242 90 / 0.3);
    border-radius: 9999px;
    background: rgb(212 242 90 / 0.1);
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.welcome-tag i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--lime); animation: welcome-pulse 2s var(--ease-std) infinite; }

.welcome-title {
    margin-top: 1rem;
    color: var(--paper);
    font-size: clamp(1.65rem, 4.2vw, 2.15rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
.welcome-title em { font-style: normal; color: var(--lime); }
.welcome-text { margin-top: 0.95rem; color: rgb(246 244 238 / 0.84); font-size: 1rem; line-height: 1.6; }
.welcome-help { margin-top: 0.7rem; color: var(--on-dark-muted); font-size: 0.9rem; line-height: 1.55; }
.welcome-help a { color: var(--paper); text-decoration: underline; text-decoration-color: rgb(212 242 90 / 0.6); text-underline-offset: 3px; }
.welcome-help a:hover { text-decoration-color: var(--lime); }
.welcome-help a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }

.welcome-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.6rem; }

.welcome-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 50%;
    background: rgb(255 255 255 / 0.06);
    color: var(--paper);
    cursor: pointer;
    transition: background-color 0.3s var(--ease-std), border-color 0.3s var(--ease-std), transform 0.4s var(--ease-out);
}
.welcome-close:hover { background: rgb(255 255 255 / 0.14); transform: rotate(90deg); }
.welcome-close:focus-visible { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgb(212 242 90 / 0.4); }
.welcome-close svg { width: 1.05rem; height: 1.05rem; }

@keyframes welcome-in { from { opacity: 0; transform: translateY(22px) scale(0.965); } to { opacity: 1; transform: none; } }
@keyframes welcome-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes welcome-flow { from { stroke-dashoffset: 26; } to { stroke-dashoffset: -188; } }
@keyframes welcome-pulse {
    0% { box-shadow: 0 0 0 0 rgb(212 242 90 / 0.55); }
    70% { box-shadow: 0 0 0 0.55rem rgb(212 242 90 / 0); }
    100% { box-shadow: 0 0 0 0 rgb(212 242 90 / 0); }
}

/* Pantallas muy bajas (móvil en horizontal): el diálogo se desplaza */
@media (max-height: 560px) { .welcome { overflow-y: auto; } }

@media (max-width: 480px) {
    .welcome-card { padding: 1.75rem 1.3rem 1.4rem; border-radius: var(--radius-3xl); }
    .welcome-actions .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .welcome[open], .welcome[open]::backdrop, .welcome-tag i, .welcome-sync .ws-flow { animation: none; }
    .welcome-sync .ws-flow { stroke-dasharray: none; opacity: 0.55; }
    .welcome-close:hover { transform: none; }
}
