/* ===========================================================
   Variables / Reset
    =========================================================== */
:root{
    --bg-gradient-1: #f5f7fa;
    --bg-gradient-2: #c3cfe2;
    --text: #2c3e50;
    --muted: #6c757d;
    --primary: #007bff;
    --primary-dark: #0056b3;
    --success: #28a745;
    --shadow: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 8px;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Удобные правила по умолчанию для ссылок/кнопок */
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ===========================================================
   Page layout
   =========================================================== */
.login-page {
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
}

/* Контейнер формы */
.login-container {
    width: 100%;
    max-width: 700px;
    background: #fff;
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 40px;
}

/* Заголовок модального окна */
.modal-title-1 {
    text-align: center;
    margin-bottom: 30px;
}
.modal-title-1 h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    border: none;
    box-shadow: none;
    background: transparent;
}
.modal-title-1 h2::before,
.modal-title-1 h2::after { content: none; }

/* ===========================================================
   Form wrapper / layout
   =========================================================== */
.form-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.authform {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* Ряд формы: колонки, все элементы растягиваются по ширине */
.authform .row-1 {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: stretch;
    justify-content: flex-start;
}

/* ===========================================================
   Error message
   =========================================================== */
.authform .error-msg,
.test-error {
    width: 100%;
    padding: 12px 16px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius);
    text-align: center;
    font-size: 14px;
    margin-bottom: 0;
}

/* ===========================================================
   Inputs (label + floating)
   =========================================================== */
.authform .input {
    width: 100%;
    position: relative;
}

/* Само поле ввода */
.authform .input--field {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e1e5eb;
    border-radius: var(--radius);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}

/* Фокус */
.authform .input--field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,123,255,0.08);
}

/* Плавающий лейбл (сработает при placeholder=" " или при value) */
.authform .input--label {
    position: absolute;
    top: 14px;
    left: 16px;
    color: var(--muted);
    pointer-events: none;
    transition: all .18s ease;
    background: #fff;
    padding: 0 4px;
}

/* Перемещение лейбла, когда есть фокус или введено значение */
.authform .input--field:focus + .input--label,
.authform .input--field:not(:placeholder-shown) + .input--label {
    top: -8px;
    font-size: 12px;
    color: var(--primary);
}

/* ===========================================================
   Submit (кнопка)
   =========================================================== */
.authform .submit {
    width: 100%;
    text-align: center;
}

/* Кнопка стилизована как блочный элемент и растягивается */
.authform .submit--field {
    display: inline-block; /* используем inline-block, но задаём 100% ширину у контейнера */
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    margin-bottom: 15px;
    text-align: center;
}

/* Ховер-эффект */
.authform .submit--field:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,123,255,0.18);
}

/* "Забыли пароль" */
.authform .forgot-pas {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 6px;
}
.authform .forgot-pas:hover { text-decoration: underline; }

/* ===========================================================
   Registration block
   =========================================================== */
.block--auth-reg {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: var(--radius);
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.auth-reg--text { flex: 1; }
.auth-reg--title p { margin: 0 0 8px 0; font-weight: 700; font-size: 18px; color: var(--text); }
.auth-reg--text p { margin: 0; color: var(--muted); line-height: 1.5; }

.auth-reg--actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }

.auth-reg--lnk {
    display: inline-block;
    padding: 12px 24px;
    background: var(--success);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    white-space: nowrap;
}
.auth-reg--lnk:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40,167,69,0.18);
}

/* back-to-main */
.back-to-main {
    display: inline-block;
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
    text-align: center;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    font-size: 14px;
    white-space: nowrap;
}
.back-to-main:hover { transform: translateY(-2px); }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 768px) {
    .login-container { max-width: 100%; padding: 30px 20px; margin: 20px; }
    .authform { max-width: 100%; }
    .block--auth-reg { flex-direction: column; text-align: center; gap: 15px; }
    .auth-reg--actions { width: 100%; }
    .auth-reg--lnk, .back-to-main { width: 100%; max-width: 280px; }
}

@media (max-width: 640px) {
    .authform .input--field { font-size: 15px; padding: 12px 14px; }
    .authform .submit--field { font-size: 15px; padding: 12px 14px; }
    .block--auth-reg { padding: 20px; }
}

     /* Быстрое исправление — убрать временные контуры и сохранить принудительное растягивание */
 form.authform .input,
 form.authform .submit,
 form.authform .input--field,
 form.authform .submit--field,
 form.authform input[type="email"],
 form.authform input[type="password"],
 form.authform input[type="submit"],
 form.authform button {
     display: block !important;
     width: 100% !important;
     max-width: 100% !important;
     box-sizing: border-box !important;
     margin: 0 !important;
     padding-left: 16px !important;
     padding-right: 16px !important;
 }

/* Убираем возможные ограничивающие max-width из библиотек */
form.authform .submit--field,
form.authform .input--field {
    max-width: none !important;
}

/* На случай flex-родителя — дочерние элементы растягиваются */
form.authform .input,
form.authform .submit {
    align-self: stretch !important;
}

     /* Отступ слева для текста внутри input и выравнивание плавающего лейбла */
 .authform .input--field {
     padding-left: 20px !important; /* увеличь/уменьшай по вкусу */
     padding-right: 16px !important;
     box-sizing: border-box !important;
 }

/* Сдвигаем лейбл туда же, чтобы он совпадал по X с текстом */
.authform .input--label {
    left: 40px !important;
}

/* Если у поля есть иконка слева — используем больший отступ */
.authform .input.has-icon .input--field {
    padding-left: 44px !important; /* пример: место под иконку */
}
.authform .input.has-icon .input--label {
    left: 44px !important;
}

/* Стили placeholder (опционально — изменить цвет) */
.authform .input--field::placeholder {
    color: #adb5bd; /* цвет placeholder */
    opacity: 1;
}
/* Кросс-браузерные псевдоэлементы */
.authform .input--field:-ms-input-placeholder { color: #adb5bd; }
.authform .input--field::-ms-input-placeholder { color: #adb5bd; }

/* Адаптив: на очень узких экранах можно уменьшить отступ */
@media (max-width: 640px) {
    .authform .input--field,
    .authform .input--label {
        padding-left: 14px !important;
        left: 14px !important;
    }
}

