:root {
    --auth-ink: var(--text, #f8fafc);
    --auth-muted: var(--muted, #9ca3af);
    --auth-border: color-mix(in srgb, var(--purple, #7c3aed) 22%, transparent);
    --auth-card: var(--alysum-ui-panel, #111827);
    --auth-gold: var(--alysum-display-mid, var(--gold, #f5d489));
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 34px 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--auth-ink);
    background:
        radial-gradient(circle at 20% 18%, color-mix(in srgb, var(--gold, #f5d489) 22%, transparent), transparent 28%),
        radial-gradient(circle at 80% 12%, color-mix(in srgb, var(--pink, #ec4899) 18%, transparent), transparent 24%),
        radial-gradient(circle at 50% 105%, var(--theme-body-spot-strong, transparent), transparent 34%),
        linear-gradient(180deg, var(--bg-gradient-top, var(--bg, var(--login-page-bg))) 0%, var(--bg, var(--login-page-bg)) 100%);
}

.auth-shell {
    width: min(100%, 920px);
}

.brand-lockup {
    margin-bottom: 18px;
    text-align: center;
    color: #fff;
}

.brand-mark {
    width: 58px;
    height: 58px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(245, 212, 137, 0.82));
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.34);
}

.brand-mark img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand-lockup h1 {
    margin: 0;
    font-size: 29px;
    letter-spacing: -0.04em;
    text-shadow: 0 2px 18px rgba(15, 23, 42, 0.35);
}

.brand-lockup p {
    margin: 6px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
}

.card {
    position: relative;
    overflow: hidden;
    background: var(--auth-card);
    padding: 26px;
    border-radius: 28px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(18px);
}

#signup-card {
    max-width: 470px;
    margin: 0 auto;
}

#onboarding-card {
    max-width: 920px;
    margin: 0 auto;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--purple-dark, #5b21b6), var(--purple, #6d28d9), var(--auth-gold));
}

h2 {
    margin: 0;
    text-align: center;
    color: var(--alysum-display-mid, var(--gold, #f5d489));
    font-size: 22px;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    margin: 7px 0 18px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.45;
}

.beta-invite-banner {
    display: none;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #4c1d95;
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    text-align: left;
}

.beta-invite-banner.visible {
    display: block;
}

.beta-invite-banner strong {
    color: #312e81;
}

.field-label {
    display: block;
    margin: 12px 0 7px;
    font-size: 12px;
    font-weight: 800;
    color: #4c1d95;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

input {
    width: 100%;
    padding: 14px 15px;
    border-radius: 15px;
    border: 1px solid #ddd6fe;
    background: rgba(255, 255, 255, 0.86);
    color: #1e1b4b;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus {
    border-color: var(--purple, #6d28d9);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.13);
}

button {
    width: 100%;
    padding: 15px 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--purple-dark, #5b21b6), var(--purple, #6d28d9));
    color: white;
    font-weight: 800;
    font-size: 15px;
    margin-top: 12px;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(109, 40, 217, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 30px rgba(109, 40, 217, 0.34);
}

button:active { transform: translateY(0) scale(0.99); }

.link {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: var(--auth-muted);
}

a {
    color: var(--purple, #6d28d9);
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    text-decoration: underline;
}

.support-footnote {
    margin: 18px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
    color: var(--auth-muted, #64748b);
}

.support-footnote a {
    color: var(--purple, #6d28d9);
    font-weight: 600;
    text-decoration: none;
}

#error-msg,
#onboarding-error-msg,
#confirm-error-msg {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

#error-msg.visible,
#onboarding-error-msg.visible,
#confirm-error-msg.visible {
    display: block;
}

#confirm-success-msg {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    color: #14532d;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
}

#confirm-success-msg.visible {
    display: block;
}

#confirm-email-card {
    max-width: 470px;
    margin: 0 auto;
}

.confirm-email-hint {
    margin: 0 0 6px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 13px;
    line-height: 1.45;
}

#confirm-email-address {
    color: #4c1d95;
    word-break: break-all;
}

#resend-confirm-btn {
    margin-top: 4px;
}

button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.account-type-label {
    display: block;
    margin: 16px 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: #4c1d95;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.account-option {
    display: flex;
    min-height: 104px;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 10px;
    padding: 12px 8px;
    border-radius: 16px;
    border: 1px solid #e9d5ff;
    cursor: pointer;
    background: rgba(250, 245, 255, 0.78);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.account-option:has(input:checked) {
    border-color: #6d28d9;
    background: #f3e8ff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(109, 40, 217, 0.12);
}

.account-option input {
    margin: 0;
    width: auto;
    accent-color: #6d28d9;
}

.account-option-text strong {
    display: block;
    font-size: 14px;
    color: #4c1d95;
    margin-bottom: 2px;
}

.account-option-text span {
    font-size: 12px;
    color: #6b21a8;
    line-height: 1.35;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.terms-copy {
    margin: 18px auto 0;
    max-width: 330px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.btn-oauth svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-oauth-discord svg {
    fill: #5865f2;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 480px) {
    body {
        padding: 12px;
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .card {
        padding: 22px;
        border-radius: 24px;
    }

    .account-options {
        grid-template-columns: 1fr;
    }

    .account-option {
        min-height: auto;
        align-items: flex-start;
        text-align: left;
        flex-direction: row;
        justify-content: flex-start;
    }
}
