.page-content--welcome {
    width: 100%;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
}

.welcome-layout {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    min-height: min(1024px, 90vh);
    margin: 0 auto;
    padding: 0 1rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-hero-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: #0a0e1c;
    overflow: hidden;
}

.welcome-hero-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 14, 28, 0.28) 0%,
        rgba(10, 14, 28, 0.55) 100%
    );
}

.welcome-hero {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.page-content--welcome .card.welcome-card {
    position: relative;
    z-index: 1;
    margin-top: 50px;
    width: min(420px, calc(100% - 2rem));
    max-width: 420px;
    padding: 2rem 2rem 1.75rem;
    background: rgba(16, 20, 36, 0.78);
    border-color: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
}

.logo .lyutils-mark {
    width: 2.5rem;
    height: 2.5rem;
}

.logo__word {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--lyutils-logo);
}

.subtitle {
    color: #a0a0b0;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    background: #5865f2;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.15s;
    border: none;
    cursor: pointer;
}

.discord-btn:hover {
    background: #4752c4;
    transform: translateY(-1px);
}

.discord-btn:active {
    transform: translateY(0);
}

.discord-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    flex-shrink: 0;
}

.welcome-registered {
    margin: 1.25rem 0 0.75rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: #a0a0b0;
}

a.welcome-email-btn {
    text-decoration: none;
    box-sizing: border-box;
}

.welcome-messages {
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0;
    text-align: left;
}

.welcome-message {
    font-size: 0.85rem;
    line-height: 1.45;
    color: #c8d4f0;
}

.welcome-message--error {
    color: #f3b4b4;
}

.welcome-message--info {
    color: #b7d7c4;
}

.welcome-email-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-align: left;
}

.welcome-email-actions {
    display: flex;
    flex-direction: row;
    gap: 0.55rem;
}

.welcome-email-actions .welcome-email-btn {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 0.6rem;
    font-size: 0.85rem;
    text-align: center;
}

.welcome-label {
    font-size: 0.8rem;
    color: #a0a0b0;
}

.welcome-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #0c1018;
    color: #f2f4ff;
    font-size: 1rem;
    color-scheme: dark;
}

.welcome-input::placeholder {
    color: #6b6b7b;
}

.welcome-input:focus {
    outline: none;
    border-color: #7289da;
}

.welcome-input:-webkit-autofill,
.welcome-input:-webkit-autofill:hover,
.welcome-input:-webkit-autofill:focus,
.welcome-input:-webkit-autofill:active {
    -webkit-text-fill-color: #f2f4ff;
    caret-color: #f2f4ff;
    box-shadow: inset 0 0 0 1000px #0c1018;
    border-color: rgba(255, 255, 255, 0.16);
    transition: background-color 99999s ease-out;
}

.welcome-email-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(88, 101, 242, 0.16);
    color: #e8ecff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.welcome-email-btn:hover {
    background: rgba(88, 101, 242, 0.28);
}

.welcome-error {
    margin: 0;
    font-size: 0.8rem;
    color: #f3b4b4;
}

.welcome-email-hint {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: #a0a0b0;
    text-align: left;
}

.welcome-email-reset {
    margin-top: 0.35rem;
}

.welcome-text-btn {
    background: none;
    border: none;
    padding: 0.25rem 0;
    color: #8ec8ff;
    font-size: 0.8rem;
    cursor: pointer;
}

.welcome-text-btn:hover {
    text-decoration: underline;
}

.footer {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #6b6b7b;
}

.footer--guide {
    margin-top: 0.65rem;
}

.welcome-guide-link {
    color: #8ec8ff;
    text-decoration: none;
}

.welcome-guide-link:hover {
    text-decoration: underline;
}

/* Tablet: tighten vertical composition; keep card centered */
@media (max-width: 768px) {
    .page-content--welcome .card.welcome-card {
        margin-top: 2rem;
    }
}

/* Phone: first viewport = brand + CTA over a full-bleed hero */
@media (max-width: 640px) {
    .page-content--welcome {
        overflow: visible;
        justify-content: stretch;
        min-height: 0;
    }

    .welcome-hero {
        width: auto;
        height: 118%;
        max-width: none;
        position: absolute;
        left: 50%;
        top: 16%;
        bottom: auto;
        object-fit: cover;
        object-position: 54% 46%;
        transform: translateX(-54%);
    }

    .welcome-hero-wrap::after {
        background: linear-gradient(
            180deg,
            rgba(8, 10, 20, 0.58) 0%,
            rgba(8, 10, 20, 0.28) 42%,
            rgba(8, 10, 20, 0.18) 62%,
            rgba(8, 10, 20, 0.42) 100%
        );
    }

    .welcome-layout {
        max-width: none;
        min-height: calc(100vh - 4.5rem);
        min-height: calc(100dvh - 4.5rem);
        padding:
            max(1rem, env(safe-area-inset-top, 0px))
            max(1rem, env(safe-area-inset-right, 0px))
            1.25rem
            max(1rem, env(safe-area-inset-left, 0px));
        justify-content: flex-start;
    }

    .page-content--welcome .card.welcome-card {
        width: 100%;
        max-width: none;
        margin-top: clamp(1rem, 6vh, 2.5rem);
        padding: 1.35rem 1.15rem 1.15rem;
        text-align: center;
    }

    .logo {
        margin-bottom: 0.5rem;
    }

    .logo .lyutils-mark {
        width: 1.7rem;
        height: 1.7rem;
    }

    .logo__word {
        font-size: clamp(1.55rem, 7vw, 1.9rem);
    }

    .subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .discord-btn {
        width: 100%;
        min-height: 48px;
        padding: 0.9rem 1.25rem;
        font-size: 1.05rem;
    }

    .welcome-email-btn {
        width: 100%;
        min-height: 48px;
    }

    .welcome-email-actions .welcome-email-btn {
        width: auto;
        font-size: 0.8rem;
        padding: 0.75rem 0.45rem;
    }

    .footer {
        margin-top: 0.9rem;
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .footer--guide {
        margin-top: 0.5rem;
    }

    body:has(.page-content--welcome) .site-footer {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: 1fr;
        justify-content: center;
        gap: 0.35rem 1rem;
        padding:
            0.65rem
            max(1rem, env(safe-area-inset-right, 0px))
            max(0.65rem, env(safe-area-inset-bottom, 0px))
            max(1rem, env(safe-area-inset-left, 0px));
        background: rgba(8, 10, 18, 0.82);
    }

    body:has(.page-content--welcome) .site-footer__disclaimer {
        flex: 1 1 100%;
        text-align: center;
        font-size: 0.7rem;
        line-height: 1.35;
    }

    body:has(.page-content--welcome) .site-footer__donate {
        font-size: 0.75rem;
    }
}

/* Short phones: keep CTA above the fold */
@media (max-width: 640px) and (max-height: 700px) {
    .welcome-hero {
        height: 122%;
        top: 12%;
        object-position: 54% 48%;
    }

    .welcome-layout {
        min-height: auto;
        padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
        padding-bottom: 0.75rem;
    }

    .page-content--welcome .card.welcome-card {
        margin-top: 0.75rem;
        padding: 1.1rem 1rem 1rem;
    }

    .logo .lyutils-mark {
        width: 1.5rem;
        height: 1.5rem;
    }

    .logo__word {
        font-size: 1.45rem;
    }

    .subtitle {
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
}
