/* Добавляем высоту для html и body */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.main_div {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;          /* вместо 100vh */
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;           /* прокрутка, если контент не помещается */
}

.rectangle_body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 450px;
    min-width: 280px;
    background-color: #D8C4B9;
    border-radius: 40px;
    padding: 30px 25px;
    box-sizing: border-box;
    color: #866E5E;
}

.rectangle_body--login {
    /* Наследует все стили от .rectangle_body, можно добавить свои если нужно */
}

.auth_h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 6vw, 3rem);
    text-align: center;
    margin: 0 0 20px 0;
    color: #866E5E;
}

.auth_inputs_form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 16px;
    margin-bottom: 25px;
}

.base_inputs {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #b5a296;
    border-radius: 30px;
    font-size: 1rem;
    box-sizing: border-box;
    background-color: #f5ebe6;
    color: #333;
}

.base_inputs:focus {
    outline: 2px solid #866E5E;
}

.base_btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 30px;
    background-color: #866E5E;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.base_btn:hover {
    background-color: #6b5546;
}

.base_btn--auth,
.base_btn--login {
    /* Специфические стили, если нужны, можно добавить сюда */
}

.register_labels_div {
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;         /* по умолчанию текст в одну строку */
    font-size: 1rem;
    width: 100%;
}

.register_labels_div a {
    color: #866E5E;
    text-decoration: underline;
    margin-left: 5px;
}
/* --- 2FA Styles --- */

.totp_setup_container {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 15px;
    margin-bottom: 20px;
}

.auth_h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin: 0;
    color: #866E5E;
    text-align: center;
}

.auth_subtitle {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: #866E5E;
    text-align: center;
    line-height: 1.4;
}

.qr_image {
    width: 180px;
    height: 180px;
    border-radius: 15px;
    border: 3px solid #b5a296;
    background-color: white;
    padding: 10px;
    box-sizing: border-box;
}

.manual_key {
    background-color: #f5ebe6;
    padding: 12px 15px;
    border-radius: 20px;
    font-family: monospace;
    font-weight: bold;
    font-size: 1rem;
    word-break: break-all;
    width: 100%;
    text-align: center;
    color: #5a493e;
    box-sizing: border-box;
    border: 1px solid #b5a296;
}

.totp_input {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 12px;
    font-weight: bold;
    padding: 15px !important;
}

.totp_input::placeholder {
    letter-spacing: 12px;
    color: #b5a296;
}

.base_btn--link {
    text-align: center;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
}

.base_btn--outline {
    background-color: transparent;
    border: 2px solid #866E5E;
    color: #866E5E;
    margin-top: -5px;
}

.base_btn--outline:hover {
    background-color: #f5ebe6;
}

.auth_error_msg {
    display: none;
    color: #a8423f; /* Красный цвет, вписывающийся в палитру */
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    margin: -5px 0 5px 0;
}


/* Мобильные устройства */
@media (max-width: 480px) {
    .rectangle_body {
        padding: 15px 12px;      /* уменьшил отступы */
        border-radius: 25px;
    }
    .auth_h1 {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }
    .base_inputs {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    .base_btn {
        padding: 10px;
        font-size: 0.95rem;
    }
    .register_labels_div {
        white-space: normal;      /* разрешаем перенос текста */
        flex-wrap: wrap;          /* переносим на новую строку при необходимости */
        text-align: center;
        font-size: 0.85rem;       /* чуть меньше шрифт */
    }
    .register_labels_div a {
        margin-left: 3px;
    }
}

/* Планшеты и небольшие ноутбуки */
@media (min-width: 481px) and (max-width: 1024px) {
    .rectangle_body {
        max-width: 480px;
        padding: 35px 30px;
    }
    .auth_h1 {
        font-size: 2.5rem;
    }
    .base_btn {
        font-size: 1.1rem;
    }
}

/* Большие экраны */
@media (min-width: 1025px) {
    .rectangle_body {
        max-width: 550px;
        padding: 40px 35px;
    }
    .auth_h1 {
        font-size: 2.8rem;
    }
}