.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10080;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.auth-modal.is-open,
.auth-modal[aria-hidden="false"] {
    display: flex;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .74);
    backdrop-filter: blur(8px);
}

.auth-modal__dialog {
    position: relative;
    width: min(100%, 470px);
    max-height: min(92vh, 760px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid rgba(var(--accent-rgb), .42);
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), .12), transparent 42%),
        rgba(4, 12, 15, .98);
    color: var(--text-main, #eef8f9);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .56);
}

.auth-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(var(--accent-rgb), .35);
    background: rgba(0, 0, 0, .24);
    color: var(--text-main, #eef8f9);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.auth-modal__eyebrow {
    margin-bottom: 8px;
    color: var(--accent, #22d3ee);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-modal__title {
    margin: 0 36px 8px 0;
    font-size: 28px;
    line-height: 1.05;
}

.auth-modal__text {
    margin: 0 0 20px;
    color: var(--text-muted, #9fb4ba);
    font-size: 14px;
    line-height: 1.45;
}

.auth-modal__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.auth-modal__tab,
.auth-modal__submit,
.auth-modal__google {
    min-height: 44px;
    border: 1px solid rgba(var(--accent-rgb), .35);
    background: rgba(var(--accent-rgb), .08);
    color: var(--text-main, #eef8f9);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.auth-modal__tab.is-active,
.auth-modal__submit {
    background: var(--accent, #22d3ee);
    color: var(--accent-contrast, #031014);
}

.auth-modal__google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 14px;
}

.auth-modal__google-icon {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    background: #fff;
    color: #151515;
    font-weight: 900;
}

.auth-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: var(--text-muted, #9fb4ba);
    font-size: 12px;
    text-transform: uppercase;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(var(--accent-rgb), .22);
}

.auth-modal__panel {
    display: none;
    gap: 12px;
}

.auth-modal__panel.is-active {
    display: grid;
}

.auth-modal__field {
    display: grid;
    gap: 6px;
    color: var(--text-muted, #9fb4ba);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.auth-modal__field input {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(var(--accent-rgb), .32);
    background: rgba(0, 0, 0, .25);
    color: var(--text-main, #eef8f9);
    padding: 0 12px;
    outline: none;
}

.auth-modal__field input:focus {
    border-color: var(--accent, #22d3ee);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .3);
}

.auth-modal__check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted, #9fb4ba);
    font-size: 13px;
}

.auth-modal__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-modal__submit--full {
    width: 100%;
}

.auth-modal__link {
    color: var(--accent, #22d3ee);
    font-size: 13px;
    text-decoration: none;
}

.auth-modal__error {
    color: #ff6b7a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
}

body.auth-modal-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .auth-modal {
        align-items: stretch;
        padding: 10px;
    }

    .auth-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 22px 16px;
    }

    .auth-modal__title {
        font-size: 24px;
    }

    .auth-modal__actions {
        align-items: stretch;
        flex-direction: column;
    }
}
