/* =============================================================
   BeetRoute ЛКБ — auth.css
   Единый CSS для всех авторизационных страниц.
   Подключение: {% load static %}
                <link rel="stylesheet" href="{% static 'cabinet/css/auth.css' %}">
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500&display=swap');

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

/* ── Страница ─────────────────────────────────────────────── */
body {
    font-family: 'Google Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(118.02deg, #FFF1F8 3.96%, #ECEEFF 70.8%);
}
html,
body {
    height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.auth-page {
    flex: 1;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 32px 16px;
}
/* ── Карточка ─────────────────────────────────────────────── */
.auth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    gap: 32px;
    width: 464px;
    background: #FFFFFF;
    box-shadow: 0px 2px 16px 6px rgba(0,0,0,0.06);
    border-radius: 24px;
}

/* М-3: чуть шире */
.auth-card--wide { width: 520px; }

.auth-logo { width: 150.93px; height: 60px; flex-shrink: 0; }

/* ── Тело карточки ────────────────────────────────────────── */
.auth-body {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

/* ── Заголовок ────────────────────────────────────────────── */
.auth-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.auth-title {
    font-weight: 500;
    font-size: 28px;
    line-height: 32px;
    text-align: center;
    color: #111214;
    width: 100%;
}

.auth-subtitle {
    font-weight: 400;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    color: #111214;
    width: 100%;
}

/* ── Форма ────────────────────────────────────────────────── */
.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

/* ── Обёртка инпута ───────────────────────────────────────── */
.input-wrap {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 0 16px;
    gap: 10px;
    width: 100%;
    height: 50px;
    background: #F0F5F9;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.input-wrap:focus-within { border-color: #2064D5; }
.input-wrap.has-error    { border-color: #CC0000; }

.input-wrap input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    font-family: 'Google Sans', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #111214;
    outline: none;
}

.input-wrap input::placeholder { color: #838C9A; }

/* Textarea-вариант */
.input-wrap.is-textarea {
    padding: 14px 16px;
    height: auto;
    min-height: 100px;
    align-items: flex-start;
}

.input-wrap.is-textarea textarea {
    flex: 1;
    width: 100%;
    min-height: 72px;
    border: none;
    background: transparent;
    font-family: 'Google Sans', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #111214;
    outline: none;
    resize: none;
}

.input-wrap.is-textarea textarea::placeholder { color: #838C9A; }

/* ── Иконки внутри инпута ─────────────────────────────────── */
.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 50px;
    flex-shrink: 0;
}

.input-icon svg { width: 24px; height: 24px; }

/* ── Кнопка eye ───────────────────────────────────────────── */
.btn-eye {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-eye svg { width: 24px; height: 24px; }

/* ── Ошибки ───────────────────────────────────────────────── */
.field-error {
    font-size: 13px;
    line-height: 18px;
    color: #CC0000;
}

.form-errors {
    font-size: 14px;
    line-height: 20px;
    color: #CC0000;
    text-align: center;
    width: 100%;
}

/* Цвет ошибки из макета (E74036 — для forgot password) */
.form-errors--red { color: #E74036; }

/* ── Django messages ──────────────────────────────────────── */
.messages { list-style: none; width: 100%; display: flex; flex-direction: column; gap: 8px; }

.messages li {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 20px;
}

.messages li.error   { background: #FFF0F0; color: #CC0000; }
.messages li.success { background: #F0FFF4; color: #1a7f37; }
.messages li.info    { background: #EBF2FB; color: #2064D5; }
.messages li.warning { background: #FFFBEA; color: #9A6700; }

/* ── Баннер инвайта (М-1) ─────────────────────────────────── */
.invite-banner {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    background: #EBF2FB;
    font-size: 14px;
    line-height: 20px;
    color: #2064D5;
    text-align: center;
}

/* ── Основная кнопка ──────────────────────────────────────── */
.btn-submit {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    gap: 6px;
    width: 100%;
    height: 50px;
    background: #2064D5;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #FFFFFF;
    transition: background 0.15s;
    text-decoration: none;
}

.btn-submit:hover  { background: #1a53b8; }
.btn-submit:active { background: #1445a0; }

/* ── Текстовая кнопка-ссылка ──────────────────────────────── */
.btn-link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    width: 100%;
    height: 50px;
    border-radius: 12px;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: #2064D5;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-link:hover { text-decoration: underline; }

/* ── «Забыли пароль?» ─────────────────────────────────────── */
.link-forgot {
    font-size: 14px;
    line-height: 20px;
    color: #2064D5;
    text-decoration: none;
    align-self: flex-start;
}

.link-forgot:hover { text-decoration: underline; }

/* ── Футер формы («Есть аккаунт? Войти») ─────────────────── */
.auth-footer {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.auth-footer span {
    font-size: 16px;
    line-height: 24px;
    color: #838C9A;
}

.auth-footer a {
    font-size: 16px;
    line-height: 24px;
    color: #2064D5;
    text-decoration: none;
}

.auth-footer a:hover { text-decoration: underline; }

/* ── Дисклеймер ───────────────────────────────────────────── */
.disclaimer {
    font-size: 14px;
    line-height: 20px;
    color: #838C9A;
    text-align: center;
    width: 100%;
}

.disclaimer a { color: #2064D5; text-decoration: underline; }

/* ── Подсказки пароля ─────────────────────────────────────── */
.password-hints {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.hint-line {
    font-size: 14px;
    line-height: 20px;
    color: #838C9A;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hint-line::before { content: '\2713'; font-size: 13px; }
.hint-line.valid   { color: #43B500; }

/* ── PIN (2FA) ────────────────────────────────────────────── */
.pin-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
}

.pin-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 10px 20px;
    width: 46px;
    height: 62px;
    border: none;
    border-bottom: 1px solid #A6C3F2;
    background: transparent;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 32px;
    color: #111214;
    text-align: center;
    outline: none;
    transition: border-color 0.15s;
    caret-color: #2064D5;
    -moz-appearance: textfield;
}

.pin-cell::-webkit-outer-spin-button,
.pin-cell::-webkit-inner-spin-button { -webkit-appearance: none; }

.pin-cell:focus,
.pin-cell.filled  { border-bottom-color: #2064D5; }
.pin-cell.has-error { border-bottom-color: #CC0000; }

/* ── Поиск (М-3) ──────────────────────────────────────────── */
.search-wrap {
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    width: 100%;
    height: 50px;
    background: #FFFFFF;
    border: 1px solid #CADBF7;
    border-radius: 12px;
    transition: border-color 0.15s;
}

.search-wrap:focus-within { border-color: #2064D5; }
.search-wrap svg { flex-shrink: 0; width: 16px; height: 16px; }

.search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Google Sans', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #111214;
    background: transparent;
}

.search-wrap input::placeholder { color: #CADBF7; }

/* ── Карточка партнёра (М-3) ──────────────────────────────── */
.partners-list { display: flex; flex-direction: column; gap: 8px; }

.partner-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    width: 100%;
    background: #E1EAF4;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, background 0.15s;
    text-decoration: none;
}

.partner-card:hover    { background: #D3E1F0; }
.partner-card.selected { border-color: #2064D5; background: #EBF2FB; }

.partner-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.partner-name {
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: #111214;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.partner-role {
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: #838C9A;
}

.badge {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-green { background: #EAFFDE; color: #4EAB19; }
.badge-red   { background: #FBDCDA; color: #E74036; }
.badge-blue  { background: #EBF2FB; color: #2064D5; }

.empty-state {
    display: none;
    text-align: center;
    font-size: 14px;
    line-height: 20px;
    color: #838C9A;
    padding: 12px 0;
}

/* ── Модалка принять инвайт ───────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 32px;
    width: 464px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 0px 8px 32px rgba(0,0,0,0.12);
}

.modal-title {
    font-weight: 500;
    font-size: 22px;
    line-height: 28px;
    color: #111214;
    text-align: center;
}

.modal-text {
    font-size: 16px;
    line-height: 24px;
    color: #838C9A;
    text-align: center;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* ── Успех (success state) ────────────────────────────────── */
.success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #F0FFF4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ── Мобильный breakpoint ─────────────────────────────────── */
@media (max-width: 560px) {
    body {
        background: #FFFFFF;
        align-items: flex-start;
        padding: 0;
    }

    .auth-card,
    .auth-card--wide {
        width: 100%;
        max-width: 375px;
        padding: 40px 16px 40px;
        border-radius: 0;
        box-shadow: none;
    }

    .modal-card {
        width: calc(100vw - 32px);
        border-radius: 16px;
    }

    .partner-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge { align-self: flex-start; }
}

/* ── Disabled-состояние основной кнопки ───────────────────── */
/* Пока не выполнены все условия (М-2: чекбокс + чек-лист пароля +
   совпадение паролей) кнопка неактивна и визуально это показывает. */
.btn-submit:disabled {
    background: #CADBF7;
    cursor: not-allowed;
}

.btn-submit:disabled:hover { background: #CADBF7; }

/* ── Чекбокс акцепта B2B-условий (М-2) ────────────────────── */
.b2b-accept-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    cursor: pointer;
}

.b2b-accept-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.b2b-accept-row__box {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid #A6C3F2;
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    background: #FFFFFF;
    transition: background 0.15s, border-color 0.15s;
}

.b2b-accept-row input[type="checkbox"]:checked + .b2b-accept-row__box {
    background: #2064D5;
    border-color: #2064D5;
}

.b2b-accept-row input[type="checkbox"]:checked + .b2b-accept-row__box::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 45%;
    width: 9px;
    height: 5px;
    border-left: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.b2b-accept-row.has-error .b2b-accept-row__box { border-color: #CC0000; }

.b2b-accept-row__text {
    font-size: 14px;
    line-height: 20px;
    color: #838C9A;
}

.b2b-accept-row__text a {
    color: #2064D5;
    text-decoration: underline;
}

.b2b-accept-row__text strong {
    color: #111214;
    font-weight: 500;
}

/* ── Подвал экрана: ссылки на юр. документы (все auth-экраны) ─ */
.screen-legal-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 16px;
    width: 100%;
}

.screen-legal-footer a {
    font-size: 13px;
    line-height: 18px;
    color: #838C9A;
    text-decoration: none;
}

.screen-legal-footer a:hover { text-decoration: underline; color: #2064D5; }

.screen-legal-footer__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #838C9A;
    flex-shrink: 0;
}

@media (max-width: 560px) {
    /* На мобиле auth-card растягивается от верха без вертикального
       центрирования — подвал уходит за пределы первого экрана и его
       обычно не видно без скролла. Решение по дизайну подвала на мобиле
       — за дизайнером (обсуждалось отдельно), здесь только не ломаем
       вёрстку карточки. */
    .screen-legal-footer {
        padding: 16px;
    }
}
.screen-legal-footer {
    flex-shrink: 0;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;

    width: 100%;
    padding: 24px 16px;
}