/* ===== Auth modals — переписано под макеты (Frame 4704 и пр.) =====
 * Белая карточка, sans-serif заголовок по центру, инпуты-pill, синяя primary
 * кнопка + outline ghost, мелкий чекбокс с синими ссылками. */

.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 17, 13, 0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.auth-modal {
    position: relative;
    width: min(100%, 420px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 36px 36px 32px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    animation: auth-modal-in 0.18s ease;
}

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

.auth-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #b1aea7;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.12s ease, color 0.12s ease;
}

.auth-modal__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2b2925;
}

.auth-modal__title {
    margin: 0 0 22px;
    font-family: inherit;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: #2b2925;
}

.auth-modal__title--center {
    text-align: center;
}

/* Топ-сообщение «Для скачивания… необходимо войти» — выводится над полями login. */
.auth-modal__top-message {
    margin: -8px 0 18px;
    color: #5C5851;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.auth-modal__subtitle {
    margin: -10px 0 18px;
    color: #6b6b6b;
    font-size: 14px;
    line-height: 1.5;
}

.auth-modal__subtitle--center {
    text-align: center;
}

.auth-modal__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-modal__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-modal__input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1px solid #dcdad6;
    border-radius: 12px;
    background: #fff;
    color: #2b2925;
    font: inherit;
    font-size: 15px;
    line-height: 1.2;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

/* height ставим с запасом для font-size:15px + padding:12px*2 + border:1px*2,
   иначе у нативного <select> текст обрезается по горизонтали (видны только
   верхние половинки букв). 46px — минимум, при котором ничего не режется. */
.auth-modal__input:not(textarea)  {
    height: 46px;
    @media (width < 576px) {
        height: 50px;
    }
}

.auth-modal__input::placeholder {
    color: #b1aea7;
}

.auth-modal__input:focus {
    outline: none;
    border-color: #869ec0;
    box-shadow: 0 0 0 3px rgba(134, 158, 192, 0.18);
}

.auth-modal__input.has-error,
.auth-modal__input--error {
    border-color: #c75454;
    box-shadow: 0 0 0 3px rgba(199, 84, 84, 0.14);
}

/* AreaSearchSelect / PhoneInput / DatePicker внутри модалки получают тот же стиль:
   у них уже стоит class="auth-modal__input" через input-class prop, но AreaSearchSelect
   рендерит свой <input> сам. Перебиваю в его дереве. */
.auth-modal__form .area-search-select__input {
    padding: 12px 16px;
    border: 1px solid #dcdad6;
    border-radius: 12px;
    font-size: 15px;
}

.auth-modal__form .area-search-select.has-clear .area-search-select__input {
    padding-right: 38px;
}

.auth-modal__form .area-search-select__input:focus {
    border-color: #869ec0;
    box-shadow: 0 0 0 3px rgba(134, 158, 192, 0.18);
}

/* DatePicker иконка — подогнана к pill-инпуту */
.auth-modal__form .date-picker__icon {
    color: #b1aea7;
}

.auth-modal__error {
    margin: 0;
    padding: 0 4px;
    color: #c75454;
    font-size: 12px;
}

.auth-modal__hint {
    margin: 0;
    color: #6b6b6b;
    font-size: 12px;
    line-height: 1.45;
}

/* === Password input + eye === */

.auth-modal__password {
    position: relative;
}

.auth-modal__password .auth-modal__input {
    padding-right: 44px;
}

.auth-modal__eye {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b1aea7;
    cursor: pointer;
    border-radius: 50%;
}

.auth-modal__eye:hover {
    color: #2b2925;
    background: rgba(0, 0, 0, 0.05);
}

/* === «Забыли пароль?» === */

.auth-modal__inline-link {
    margin: -2px 0 0;
    text-align: right;
}

.auth-modal__link {
    border: 0;
    background: transparent;
    color: #869ec0;
    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.auth-modal__link:hover {
    color: #5878a6;
}

/* === Чекбокс согласия === */

.auth-modal__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 6px;
    font-size: 13px;
    color: #4a4742;
    line-height: 1.4;
    cursor: pointer;
}

.auth-modal__check input {
    margin-top: 3px;
    flex-shrink: 0;
}

.auth-modal__check a {
    color: #869ec0;
    text-decoration: underline;
}

.auth-modal__check a:hover {
    color: #5878a6;
}

/* === Общая ошибка над кнопкой === */

.auth-modal__flash {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.auth-modal__flash--error {
    background: rgba(199, 84, 84, 0.12);
    color: #c75454;
}

.auth-modal__flash--success {
    background: rgba(72, 158, 96, 0.14);
    color: #2f7d49;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

/* === Кнопки === */

.auth-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.auth-modal__actions--center {
    justify-content: center;
}

.auth-modal__actions--column {
    flex-direction: column;
}

.auth-modal__primary,
.auth-modal__ghost {
    flex: 1 1 auto;
    padding: 12px 18px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    border: 1px solid transparent;
}

.auth-modal__primary {
    background: #869ec0;
    color: #fff;
    border-color: #869ec0;
}

.auth-modal__primary:hover:not(:disabled) {
    background: #6f8db8;
    border-color: #6f8db8;
}

.auth-modal__primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Опасное основное действие (delete-confirm и т.п.) — красная primary-кнопка. */
.auth-modal__primary--danger {
    background: #c75454;
    border-color: #c75454;
}

.auth-modal__primary--danger:hover:not(:disabled) {
    background: #b04545;
    border-color: #b04545;
}

.auth-modal__ghost {
    background: #fff;
    color: #2b2925;
    border-color: #2b2925;
}

.auth-modal__ghost:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.04);
}

.auth-modal__ghost:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Honeypot: визуально скрыт off-screen, screen-reader тоже игнорирует
   (aria-hidden=true в шаблоне). Реальный юзер не видит и не заполняет. */
.auth-modal__honeypot {
    position: absolute;
    left: -10000px;
    top: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
}

/* На узких экранах — модалка занимает почти весь экран */
@media (max-width: 480px) {
    .auth-modal {
        padding: 28px 22px 24px;
    }
}
