/* =========================================================
   Crowd Cloud welcome pages — iOS/Safari + iframe safe
   App-shellen håndterer enhedens safe areas og bundnavigation.
   Denne CSS håndterer kun modulets egen iframe-viewport.
   ========================================================= */

html {
    width: 100%;
    min-height: 100%;
    margin: 0;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.welcome-page {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;

    /*
     * Lad iframe-dokumentets normale viewport eje den lodrette scroll.
     * Ingen height:100%, overflow:hidden eller separat body-scroll-container.
     */
    overflow-x: clip;

    color-scheme: dark;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #ffffff;
    background-color: #111111;
}

/*
 * Erstatter background-attachment: fixed, som er ustabilt på iOS.
 * Fixed-positioneringen er relativ til iframe-vinduet, hvilket er ønsket her.
 */
body.welcome-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: #111111;
    background-image: var(--welcome-background-image, none);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

body.welcome-page .shell {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem;
}

/*
 * "Safe centering": indholdet centreres, når der er overskydende højde.
 * Er indholdet højere end iframe-vinduet, bliver auto-margin 0, og siden
 * kan scrolle naturligt fra toppen i stedet for at blive beskåret.
 */
body.welcome-page .shell > :first-child {
    margin-top: auto;
}

body.welcome-page .shell > :last-child {
    margin-bottom: auto;
}

body.welcome-page .box {
    width: min(100%, 450px);
    min-width: 0;
    max-width: 100%;
    padding: 30px 40px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

body.welcome-page .section {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

body.welcome-page .eyebrow {
    max-width: 100%;
    font-size: 0.9rem;
    line-height: 1.4;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    overflow-wrap: anywhere;
}

body.welcome-page .headline {
    max-width: 100%;
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

body.welcome-page .body {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-align: left;
    font-size: 0.98rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.94);
    overflow-wrap: anywhere;
}

body.welcome-page .body p {
    margin: 0 0 0.8rem;
}

body.welcome-page .body p:last-child {
    margin-bottom: 0;
}

body.welcome-page .body ul,
body.welcome-page .body ol {
    max-width: 100%;
    margin: 0 0 0.9rem 1.2rem;
    padding: 0;
}

body.welcome-page .body li,
body.welcome-page .body a,
body.welcome-page .body code {
    overflow-wrap: anywhere;
}

body.welcome-page .body a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

body.welcome-page .body code {
    max-width: 100%;
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.92em;
    white-space: normal;
}

body.welcome-page .body .markdown-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 10px;
    object-fit: contain;
}

body.welcome-page .powered {
    max-width: 100%;
    margin-top: 0.35rem;
    color: rgba(255, 255, 255, 0.66);
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body.welcome-page img,
body.welcome-page svg,
body.welcome-page video,
body.welcome-page canvas {
    max-width: 100%;
}

body.welcome-page button,
body.welcome-page input,
body.welcome-page select,
body.welcome-page textarea {
    max-width: 100%;
    font: inherit;
}

body.welcome-page input:not([type="file"]),
body.welcome-page select,
body.welcome-page textarea {
    font-size: 16px;
}

body.welcome-page button,
body.welcome-page label,
body.welcome-page input,
body.welcome-page select,
body.welcome-page textarea {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 560px) {
    body.welcome-page .box {
        padding: 24px 22px;
    }

    body.welcome-page .headline {
        font-size: clamp(1.8rem, 8vw, 2.7rem);
    }
}

@media (max-width: 360px) {
    body.welcome-page .shell {
        padding: 0.75rem;
    }

    body.welcome-page .box {
        padding: 22px 18px;
    }

    body.welcome-page .section {
        gap: 0.75rem;
    }

    body.welcome-page .headline {
        font-size: clamp(1.65rem, 8vw, 2.3rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}