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

#legal-document-modal {
    z-index: 10020 !important;
}

.auth-modal.is-open {
    display: flex;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(14px);
}

.auth-modal__dialog {
    position: relative;
    width: min(460px, calc(100vw - 28px));
    max-height: min(760px, calc(100dvh - 28px));
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
    padding: 26px;
    color: #111827;
}

.auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    color: #94a3b8;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.auth-modal__close:hover {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #f97316;
}

.auth-modal__close svg {
    width: 18px;
    height: 18px;
}

.auth-modal__header {
    padding-right: 46px;
}

.auth-modal__brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #111827;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-modal__logo {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    color: #111827;
}

.auth-modal__logo svg {
    width: 21px;
    height: 21px;
}

.auth-modal__eyebrow {
    margin: 22px 0 6px;
    color: #f97316;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-modal__title {
    margin: 0;
    color: #111827;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
}

.auth-modal__subtitle {
    margin: 9px 0 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}

.auth-modal__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 22px 0 16px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #f8fafc;
    padding: 4px;
}

.auth-modal__tab {
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.auth-modal__tab.is-active {
    background: #fff;
    color: #111827;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.auth-modal__alert {
    margin-bottom: 14px;
    border: 1px solid #fecaca;
    border-radius: 16px;
    background: #fef2f2;
    color: #dc2626;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
}

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

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

.auth-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-modal__field {
    display: grid;
    gap: 7px;
}

.auth-modal__field span {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-modal__field input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
    color: #111827;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-modal__field input:focus {
    border-color: #fb923c;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.auth-modal__legal {
    border: 1px solid #fed7aa;
    border-radius: 18px;
    background: #fff7ed;
    padding: 13px;
}

.auth-modal__legal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.auth-modal__legal-head p {
    margin: 0 0 4px;
    color: #111827;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-modal__legal-head span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.auth-modal__legal-head button {
    min-height: 34px;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    padding: 0 12px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-modal__legal-list {
    display: grid;
    gap: 7px;
    margin-top: 11px;
}

.auth-modal__legal-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 13px;
    background: #fff;
    padding: 8px 10px;
}

.auth-modal__legal-list span {
    color: #334155;
    font-size: 12px;
    font-weight: 750;
}

.auth-modal__legal-list strong {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-modal__submit {
    min-height: 50px;
    border: 0;
    border-radius: 16px;
    background: #ff5722;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(255, 87, 34, 0.22);
    transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.auth-modal__submit:hover {
    background: #ea580c;
}

.auth-modal__submit:active {
    transform: translateY(1px);
}

.auth-modal__submit:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.auth-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 13px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.auth-modal__social {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.auth-modal__social a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.auth-modal__social a:hover {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #f97316;
}

.auth-modal__footer {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.auth-modal__footer button {
    border: 0;
    background: transparent;
    color: #111827;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

@media (max-width: 560px) {
    .auth-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .auth-modal__dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 24px;
        padding: 22px 18px;
    }

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

    .auth-modal__grid,
    .auth-modal__social {
        grid-template-columns: minmax(0, 1fr);
    }
}
