#auth_modal_content {
    position:fixed;
    top:0;right:0;bottom:0;left:0;
    background: #000e57e3;
    z-index: 100;
    display:flex;
    align-items:center;
    justify-content:center;
}
#auth_modal_close {
    display: flex;
}
#auth_modal_close a {
    text-decoration: none;
    display: flex;
    background: #590001;
    width: max-content;
    align-items: center;
    padding: 9px;
    justify-content: center;
    letter-spacing: 3px;
    color: white;
    margin: 0 -36px 12px;
    border-radius: 3px;
    font-family: emoji;
    font-size: 15px;
}
#auth_modal_welcome {
    display: flex;
    justify-content: center;
    flex-direction: column;
}
#auth_modal_welcome h2 {
    font-family: cursive;
    letter-spacing: 3px;
    color: #000043;
}
/* Стили для блока авторизации */
.auth-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 440px;
    width:100%;
    margin: 9px;
    padding: 15px 24px 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

/* Вкладки */
.auth-tabs {
    display: flex;
    margin-bottom: 28px;
    border-bottom: 2px solid #eef2f6;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    background: #00000018;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #8b96a5;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    letter-spacing: 0.3px;
}

.auth-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #000003;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.auth-tab:hover {
    color: #1a1a1a;
}

.auth-tab.active {
    color: #1a1a1a;
}

.auth-tab.active::after {
    width: 60%;
}

/* Формы */
.auth-form {
    display: none;
    animation: authFade 0.3s ease;
}

.auth-form.active {
    display: block;
}

@keyframes authFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Поля */
.auth-field {
    margin-bottom: 18px;
}

.auth-field.optional {
    opacity: 0.7;
}

.auth-field.optional label {
    font-weight: 400;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 5px;
}

.auth-required {
    color: #e53e3e;
    font-weight: 600;
}

.auth-field input[type="email"],
.auth-field input[type="password"],
.auth-field input[type="text"],
.auth-field input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc;
    outline: none;
    box-sizing: border-box;
}

.auth-field input:focus {
    border-color: #2d7aff;
    box-shadow: 0 0 0 3px rgba(45, 122, 255, 0.15);
    background: #ffffff;
}

.auth-field input.error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12);
}

.auth-field .auth-error {
    display: none;
    font-size: 12px;
    color: #e53e3e;
    margin-top: 4px;
}

.auth-field.error .auth-error {
    display: block;
}

/* Обёртка для пароля */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper input {
    padding-right: 44px !important;
}

.auth-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-toggle-password:hover {
    opacity: 0.9;
}

.auth-toggle-password::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
}

.auth-toggle-password.active::before {
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24'/%3E%3Cline x1='1' y1='1' x2='23' y2='23'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
}

/* Дополнительные опции */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0 3px;
    font-size: 14px;
}

/* Кнопка отправки */
.auth-submit {
    width: 100%;
    padding: 14px;
    background: #020d4b;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.auth-submit:hover {
    background: #003;
}

.auth-submit:active {
    transform: scale(0.98);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Переключатель текста */
.auth-switch-text {
    text-align: center;
    margin: 18px 0 0;
    font-size: 14px;
    color: #4a5568;
}

.auth-switch-text a {
    color: #003;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch-text a:hover {
    text-decoration: underline;
}

/* Соглашение */
.auth-agreement {
    font-size: 13px;
    color: #4a5568;
    margin: 6px 0 20px;
}

.auth-agreement label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.auth-agreement input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: #590001;
}

.auth-agreement a {
    color: #590001;
    text-decoration: none;
}

.auth-agreement a:hover {
    text-decoration: underline;
}

.auth-err-server {
    font-family: cursive;
    color: #970305;
    text-align: center;
    margin-bottom: 3px;
}

/* Ссылка "Забыли пароль?" внизу */
.auth-links {
    text-align: center;
    margin-top: 16px;
}

.auth-forgot {
    color: #590001;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}

.auth-forgot:hover {
    text-decoration: underline;
}

/* Контейнер восстановления */
.auth-reset-container {
    animation: authFade 0.3s ease;
    padding: 4px 0;
}

.auth-reset-back {
    background: none;
    border: none;
    color: #590001;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.auth-reset-back:hover {
    text-decoration: underline;
}

.auth-reset-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #1a1a1a;
}

.auth-reset-desc {
    color: #4a5568;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.auth-reset-success {
    text-align: center;
    padding: 30px 0;
}

.auth-reset-success p {
    color: #38a169;
    font-weight: 500;
    font-size: 16px;
    margin: 0;
}

/* Скрываем форму восстановления и показываем сообщение */
.auth-reset-container.success .auth-reset-form {
    display: none;
}

.auth-reset-container.success .auth-reset-success {
    display: block !important;
}

/* Адаптив */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
        border-radius: 12px;
    }

    .auth-tab {
        font-size: 15px;
        padding: 10px 0;
    }

    .auth-field input {
        font-size: 14px;
        padding: 10px 12px;
    }
}