/* ============ AUTH MODAL ============ */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.auth-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px 32px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-20px) scale(0.98);
    transition: transform 0.25s;
}

.auth-modal-overlay.open .auth-modal {
    transform: translateY(0) scale(1);
}

/* Кнопка закрытия */
.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.auth-modal-close:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

/* Логотип */
.auth-modal-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Заголовок */
.auth-modal-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 6px;
}

.auth-modal-subtitle {
    font-size: 14px;
    color: #999;
    text-align: center;
    margin: 0 0 24px;
}

/* Flash */
.auth-modal-alerts {
    margin-bottom: 16px;
}

.auth-modal-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    animation: authAlertIn 0.3s ease-out;
}

.auth-modal-alert:last-child {
    margin-bottom: 0;
}

.auth-modal-alert i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-modal-alert span {
    flex: 1;
}

.auth-modal-alert-danger {
    background: #fff0f0;
    color: #cc3344;
    border-left: 4px solid #FF4053;
}

.auth-modal-alert-danger i {
    color: #FF4053;
}
.auth-modal-alert-success {
    background: #e8f9ed;
    color: #00A046;
    border-left: 4px solid #04E061;
}

.auth-modal-alert-success i {
    color: #04E061;
}

/* Форма */
.auth-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-modal-field label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.auth-modal-optional {
    color: #999;
    font-weight: 400;
    font-size: 11px;
}

.auth-modal-alert-warning {
    background: #fff8e6;
    color: #cc8800;
    border-left: 4px solid #FFB800;
}

.auth-modal-alert-warning i {
    color: #FFB800;
}

.auth-modal-alert-info {
    background: #e8f4ff;
    color: #0088cc;
    border-left: 4px solid #00AAFF;
}

.auth-modal-alert-info i {
    color: #00AAFF;
}

@keyframes authAlertIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Телефон */
.auth-modal-phone {
    display: flex;
    align-items: center;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-modal-phone:focus-within {
    border-color: #00AAFF;
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.12);
}

.auth-modal-phone-prefix {
    padding: 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    background: #f8f8f8;
    border-right: 1px solid #e8e8e8;
    line-height: 46px;
}

.auth-modal-phone input {
    flex: 1;
    border: none;
    padding: 0 14px;
    font-size: 15px;
    height: 46px;
    outline: none;
    background: transparent;
}

/* Обычные поля */
.auth-modal-field > input {
    width: 100%;
    padding: 0 14px;
    height: 46px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-modal-field > input:focus {
    border-color: #00AAFF;
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.12);
}

/* Пароль */
.auth-modal-password {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-modal-password input {
    width: 100%;
    padding: 0 44px 0 14px;
    height: 46px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-modal-password input:focus {
    border-color: #00AAFF;
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.12);
}

.auth-modal-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    font-size: 16px;
}

.auth-modal-password-toggle:hover {
    color: #1a1a1a;
    background: #f0f0f0;
}

/* Индикатор силы */
.auth-modal-strength {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.auth-modal-strength-bar {
    flex: 1;
    height: 3px;
    background: #e8e8e8;
    border-radius: 2px;
    transition: background 0.2s;
}

.auth-modal-strength-bar.weak { background: #FF4053; }
.auth-modal-strength-bar.medium { background: #FFB800; }
.auth-modal-strength-bar.strong { background: #04E061; }

/* Подсказки */
.auth-modal-hint {
    font-size: 12px;
    color: #999;
}

.auth-modal-hint-error {
    color: #FF4053;
    font-weight: 600;
}

/* Чекбоксы */
.auth-modal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-modal-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1a1a1a;
    cursor: pointer;
    user-select: none;
}

.auth-modal-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: #00AAFF;
    cursor: pointer;
}

.auth-modal-checkbox-block {
    margin: 4px 0;
}

/* Ссылки */
.auth-modal-link {
    color: #00AAFF;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.auth-modal-link:hover {
    color: #0088cc;
    text-decoration: underline;
}

/* Кнопка */
.auth-modal-submit {
    width: 100%;
    height: 50px;
    background: #00AAFF;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.auth-modal-submit:hover {
    background: #0088cc;
}

.auth-modal-submit:active {
    transform: scale(0.98);
}

.auth-modal-submit:disabled {
    background: #c0c0c0;
    cursor: not-allowed;
}

.auth-modal-submit-spinner i {
    animation: authSpin 0.8s linear infinite;
    display: inline-block;
}

@keyframes authSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Переключение */
.auth-modal-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #666;
}

.auth-modal-switch a {
    color: #00AAFF;
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.auth-modal-switch a:hover {
    text-decoration: underline;
}

.auth-modal-required {
    color: #FF4053;
}

.auth-modal-optional {
    color: #999;
    font-weight: 400;
    font-size: 11px;
}

/* Адаптив */
@media (max-width: 576px) {
    .auth-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .auth-modal {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        padding: 32px 24px 24px;
        transform: translateY(100%);
    }

    .auth-modal-overlay.open .auth-modal {
        transform: translateY(0);
    }

    .auth-modal-title {
        font-size: 22px;
    }
}

/* ============================================================
   ЭКРАН ПОДТВЕРЖДЕНИЯ EMAIL
   ============================================================ */
.auth-modal-verify {
    text-align: center;
    padding: 8px 0;
}

.auth-modal-verify-icon {
    font-size: 64px;
    color: #00AAFF;
    margin-bottom: 16px;
    animation: authVerifyPulse 2s infinite;
}

@keyframes authVerifyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.auth-modal-verify-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
}

.auth-modal-verify-text {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.5;
}

.auth-modal-verify-email {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f9ff;
    border: 1px solid #d0e8ff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #0088cc;
    margin-bottom: 16px;
    word-break: break-all;
    max-width: 100%;
}

.auth-modal-verify-hint {
    font-size: 13px;
    color: #999;
    margin: 0 0 24px;
    line-height: 1.5;
}

.auth-modal-verify-resend-info {
    margin-top: 12px;
    padding: 10px 14px;
    background: #e8f9ed;
    color: #00A046;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    animation: authAlertIn 0.3s ease-out;
}

@media (max-width: 576px) {
    .auth-modal-verify-icon {
        font-size: 52px;
    }
    .auth-modal-verify-title {
        font-size: 20px;
    }
    .auth-modal-verify-email {
        font-size: 14px;
        padding: 8px 16px;
    }
}