.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(3, 7, 18, 0.72);
    backdrop-filter: blur(10px);
    cursor: default;
}

.auth-modal__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1fr);
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--shell-border, rgba(148, 163, 184, 0.28)) 80%, transparent);
    border-radius: 8px;
    background: var(--shell-panel, #111827);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
}

.auth-modal__art {
    --auth-art-image: url("../../images/auth/auth-login-story-collage.png");
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 560px;
    padding: 40px;
    overflow: hidden;
    color: #f8fafc;
    background:
        linear-gradient(180deg, rgba(6, 9, 20, 0.16), rgba(6, 9, 20, 0.26) 42%, rgba(6, 9, 20, 0.86)),
        var(--auth-art-image) center / cover no-repeat;
}

.auth-modal__art--register {
    --auth-art-image: url("../../images/auth/auth-register-worlds-mosaic.png");
}

.auth-modal__art::before {
    content: "";
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.auth-modal__art::after {
    content: "";
    display: none;
}

.auth-modal__brand-mark {
    position: absolute;
    top: 32px;
    left: 40px;
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.54);
    font-weight: 800;
    letter-spacing: 0;
}

.auth-modal__art h2,
.auth-modal__art p {
    position: relative;
    z-index: 1;
    max-width: 360px;
}

.auth-modal__art h2 {
    margin: 0 0 18px;
    font-size: 38px;
    line-height: 1.04;
    letter-spacing: 0;
}

.auth-modal__art p {
    margin: 0;
    color: rgba(248, 250, 252, 0.78);
    line-height: 1.55;
}

.auth-modal__panel {
    position: relative;
    overflow-y: auto;
    padding: 48px;
    background: color-mix(in srgb, var(--shell-panel, #111827) 94%, #ffffff 6%);
}

.auth-modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--shell-border, rgba(148, 163, 184, 0.25));
    border-radius: 8px;
    background: transparent;
    color: var(--shell-text, #e5e7eb);
    cursor: pointer;
}

.auth-modal__header {
    margin: 0 0 22px;
}

.auth-modal__eyebrow {
    margin: 0 0 8px;
    color: var(--shell-muted, #94a3b8);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-modal__header h2 {
    margin: 0;
    color: var(--shell-text, #f8fafc);
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: 0;
}

.auth-modal__header p {
    margin: 10px 0 0;
    color: var(--shell-muted, #94a3b8);
    line-height: 1.5;
}

.auth-modal__google,
.auth-modal__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.auth-modal__google {
    gap: 10px;
    border: 1px solid var(--shell-border, rgba(148, 163, 184, 0.25));
    background: rgba(255, 255, 255, 0.04);
    color: var(--shell-text, #e5e7eb);
}

.auth-modal__google-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f8fafc;
    color: #111827;
    font-weight: 800;
}

.auth-modal__soon {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.16);
    color: #5eead4;
    font-size: 11px;
}

.auth-modal__notice,
.auth-modal__alert {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.auth-modal__notice {
    background: rgba(148, 163, 184, 0.12);
    color: var(--shell-muted, #cbd5e1);
}

.auth-modal__alert.is-error {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.auth-modal__alert.is-success {
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
}

.auth-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--shell-muted, #94a3b8);
    font-size: 13px;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--shell-border, rgba(148, 163, 184, 0.25));
}

.auth-modal__form {
    display: grid;
    gap: 14px;
}

.auth-modal__field {
    display: grid;
    gap: 7px;
    color: var(--shell-muted, #cbd5e1);
    font-size: 13px;
    font-weight: 700;
}

.auth-modal__field input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--shell-border, rgba(148, 163, 184, 0.25));
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.54);
    color: var(--shell-text, #f8fafc);
    padding: 0 12px;
    font: inherit;
}

.auth-modal__field input:focus {
    outline: 2px solid rgba(20, 184, 166, 0.42);
    outline-offset: 2px;
}

.auth-modal__remember {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    color: var(--shell-muted, #cbd5e1);
    font-size: 13px;
    line-height: 1.35;
}

.auth-modal__remember input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #14b8a6;
}

.auth-modal__remember span {
    display: grid;
    gap: 2px;
}

.auth-modal__remember strong {
    color: var(--shell-text, #f8fafc);
    font-weight: 700;
}

.auth-modal__remember small {
    color: var(--shell-muted, #94a3b8);
    font-size: 12px;
    line-height: 1.35;
}

.auth-modal__submit {
    margin-top: 4px;
    border: 0;
    background: #14b8a6;
    color: #03130f;
}

.auth-modal__submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

.auth-modal__link,
.auth-modal__footer button {
    border: 0;
    background: transparent;
    color: #5eead4;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.auth-modal__link {
    display: block;
    margin: 14px auto 0;
}

.auth-modal__footer {
    margin: 22px 0 0;
    color: var(--shell-muted, #94a3b8);
    text-align: center;
}

@media (max-width: 820px) {
    .auth-modal {
        padding: 12px;
    }

    .auth-modal__dialog {
        grid-template-columns: 1fr;
        width: min(520px, calc(100vw - 24px));
    }

    .auth-modal__art {
        display: none;
    }

    .auth-modal__panel {
        padding: 42px 22px 24px;
    }
}
