/* ============================================================
   auth-ui.css — этап 5.4-M (19.11.2026)
   Современное оформление модальных окон авторизации
   (#authModal, #forgotPasswordModal) в стиле лендинга:
   тёмное стекло, аврора-подсветка, янтарные акценты.
   styles.css НЕ трогаем — только перекрываем точечно.
   ============================================================ */

/* ---------- Оверлей ---------- */
#authModal.modal,
#forgotPasswordModal.modal {
    background:
        radial-gradient(55% 45% at 18% 8%, rgba(232, 139, 255, 0.18), transparent 65%),
        radial-gradient(50% 45% at 88% 92%, rgba(240, 178, 122, 0.16), transparent 65%),
        rgba(4, 6, 9, 0.84);
    -webkit-backdrop-filter: blur(8px) saturate(1.1);
    backdrop-filter: blur(8px) saturate(1.1);
    padding: 3vh 1rem 5vh;
    scrollbar-width: none;
}
#authModal.modal::-webkit-scrollbar,
#forgotPasswordModal.modal::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- Панель ---------- */
#authModal .modal-content.auth-modal,
#forgotPasswordModal .modal-content.auth-modal {
    position: relative;
    width: min(420px, 100%);
    max-width: 420px;
    margin: 3vh auto;
    padding: 1.9rem 1.6rem 1.7rem;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(120% 90% at 0% 0%, rgba(240, 178, 122, 0.13), transparent 55%),
        radial-gradient(110% 90% at 100% 100%, rgba(102, 126, 234, 0.16), transparent 55%),
        linear-gradient(160deg, rgba(24, 28, 38, 0.98), rgba(13, 16, 22, 0.99));
    box-shadow:
        0 40px 90px rgba(0, 0, 0, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: #eef2f6;
    overflow: hidden;
    isolation: isolate;
    animation: authPanelIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes authPanelIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

/* мягкое свечение по верхней кромке панели */
#authModal .auth-modal::before,
#forgotPasswordModal .auth-modal::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 140%;
    height: 80%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(240, 178, 122, 0.16), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

#authModal .auth-modal > *,
#forgotPasswordModal .auth-modal > * { position: relative; z-index: 1; }

/* ---------- Закрытие ---------- */
#authModal .auth-modal .close-modal,
#forgotPasswordModal .auth-modal .close-modal {
    position: absolute;
    top: 0.75rem;
    right: 0.9rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #cfd8e3;
    font-size: 1.5rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
#authModal .auth-modal .close-modal:hover,
#forgotPasswordModal .auth-modal .close-modal:hover {
    background: rgba(240, 178, 122, 0.18);
    color: #fff;
    transform: rotate(90deg);
}

/* ---------- Вкладки-сегменты ---------- */
#authModal .auth-tabs {
    display: flex;
    gap: 0.3rem;
    margin: 0 0 1.4rem;
    padding: 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(8, 11, 15, 0.55);
}
#authModal .auth-tab {
    flex: 1 1 0;
    position: static;
    padding: 0.6rem 0.9rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #9fb0c1;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
#authModal .auth-tab::after { display: none; }
#authModal .auth-tab.active {
    color: #10151c;
    background: linear-gradient(135deg, #f6c48f, #f0a35f);
    box-shadow: 0 8px 22px rgba(240, 163, 95, 0.32);
}
#authModal .auth-tab:not(.active):hover { color: #f0d3b0; }

/* ---------- Заголовки ---------- */
#authModal .auth-form h2,
#forgotPasswordModal .auth-modal h2 {
    margin: 0 0 1.1rem;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(120deg, #f6f8fb 25%, #f0b27a 75%, #e88bff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Поля ---------- */
#authModal .auth-form .form-group,
#forgotPasswordModal .auth-modal .form-group {
    margin-bottom: 1rem;
}
#authModal .auth-form .form-group label,
#forgotPasswordModal .auth-modal .form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: #93a4b6;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
#authModal .auth-form .form-group input,
#forgotPasswordModal .auth-modal .form-group input {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 0.95rem;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(7, 10, 14, 0.65);
    color: #f2f6fa;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#authModal .auth-form .form-group input::placeholder,
#forgotPasswordModal .auth-modal .form-group input::placeholder { color: #6b7a89; }
#authModal .auth-form .form-group input:focus,
#forgotPasswordModal .auth-modal .form-group input:focus {
    outline: none;
    border-color: rgba(240, 178, 122, 0.75);
    background: rgba(12, 16, 22, 0.9);
    box-shadow: 0 0 0 3px rgba(240, 178, 122, 0.16), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- Основная кнопка ---------- */
#authModal .auth-submit,
#forgotPasswordModal .auth-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 0.35rem;
    padding: 0.85rem 1.2rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd9ac 0%, #f0b27a 45%, #e79a5c 100%);
    color: #131820;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(240, 163, 95, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
#authModal .auth-submit:hover,
#forgotPasswordModal .auth-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 18px 40px rgba(240, 163, 95, 0.38);
}
#authModal .auth-submit:active,
#forgotPasswordModal .auth-submit:active { transform: translateY(0); }

/* ---------- Разделители и соцвход ---------- */
#authModal .social-divider,
#forgotPasswordModal .social-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.15rem 0 0.85rem;
    color: #7f8fa0;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#authModal .social-divider::before,
#authModal .social-divider::after,
#forgotPasswordModal .social-divider::before,
#forgotPasswordModal .social-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

#authModal .social-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}
#authModal .social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0.55rem 0.8rem;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
    color: #e7edf4;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}
#authModal .social-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(240, 178, 122, 0.45);
    transform: translateY(-1px);
}

/* VK-виджет по центру */
#authModal #vkIdWidget,
#authModal #vkIdWidgetRegister {
    display: flex;
    justify-content: center;
    margin: 0.35rem 0;
}

/* ---------- Сообщения ---------- */
#authModal .auth-message,
#forgotPasswordModal .auth-message { margin-top: 0.9rem; }
#authModal .error-message,
#forgotPasswordModal .error-message {
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.35);
    background: rgba(255, 107, 107, 0.12);
    color: #ffb3b3;
    font-size: 0.9rem;
}
#authModal .success-message,
#forgotPasswordModal .success-message {
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(72, 199, 116, 0.35);
    background: rgba(72, 199, 116, 0.12);
    color: #a8ecc1;
    font-size: 0.9rem;
}

/* ---------- Мобильная версия ---------- */
@media (max-width: 480px) {
    #authModal.modal,
    #forgotPasswordModal.modal { padding: 1.2vh 0.6rem 2.5vh; }
    #authModal .modal-content.auth-modal,
    #forgotPasswordModal .modal-content.auth-modal {
        margin: 1.2vh auto;
        padding: 1.5rem 1.1rem 1.3rem;
        border-radius: 22px;
        max-height: 92vh;
        overflow-y: auto;
        scrollbar-width: none;
    }
    #authModal .modal-content.auth-modal::-webkit-scrollbar,
    #forgotPasswordModal .modal-content.auth-modal::-webkit-scrollbar {
        width: 0; height: 0; display: none;
    }
    #authModal .social-buttons { grid-template-columns: 1fr; }
}

/* ---------- Показать/скрыть пароль (B0.1) ---------- */
.password-field {
    position: relative;
    display: block;
}
.password-field > input {
    width: 100%;
    padding-right: 3rem !important;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #93a4b6;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}
.password-toggle:hover {
    color: #f0b27a;
    background: rgba(240, 178, 122, 0.12);
}
.password-toggle:focus-visible {
    outline: 2px solid rgba(240, 178, 122, 0.75);
    outline-offset: 2px;
}
.password-toggle[aria-pressed="true"] { color: #f0b27a; }
