/* login.css */
/* ===========================================================================
   === NICHÉ AUTH: FADE OUT LABELS ==========================================
   =========================================================================== */



.login-form h2 {
    color: #f0eee9;
    font-size: 36px;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0 0 40px 0; /* Уменьшили отступ под заголовком */
    text-align: left;
}

/* Группа поля ввода */
.input-group {
    position: relative;
    margin-bottom: 32px; /* ✅ БЫЛО 40px, СТАЛО 32px — поля ближе друг к другу */
    display: flex;
    align-items: center;
}

/* Иконка слева */
.input-icon-wrapper {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-icon-wrapper svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s ease;
}

/* Поле ввода */
.input-group input {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 40px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    color: #f0eee9;
    font: 400 16px/1.2 'Montserrat', sans-serif;
    letter-spacing: 0;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    outline: none;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Браузерное автозаполнение не должно менять шрифт и размер текста. */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active,
.input-group input:autofill {
    font: 400 16px/1.2 'Montserrat', sans-serif !important;
    letter-spacing: 0 !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    -webkit-text-fill-color: #f0eee9 !important;
    caret-color: #f0eee9 !important;
    background-color: transparent !important;
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    transition: background-color 9999s ease-out 0s;
}

/* Chromium/Яндекс может отдельно стилизовать внутреннюю строку автозаполнения. */
.input-group input:-webkit-autofill::first-line {
    font: 400 16px/1.2 'Montserrat', sans-serif !important;
    letter-spacing: 0 !important;
    color: #f0eee9 !important;
}

/* ЛЕЙБЛ ВНУТРИ ПОЛЯ (исходное состояние) */
.input-group label {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0;
    
    pointer-events: none;
    transition: opacity 0.3s ease; /* Только прозрачность */
    background: transparent;
}

/* АКТИВНОЕ СОСТОЯНИЕ: Линия + Иконка синеют */
.input-group input:focus {
    border-bottom-color: #315f91;
    border-bottom-width: 2px;
}

.input-group input:focus ~ .input-icon-wrapper svg {
    stroke: #315f91;
}

/* ЛЕЙБЛ ПРОСТО ИСЧЕЗАЕТ (без движения!) */
.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    opacity: 0;
    visibility: hidden;
}

/* Кнопка глаза */
.toggle-password {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.3;
    transition: opacity 0.2s;
    z-index: 2;
}
.toggle-password:hover { opacity: 0.8; }
.toggle-password svg { 
    stroke: white; 
    width: 22px; 
    height: 22px; 
    stroke-width: 1.5;
}

/* Кнопка входа: общий внешний вид задаёт components.css */
.btn-primary {
    width: 100%;
    margin-top: 20px;
}



/* Ссылка регистрации */
.login-form a {
    display: block;
    text-align: center;
    margin-top: 40px;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.login-form a:hover { color: #f0eee9; }

.legal-consents {
    display: grid;
    gap: 14px;
    margin: 4px 0 18px;
}

.login-form .legal-consent-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    color: rgba(240, 238, 233, 0.62);
    font-size: 12px;
    line-height: 1.55;
    cursor: pointer;
}

.legal-consent-row input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.legal-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1px solid rgba(240, 238, 233, 0.28);
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    place-items: center;
    transition: background-color 180ms ease, border-color 180ms ease, transform 140ms ease;
}

.legal-checkbox::after {
    content: '';
    width: 8px;
    height: 4px;
    border-left: 2px solid #f0eee9;
    border-bottom: 2px solid #f0eee9;
    transform: translateY(-1px) rotate(-45deg) scale(0);
    transition: transform 160ms ease;
}

.legal-consent-row input:checked + .legal-checkbox {
    background: #315f91;
    border-color: #315f91;
}

.legal-consent-row input:checked + .legal-checkbox::after {
    transform: translateY(-1px) rotate(-45deg) scale(1);
}

.legal-consent-row input:focus-visible + .legal-checkbox {
    outline: 2px solid rgba(49, 95, 145, 0.62);
    outline-offset: 3px;
}

.login-form .legal-consent-row a {
    display: inline;
    margin: 0 !important;
    color: rgba(240, 238, 233, 0.84);
    font-size: inherit;
    text-align: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(49, 95, 145, 0.72);
    text-underline-offset: 3px;
}

.login-form .auth-main-link {
    margin-top: 25px !important;
}

.login-form .auth-forgot-link {
    width: fit-content;
    margin: -12px 0 14px auto !important;
    color: rgba(240, 238, 233, 0.52);
    font-size: 12px;
    text-align: right;
}

.login-form .auth-forgot-link:hover {
    color: #f0eee9;
}

.password-reset-description {
    margin: -10px 0 30px;
    color: rgba(240, 238, 233, 0.56);
    font: 400 13px/1.65 'Montserrat', sans-serif;
}

.login-form .password-reset-login-link {
    min-height: 44px;
    margin-top: 18px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 999px;
    background: #315f91;
    color: #f0eee9;
    font-weight: 600;
}

.login-form .auth-legal-links,
.auth-legal-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 16px;
}

.login-form .auth-legal-links a {
    display: inline;
    margin: 0 !important;
    font-size: 11px;
    color: rgba(240, 238, 233, 0.38);
}

.site-legal-links {
    position: fixed;
    left: 18px;
    bottom: 14px;
    z-index: 40;
    display: flex;
    gap: 14px;
    font-size: 10px;
}

.site-legal-links a {
    color: rgba(240, 238, 233, 0.34);
    text-decoration: none;
    transition: color 180ms ease;
}

.site-legal-links a:hover {
    color: rgba(240, 238, 233, 0.78);
}

.legal-page {
    min-height: 100vh;
    margin: 0;
    color: #f0eee9;
    background: #071321;
    font-family: 'Montserrat', sans-serif;
}

.legal-shell {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 72px;
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 0 2px 18px;
    border-bottom: 1px solid rgba(240, 238, 233, 0.1);
}

.legal-brand {
    color: #f0eee9;
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    letter-spacing: 0.18em;
    text-decoration: none;
}

.legal-back {
    color: rgba(240, 238, 233, 0.58);
    font-size: 12px;
    text-decoration: none;
}

.legal-document {
    padding: clamp(24px, 5vw, 54px);
    background: rgba(255, 255, 255, 0.028);
    border-top: 2px solid #315f91;
    border-left: 1px solid rgba(240, 238, 233, 0.06);
    border-right: 1px solid rgba(240, 238, 233, 0.06);
}

.legal-document h1 {
    margin: 0 0 34px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 400;
    line-height: 1.12;
}

.legal-document h2 {
    margin: 32px 0 12px;
    color: rgba(240, 238, 233, 0.94);
    font-size: 16px;
    font-weight: 600;
}

.legal-document p,
.legal-document li {
    color: rgba(240, 238, 233, 0.68);
    font-size: 14px;
    line-height: 1.75;
}

.legal-document ul {
    padding-left: 22px;
}

.legal-document .legal-kicker {
    margin: 0 0 12px;
    color: #7299c2;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.legal-document-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    padding: 20px 2px 0;
}

.legal-document-nav a {
    color: rgba(240, 238, 233, 0.52);
    font-size: 12px;
    text-decoration: none;
}

@media (max-width: 767px) {
    .site-legal-links {
        position: static;
        justify-content: center;
        margin: 30px 16px 96px;
    }

    .login-form {
        padding: 34px 26px !important;
    }

    .legal-shell {
        width: min(100% - 20px, 920px);
        padding-top: 20px;
    }

    .legal-document {
        padding: 24px 20px;
    }
}

/* Уведомления */
.alert {
    padding: 14px 16px;
    border-radius: 1px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.alert-error { background: rgba(184, 100, 108, 0.1); border-left: 2px solid rgba(184, 100, 108, 0.3);  border-right: 2px solid rgba(184, 100, 108, 0.3); color: #b8646c; }
.alert-success { background: rgba(111, 146, 124, 0.1); border-left: 2px solid rgba(111, 146, 124, 0.3); color: #6f927c; }
.alert-close { margin-left: auto; background: none; border: none; color: inherit; cursor: pointer; opacity: 0.7; }



/* ===========================================================================
   === ПРОЗРАЧНОЕ АВТОЗАПОЛНЕНИЕ (TRANSPARENT FIX) ==========================
   =========================================================================== */

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    /* Делаем фон прозрачным через хак с transition */
    -webkit-box-shadow: 0 0 0 30px transparent inset !important;
    
    /* Текст белый */
    -webkit-text-fill-color: #f0eee9 !important;
    
    /* Этот переход "замораживает" состояние фона, не давая браузеру применить свой цвет */
    transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
}

/* Скрываем лейбл при автозаполнении (чтобы не было каши) */
.input-group input:-webkit-autofill + label {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Линия снизу остается как обычно */
.input-group input:-webkit-autofill {
    border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}
.input-group input:-webkit-autofill:focus {
    border-bottom-color: #315f91 !important;
}





/* ===========================================================================
   === ФИНАЛЬНАЯ КОРРЕКЦИЯ РАЗМЕРОВ (МАКСИМАЛЬНО ШИРОКАЯ И КОМПАКТНАЯ) ======
   =========================================================================== */

.login-form {
    width: 90% !important;          /* Занимает 90% экрана на мобильных */
    max-width: 400px !important;    /* ✅ УВЕЛИЧИЛИ С 520px ДО 600px */
    padding: 40px 50px !important;  /* Уменьшили вертикальные отступы внутри */
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1px;
    border-top:solid 2px #315f91 !important;
    border: 1px solid rgba(255, 255, 255, 0);
    margin: 150px auto;              /* Центрирование и отступ сверху/снизу */
}

.login-form h2 {    
    color: #f0eee9;
    font-size: 32px;                /* Чуть уменьшили заголовок для баланса */
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0 0 30px 0;             /* Меньше отступ под заголовком */
    text-align: left;
}

/* Группа поля ввода */
.input-group {
    position: relative;
    margin-bottom: 28px !important; /* ✅ ЕЩЕ КОМПРАКТНЕЕ: БЫЛО 32px, СТАЛО 28px */
    display: flex;
    align-items: center;
}

/* Кнопка регистрации */
.btn-primary {
    margin-top: 10px !important;
}

/* Ссылка "Уже есть аккаунт" */
.login-form a {
    margin-top: 25px !important;    /* Тоже ближе */
}

.error-page-code {
    margin: 0 0 10px;
    color: #7299c2;
    font-size: 13px;
    letter-spacing: 0.16em;
}

.error-page-message {
    margin: 0 0 28px;
    color: rgba(240, 238, 233, 0.58);
    font-size: 14px;
    line-height: 1.6;
}

.login-form .error-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0 !important;
    color: #f0eee9;
}

