.auth-modal {
        position: fixed;
        inset: 0;
        z-index: 200;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    .auth-modal[hidden] { display: none !important; }
    .auth-modal__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.78);
        backdrop-filter: blur(8px);
    }
    .auth-modal__dialog {
        position: relative;
        width: min(400px, 100%);
        overflow: hidden;
        background: #0c0c0c;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 24px;
        padding: 28px 24px 22px;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 0, 255, 0.14), 0 18px 50px rgba(157, 0, 255, 0.22);
        animation: authModalIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .auth-modal__glow {
        pointer-events: none;
        position: absolute;
        top: -90px;
        left: 50%;
        width: 260px;
        height: 180px;
        transform: translateX(-50%);
        background: radial-gradient(circle, rgba(255, 0, 255, 0.28), rgba(157, 0, 255, 0.08) 55%, transparent 70%);
    }
    .auth-modal__close {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 2;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        color: rgba(255, 255, 255, 0.45);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.15s ease, background 0.15s ease;
    }
    .auth-modal__close svg { width: 18px; height: 18px; }
    .auth-modal__close:hover { color: #FF00FF; background: rgba(255, 0, 255, 0.12); }
    .auth-modal__head { position: relative; text-align: center; margin-bottom: 20px; }
    .auth-modal__logo img { height: 34px; margin: 0 auto 16px; }
    .auth-modal__tabs {
        position: relative;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        padding: 4px;
        margin: 0 auto 18px;
        max-width: 280px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .auth-modal__tab-pill {
        position: absolute;
        top: 4px;
        left: 4px;
        width: calc((100% - 12px) / 2);
        height: calc(100% - 8px);
        border-radius: 11px;
        background: linear-gradient(to right, #9D00FF, #FF00FF);
        box-shadow: 0 8px 20px rgba(255, 0, 255, 0.28);
        transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
        pointer-events: none;
    }
    .auth-modal__tabs[data-mode="register"] .auth-modal__tab-pill {
        transform: translateX(calc(100% + 4px));
    }
    .auth-modal__tab {
        position: relative;
        z-index: 1;
        border: 0;
        border-radius: 11px;
        padding: 9px 12px;
        font-size: 13px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.5);
        background: transparent;
        cursor: pointer;
        transition: color 0.25s ease;
    }
    .auth-modal__tab.is-active { color: #fff; }
    .auth-modal__tabs.is-hidden { display: none; }
    .auth-modal__title,
    .auth-modal__lead {
        transition: opacity 0.22s ease, transform 0.22s ease;
    }
    .auth-modal__title {
        margin: 0 0 6px;
        font-size: 22px;
        font-weight: 700;
        color: #fff;
        letter-spacing: -0.03em;
    }
    .auth-modal__lead {
        margin: 0;
        color: rgba(255, 255, 255, 0.48);
        font-size: 13px;
        line-height: 1.4;
    }
    .auth-modal__title.is-fading,
    .auth-modal__lead.is-fading {
        opacity: 0;
        transform: translateY(6px);
    }
    .auth-modal__stage {
        position: relative;
        overflow: hidden;
        transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .auth-modal__form {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        transition: opacity 0.38s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .auth-modal__form:not(.is-active) {
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        pointer-events: none;
        opacity: 0;
    }
    .auth-field { display: flex; flex-direction: column; gap: 6px; }
    .auth-field span {
        font-size: 12px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.68);
        display: flex;
        justify-content: space-between;
    }
    .auth-field em { font-style: normal; font-weight: 400; color: rgba(255, 255, 255, 0.32); }
    .auth-field__wrap { position: relative; }
    .auth-field__wrap input { padding-right: 44px; }
    .auth-field__toggle {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: rgba(255, 255, 255, 0.38);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.15s ease, background 0.15s ease;
    }
    .auth-field__toggle:hover { color: #FF00FF; background: rgba(255, 0, 255, 0.1); }
    .auth-field__toggle.is-visible { color: #FF00FF; }
    .auth-field__icon { width: 18px; height: 18px; }
    .auth-field__icon--hide { display: none; }
    .auth-field__toggle.is-visible .auth-field__icon--show { display: none; }
    .auth-field__toggle.is-visible .auth-field__icon--hide { display: block; }
    .auth-field input {
        width: 100%;
        background: #080808;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        padding: 12px 14px;
        color: #fff;
        font-size: 14px;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .auth-field input::placeholder { color: rgba(255, 255, 255, 0.26); }
    .auth-field input:focus {
        border-color: rgba(255, 0, 255, 0.55);
        box-shadow: 0 0 0 3px rgba(255, 0, 255, 0.12);
    }
    .auth-modal__submit {
        margin-top: 6px;
        width: 100%;
        border: 0;
        border-radius: 12px;
        padding: 13px 16px;
        font-size: 15px;
        font-weight: 600;
        color: #fff;
        cursor: pointer;
        background: linear-gradient(to right, #9D00FF, #FF00FF);
        box-shadow: 0 10px 24px rgba(255, 0, 255, 0.28);
        transition: opacity 0.15s ease, transform 0.15s ease;
    }
    .auth-modal__submit:hover { opacity: 0.94; transform: translateY(-1px); }
    .auth-modal__submit:disabled { opacity: 0.55; cursor: wait; transform: none; }
    .auth-modal__error {
        margin: 0;
        padding: 8px 10px;
        border-radius: 10px;
        background: rgba(255, 60, 90, 0.12);
        border: 1px solid rgba(255, 60, 90, 0.25);
        color: #ff8a9a;
        font-size: 13px;
    }
    .auth-modal__error[hidden] { display: none !important; }
    .auth-modal__ok {
        margin: 0;
        padding: 8px 10px;
        border-radius: 10px;
        background: rgba(157, 0, 255, 0.14);
        border: 1px solid rgba(255, 0, 255, 0.22);
        color: #e9c6ff;
        font-size: 13px;
        line-height: 1.4;
    }
    .auth-modal__ok[hidden] { display: none !important; }
    .auth-field__code {
        letter-spacing: 0.28em;
        text-align: center;
        font-size: 18px !important;
        font-weight: 700;
    }
    .auth-modal__switch {
        margin: 2px 0 0;
        text-align: center;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.45);
    }
    .auth-modal__switch button {
        border: 0;
        background: none;
        padding: 0;
        color: #FF00FF;
        font-weight: 600;
        cursor: pointer;
    }
    .auth-modal__switch button:hover { text-decoration: underline; }
    @keyframes authModalIn {
        from { opacity: 0; transform: translateY(16px) scale(0.96); }
        to { opacity: 1; transform: none; }
    }
    body.auth-modal-open { overflow: hidden; }
