/* ========================
   Базовые настройки (шрифты уже подключены в main.css)
   ======================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #000;
    background-color: #fcfcfc;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* ========================
   Основной контент
   ======================== */
.login-main {
    margin-top: 135px;        /* отступ под фиксированную шапку */
    padding-top: 0;
}

/* ========================
   Хлебные крошки
   ======================== */
.breadcrumbs {
    font-size: 18px;
    font-weight: 400;
    color: #929292;
    margin-bottom: 60px;
    padding-top: 0;
}

.breadcrumbs a {
    color: #929292;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #D90D26;
}

.breadcrumbs__sep {
    margin: 0 2px;
}

.breadcrumbs__current {
    color: #929292;
}

/* ========================
   Обёртка для центрирования формы
   ======================== */
.login-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 100px;   /* отступ до подвала */
}

/* ========================
   Прямоугольник формы
   ======================== */
.login-box {
    width: 600px;
    height: 529px;
    background-color: #F5f5f5;
    border-radius: 15px;
    padding: 40px 0 0;      /* верхний отступ 40px, боковые будем задавать отдельно */
    text-align: center;
}

.login-box__title {
    font-size: 25px;
    font-weight: 500;
    margin-bottom: 30px;
    color: #000;
    font-family: 'Montserrat', sans-serif;
}

.login-box__label {
    display: block;
    text-align: left;
    margin-left: 30px;
    font-size: 20px;
    font-weight: 400;
    color: #717171;
    margin-bottom: 5px;
}

.login-box__input {
    width: 540px;           /* 600 - 30*2 */
    height: 64px;
    background-color: #FCFCFC;
    border: 1px solid #9B9B9B;
    border-radius: 10px;
    padding: 20px 30px;     /* левый отступ 30px, верх/низ 20px */
    font-size: 18px;
    font-family: 'Montserrat', sans-serif;
    color: #000;
    outline: none;
    margin-bottom: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.login-box__input::placeholder {
    color: #9B9B9B;
}

.login-box__btn {
    width: 150px;
    height: 60px;
    border-radius: 10px;
    background: linear-gradient(-41deg, #D90D26, #E94055, #D90D26);
    font-size: 20px;
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
    color: #FCFCFC;
    border: none;
    cursor: pointer;
    margin-bottom: 30px;
    transition: opacity 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-box__btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.login-box__no-account {
    font-size: 20px;
    font-weight: 400;
    color: #717171;
    margin-bottom: 5px;
}

.login-box__register-link {
    font-size: 20px;
    font-weight: 400;
    color: transparent;
    background: linear-gradient(-41deg, #D90D26, #E94055, #D90D26);
    -webkit-background-clip: text;
    background-clip: text;
    text-decoration: underline;
    display: inline-block;
    margin-bottom: 40px;   /* отступ снизу */
    transition: opacity 0.3s;
}

.login-box__register-link:hover {
    opacity: 0.8;
}

/* Обёртка и иконка пароля */
.input-wrapper {
    position: relative;
    display: block;
    margin-bottom: 30px;       /* оставляем отступ снизу */
}

.password-toggle-icon {
    position: absolute;
    right: 60px;                /* отступ слева 30px */
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 2;
}

.login-box__input.input--with-icon {
    padding-right: 64px;        /* 30 + 24 + 10 */
}

/* Валидация (ошибки) */

/* Обёртка для позиционирования ошибки */
.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.login-box .input-wrapper {
    position: relative;
    display: block;          
    margin-bottom: 30px;    
}

.login-box .input-wrapper .login-box__input {
    margin-bottom: 0;
}

/* Красная обводка */
.login-box__input.error {
    border-color: #D90D26 !important;
}

/* Текст ошибки */
.login-box .field-error-text {
    position: absolute; 
    right: 35px;
    bottom: 4px;
    color: #D90D26;
    font-size: 12px;   
    padding: 0 4px;
    display: none;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
}

/* Показываем ошибку, если у соседнего инпута есть класс .error */
.login-box .input-wrapper .login-box__input.error ~ .field-error-text {
    display: block;
}

/* ========================
   Адаптивность (мобильная версия)
   ======================== */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    body {
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .container {
        max-width: 100%;
        padding: 0 16px;
        margin: 0 auto;
    }

    .login-main {
        margin-top: 83px;
        margin-bottom: 40px;
    }

    .breadcrumbs {
        font-size: 12px;
        margin-top: 0;
        margin-bottom: 30px;
    }

    /* Обёртка формы – центрирование и отступы */
    .login-wrapper {
        margin-bottom: 60px;
        padding: 0;
    }

    /* Контейнер формы */
    .login-box {
        width: 328px;
        height: 430px;
        padding: 30px 15px 30px 15px;
        border-radius: 15px;
        background-color: #F5F5F5;
        margin: 0 auto;
        margin-bottom: -10px;
    }

    /* Заголовок */
    .login-box__title {
        font-size: 20px;
        font-weight: 500;
        margin-bottom: 25px;
    }

    /* Метки полей */
    .login-box__label {
        font-size: 14px;
        margin-left: 0;
        margin-bottom: 5px;
        text-align: left;
        padding-left: 0;
    }

    /* Поля ввода */
    .login-box__input {
        width: 100%;
        height: 48px;
        padding: 12px 15px;
        font-size: 14px;
        margin-bottom: 20px;
        border-radius: 8px;
    }

    /* Иконка показа пароля */
    .password-toggle-icon {
        right: 15px;
        width: 20px;
        height: 20px;
    }

    .login-box__input.input--with-icon {
        padding-right: 45px;
    }

    /* Кнопка входа */
    .login-box__btn {
        width: 130px;
        height: 48px;
        font-size: 16px;
        margin-bottom: 25px;
        border-radius: 8px;
    }

    /* Текст "Нет аккаунта?" */
    .login-box__no-account {
        font-size: 14px;
        margin-bottom: 5px;
    }

    /* Ссылка регистрации */
    .login-box__register-link {
        font-size: 14px;
        margin-bottom: 20px;
    }

    /* Сообщения об ошибках */
    .login-box .field-error-text {
        right: 12px;
        bottom: 5px;
        font-size: 10px;
        white-space: nowrap;
    }

    /* Отступы между полями (обёртки уже имеют margin-bottom) */
    .input-wrapper {
        margin-bottom: 20px;
    }
}