/* =========================================
   ПЕРЕОПРЕДЕЛЕНИЕ BOOTSTRAP MODAL
   ========================================= */

/* Ширина модалки и отступы */
.auth-modal .modal-dialog{
    max-width: 960px;
    margin: 1.75rem auto; /* Центрирование по вертикали */
}

/* Гарантируем отступы 20px на мобильных */
@media (max-width: 768px){
    .auth-modal .modal-dialog{
        margin: 20px;
        max-width: calc(100% - 40px);
    }
}

/* Стили контента */
.auth-modal .modal-content{
    padding: 16px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative; /* Для абсолютного позиционирования кнопки закрытия */
    background-color: #FFF;
}

@media (min-width: 768px){
    .auth-modal .modal-content{
        padding: 40px 60px;
    }
}

/* Кнопка закрытия (переопределение btn-close) */
.auth-modal .btn-close{
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    opacity: 1;
    background-size: 1.5rem;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
}

.auth-modal .btn-close:hover{
    opacity: 0.7;
}

/* Убираем стандартные отступы Bootstrap у header/body/footer */
.auth-modal .modal-header,
.auth-modal .modal-body,
.auth-modal .modal-footer{
    padding: 0;
    border: none;
    display: block;
}

.auth-modal .modal-header{
    margin-bottom: 30px;
}

.auth-modal .form-field__label,
.auth-modal .form-field__input{
    background-color: #FFF;
}

/* =========================================
   ЗАГОЛОВОК МОДАЛКИ
   ========================================= */

.auth-modal__title{
    margin: 0;
    color: #1A3A52;
    line-height: 1.3;
}

/* =========================================
   ПЕРЕКЛЮЧАТЕЛИ РЕЖИМА
   ========================================= */

.auth-mode-switch{
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.auth-mode-switch__btn{
    padding: 8px 24px;
    border: none;
    background: rgba(16, 43, 76, 0.07);
    color: rgba(16, 43, 76, 0.5);
    font-size: 16px;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-mode-switch__btn:hover{
    background: rgba(16, 43, 76, 0.12);
    color: rgba(16, 43, 76, 0.7);
}

.auth-mode-switch__btn--active{
    background: var(--base-blue, rgba(0, 113, 186, 1));
    color: #FFF;
}

.auth-mode-switch__btn--active:hover{
    background: var(--base-blue-hover, rgba(0, 90, 150, 1));
    color: #FFF;
}

/* =========================================
   ПОЛЯ ВВОДА (FLOATING LABEL)
   ========================================= */

.form-field{
    position: relative;
    margin-bottom: 12px;
}

@media (min-width: 768px){
    .form-field{
        margin-bottom: 24px;
    }
}

.form-field__input{
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #D1D9E6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    box-sizing: border-box;
    background: white;
}

.form-field__input:focus{
    outline: none;
    border-color: var(--dark-blue, rgba(3, 56, 120, 1));
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-field__label{
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 0 8px;
    color: #999;
    font-size: 16px;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.form-field__input:focus + .form-field__label,
.form-field__input:not(:placeholder-shown) + .form-field__label{
    top: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--dark-blue, rgba(3, 56, 120, 1));
}

.form-field__input--error{
    border-color: #DC3545 !important;
    background: white !important;
}

.form-field__input--error + .form-field__label{
    top: 0 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: #DC3545 !important;
}

.form-field__error{
    color: #DC3545;
    font-size: 14px;
    padding-left: 4px;
    position: absolute;
    bottom: -24px;
    left: 4px;
    white-space: nowrap;
}

.form-field:has(.form-field__error){
    margin-bottom: 56px;
}

/* =========================================
   ПОЛЯ ВВОДА КОДА
   ========================================= */

.code-input-container{
    display: flex;
    /*gap: 12px;*/
    margin: 30px 0;
    justify-content: space-between;
    max-width: 300px;
}

.code-input-container > *{
    width: calc((100vw - 80px) / 5);
    height: 70px;
    border: 2px solid #D1D9E6;
    border-radius: 8px;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    color: #1A3A52;
}

@media all and (min-width: 360px){
    .code-input-container > *{
        width: 60px;
    }
}

.code-input-container > *:focus{
    outline: none;
    border-color: var(--dark-blue, rgba(3, 56, 120, 1));
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* =========================================
   ФОРМЫ И КНОПКИ
   ========================================= */

.auth-form{
    display: flex;
    flex-direction: column;
}

.auth-form__description{
    font-size: 16px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.auth-form__actions{
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: auto;
    flex-wrap: wrap;
}

.auth-form__submit{
    padding: 16px 40px;
    background: var(--dark-blue, rgba(3, 56, 120, 1));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-form__submit:hover:not(:disabled){
    background: var(--dark-blue-hover, rgba(2, 40, 90, 1));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.auth-form__submit:disabled{
    background: #A0AEC0;
    cursor: not-allowed;
    opacity: 0.6;
}

.auth-form__resend-btn{
    padding: 16px 40px;
    background: #A0AEC0;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
    opacity: 0.6;
    transition: all 0.2s;
}

.auth-form__resend-btn:not(:disabled){
    background: var(--dark-blue, rgba(3, 56, 120, 1));
    cursor: pointer;
    opacity: 1;
}

.auth-form__resend-btn:not(:disabled):hover{
    background: var(--dark-blue-hover, rgba(2, 40, 90, 1));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.auth-form__link{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--base-blue, rgba(3, 56, 120, 1));
    font-weight: 500;
    transition: color 0.2s;
    text-decoration: underline;
}

.auth-form__link:hover{
    color: var(--base-blue-hover, rgba(2, 40, 90, 1));
}

.auth-switch-to-register{
    font-size: 14px;
}

.auth-form__link-icon{
    width: 32px;
    height: 32px;
    vertical-align: middle;
    fill: currentColor;
    display: none;
}

@media all and (min-width: 320px){
    .auth-form__link-icon{
        display: block;
    }
}

.show-instructions-link{
    display: block;
    text-align: left;
    margin-top: 20px;
    color: var(--transparency-color, rgba(16, 43, 76, 0.5));
    text-decoration: underline;
    font-size: 14px;
}

.show-instructions-link:hover{
    color: var(--dark-blue-hover, rgba(2, 40, 90, 1));
}

/* =========================================
   УСПЕШНАЯ АВТОРИЗАЦИЯ
   ========================================= */

.auth-success__message{
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5;
}

.auth-success__actions{
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.auth-success__btn{
    padding: 16px 0;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width: 280px;
    text-align: center;
}

.auth-success__btn--primary{
    background: var(--dark-blue, rgba(3, 56, 120, 1));
    color: white;
    text-decoration: none;
}

.auth-success__btn--primary:hover{
    background: var(--dark-blue-hover, rgba(2, 40, 90, 1));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.auth-success__btn--secondary{
    background: rgba(16, 43, 76, 0.07);
    color: rgba(16, 43, 76, 0.7);
}

.auth-success__btn--secondary:hover{
    background: rgba(16, 43, 76, 0.12);
    color: rgba(16, 43, 76, 0.9);
}

/* =========================================
   ИНСТРУКЦИИ
   ========================================= */

.auth-instructions__list{
    margin: 20px 0;
    padding-left: 24px;
    color: #666;
    font-size: 16px;
    line-height: 1.8;
}

.auth-instructions__list li{
    margin-bottom: 8px;
}

/* =========================================
   АДАПТИВНОСТЬ
   ========================================= */

@media (max-width: 768px){
    .auth-modal .modal-content{
        padding: 30px 20px;
    }

    .auth-mode-switch{
        flex-direction: column;
    }

    .auth-mode-switch__btn{
        width: 100%;
    }

    .auth-form__actions{
        flex-direction: column;
        align-items: stretch;
    }

    .auth-form__submit,
    .auth-form__resend-btn{
        width: 100%;
    }

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

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

    .auth-success__btn{
        width: 100%;
    }
}
