#auth-modals-root {
    position: relative;
    z-index: 99999;
}

#auth-modals-root .auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#auth-modals-root.is-open .auth-overlay {
    opacity: 1;
    visibility: visible;
}

#auth-modals-root .auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    width: min(420px, calc(100vw - 32px));
    background: #323637;
    color: #fdffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

#auth-modals-root.is-open .auth-modal.is-active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%);
}

.auth-modal__header h2 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-modal__header p {
    margin: 0 0 20px;
    color: rgba(253, 255, 255, 0.72);
    font-size: 0.95rem;
}

.auth-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fdffff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

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

.auth-field {
    display: grid;
    gap: 6px;
}

.auth-field label {
    font-size: 0.875rem;
    color: rgba(253, 255, 255, 0.85);
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: #212425;
    color: #fdffff;
    font: inherit;
}

.auth-field input:focus {
    outline: none;
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.18);
}

.auth-btn {
    border: 0;
    border-radius: 10px;
    padding: 13px 16px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.auth-btn--primary {
    background: #ff6600;
    color: #212425;
}

.auth-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
}

.auth-message.is-error {
    background: rgba(220, 53, 69, 0.16);
    color: #ffb4bc;
}

.auth-message.is-success {
    background: rgba(40, 167, 69, 0.16);
    color: #b8f5c7;
}

.auth-switch {
    margin: 18px 0 0;
    text-align: center;
    color: rgba(253, 255, 255, 0.72);
    font-size: 0.9rem;
}

.auth-link {
    border: 0;
    background: transparent;
    color: #ff6600;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.auth-user-bar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 99998;
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-user-bar__name {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(50, 54, 55, 0.92);
    color: #fdffff;
    font-size: 0.85rem;
}

.auth-user-bar button {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: #ff6600;
    color: #212425;
    font-weight: 700;
    cursor: pointer;
}

.auth-trigger-bar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 99998;
    display: flex;
    gap: 8px;
    align-items: center;
}

.auth-trigger-bar.is-hidden {
    display: none;
}

.auth-trigger-bar__btn {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.auth-trigger-bar__btn--ghost {
    background: rgba(50, 54, 55, 0.92);
    color: #fdffff;
}

.auth-trigger-bar__btn--primary {
    background: #ff6600;
    color: #212425;
}
