/*
 * Kaastro welcome slides: the five swipeable screens the app shows on first
 * open. Markup: components/layouts/partials/welcome-slides.blade.php.
 * Behaviour: js/welcome.js. Self-contained, so it looks the same over the
 * sign-in pages (landing.css) and the dashboard (style.css).
 *
 * Swiping is the browser's own scroll-snap, so it feels native on a phone
 * and needs no gesture code.
 */
.kw {
    --kw-bg: #ffffff;
    --kw-ink: #0d1111;
    --kw-muted: #5b6470;
    --kw-brand: #0F8249;
    --kw-brand-dark: #0C7B46;
    --kw-mint: #DDF5E9;
    --kw-dot: #d5dbe1;

    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    background: var(--kw-bg);
    color: var(--kw-ink);
    font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    opacity: 0;
    transition: opacity .3s ease;
}

.kw[hidden] { display: none; }
.kw.is-in { opacity: 1; }

html.kw-open,
html.kw-open body { overflow: hidden; }

.kw-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 4px;
    min-height: 48px;
}

.kw-logo { height: 26px; width: auto; display: block; }
.kw-logo.is-light { display: none; }

.kw-skip {
    border: 0;
    background: transparent;
    color: var(--kw-muted);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 600;
    padding: 10px 6px;
    cursor: pointer;
}

.kw-skip[hidden] { visibility: hidden; display: block; }

.kw-track {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    outline: none;
}

.kw-track::-webkit-scrollbar { display: none; }

.kw-slide {
    flex: 0 0 100%;
    box-sizing: border-box;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    text-align: center;
}

.kw-art {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 360 / 300;
    border-radius: 28px;
    overflow: hidden;
    margin-bottom: 28px;
}

.kw-art img { display: block; width: 100%; height: 100%; }

.kw-tint-mint  { background: #F0FFF8; }
.kw-tint-peach { background: #fff4ec; }
.kw-tint-lilac { background: #f3f0ff; }
.kw-tint-sky   { background: #eef8fe; }
.kw-tint-sage  { background: #DDF5E9; }

.kw-title {
    margin: 0 0 10px;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--kw-ink);
}

.kw-text {
    margin: 0;
    max-width: 340px;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--kw-muted);
}

.kw-foot {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 12px 24px 22px;
}

.kw-dots { display: flex; gap: 8px; }

.kw-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: var(--kw-dot);
    cursor: pointer;
    transition: width .25s ease, background-color .25s ease;
}

.kw-dot.is-active { width: 26px; background: var(--kw-brand); }

.kw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    min-height: 52px;
    box-sizing: border-box;
    border: 0;
    border-radius: 12px;
    background: var(--kw-brand);
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.kw-btn:hover,
.kw-btn:focus-visible { background: var(--kw-brand-dark); color: #ffffff; }

.kw-btn-ghost {
    background: transparent;
    color: var(--kw-brand);
    border: 1.5px solid var(--kw-mint);
}

.kw-btn-ghost:hover,
.kw-btn-ghost:focus-visible { background: var(--kw-mint); color: var(--kw-brand-dark); }

.kw-final { display: grid; gap: 10px; width: 100%; justify-items: center; }
.kw-final[hidden],
.kw-next[hidden] { display: none; }

/* Short phones: shrink the picture before anything else, so the buttons
   never fall below the screen. */
@media (max-height: 700px) {
    .kw-art { max-width: 300px; margin-bottom: 18px; }
    .kw-title { font-size: 1.4rem; }
    .kw-text { font-size: .92rem; }
    .kw-foot { gap: 12px; padding-bottom: 16px; }
}

@media (max-height: 580px) {
    .kw-art { max-width: 220px; margin-bottom: 12px; border-radius: 20px; }
}

[data-bs-theme="dark"] .kw {
    --kw-bg: #121619;
    --kw-ink: #ececec;
    --kw-muted: #9aa3a8;
    --kw-dot: #2c3338;
    --kw-mint: #2c3338;
}

[data-bs-theme="dark"] .kw-logo.is-dark { display: none; }
[data-bs-theme="dark"] .kw-logo.is-light { display: block; }
[data-bs-theme="dark"] .kw-btn-ghost { color: #ececec; }

@media (prefers-reduced-motion: reduce) {
    .kw, .kw-dot { transition: none; }
    .kw-track { scroll-behavior: auto; }
}
