/* === ФАЙЛ: /css/auth.css === */
/* Единый стиль страниц авторизации: вход, регистрация, восстановление пароля */

/* ==== Tilda Sans ==== */
     @font-face {
         font-family: 'Tilda Sans';
         src: url('/fonts/tilda-sans/tilda-sans_light.woff2') format('woff2'), url('/fonts/tilda-sans/tilda-sans_light.woff') format('woff'), url('/fonts/tilda-sans/tilda-sans_light.ttf') format('truetype');
         font-weight: 300;
         font-style: normal;
         font-display: swap;
         unicode-range: U+21-23,U+25-5F,U+61-7E,U+AB,U+BB,U+401,U+410-44F,U+451,U+2013-2014,U+2018-2019,U+201C,U+201C-201E,U+2026,U+20BD;
     }
     @font-face {
         font-family: 'Tilda Sans';
         src: url('/fonts/tilda-sans/tilda-sans_regular.woff2') format('woff2'), url('/fonts/tilda-sans/tilda-sans_regular.woff') format('woff'), url('/fonts/tilda-sans/tilda-sans_regular.ttf') format('truetype');
         font-weight: 400;
         font-style: normal;
         font-display: swap;
         unicode-range: U+21-23,U+25-5F,U+61-7E,U+AB,U+BB,U+401,U+410-44F,U+451,U+2013-2014,U+2018-2019,U+201C,U+201C-201E,U+2026,U+20BD;
     }
     @font-face {
         font-family: 'Tilda Sans';
         src: url('/fonts/tilda-sans/tilda-sans_medium.woff2') format('woff2'), url('/fonts/tilda-sans/tilda-sans_medium.woff') format('woff'), url('/fonts/tilda-sans/tilda-sans_medium.ttf') format('truetype');
         font-weight: 500;
         font-style: normal;
         font-display: swap;
         unicode-range: U+21-23,U+25-5F,U+61-7E,U+AB,U+BB,U+401,U+410-44F,U+451,U+2013-2014,U+2018-2019,U+201C,U+201C-201E,U+2026,U+20BD;
     }
     @font-face {
         font-family: 'Tilda Sans';
         src: url('/fonts/tilda-sans/tilda-sans_semibold.woff2') format('woff2'), url('/fonts/tilda-sans/tilda-sans_semibold.woff') format('woff'), url('/fonts/tilda-sans/tilda-sans_semibold.ttf') format('truetype');
         font-weight: 600;
         font-style: normal;
         font-display: swap;
         unicode-range: U+21-23,U+25-5F,U+61-7E,U+AB,U+BB,U+401,U+410-44F,U+451,U+2013-2014,U+2018-2019,U+201C,U+201C-201E,U+2026,U+20BD;
     }
     @font-face {
         font-family: 'Tilda Sans';
         src: url('/fonts/tilda-sans/tilda-sans_bold.woff2') format('woff2'), url('/fonts/tilda-sans/tilda-sans_bold.woff') format('woff'), url('/fonts/tilda-sans/tilda-sans_bold.ttf') format('truetype');
         font-weight: 700;
         font-style: normal;
         font-display: swap;
         unicode-range: U+21-23,U+25-5F,U+61-7E,U+AB,U+BB,U+401,U+410-44F,U+451,U+2013-2014,U+2018-2019,U+201C,U+201C-201E,U+2026,U+20BD;
     }
     @font-face {
         font-family: 'Tilda Sans';
         src: url('/fonts/tilda-sans/tilda-sans_extra-bold-.woff2') format('woff2'), url('/fonts/tilda-sans/tilda-sans_extra-bold-.woff') format('woff'), url('/fonts/tilda-sans/tilda-sans_extra-bold-.ttf') format('truetype');
         font-weight: 800;
         font-style: normal;
         font-display: swap;
         unicode-range: U+21-23,U+25-5F,U+61-7E,U+AB,U+BB,U+401,U+410-44F,U+451,U+2013-2014,U+2018-2019,U+201C,U+201C-201E,U+2026,U+20BD;
     }
     @font-face {
         font-family: 'Tilda Sans';
         src: url('/fonts/tilda-sans/tilda-sans_black.woff2') format('woff2'), url('/fonts/tilda-sans/tilda-sans_black.woff') format('woff'), url('/fonts/tilda-sans/tilda-sans_black.ttf') format('truetype');
         font-weight: 900;
         font-style: normal;
         font-display: swap;
         unicode-range: U+21-23,U+25-5F,U+61-7E,U+AB,U+BB,U+401,U+410-44F,U+451,U+2013-2014,U+2018-2019,U+201C,U+201C-201E,U+2026,U+20BD;
     }

* { box-sizing: border-box; }

/* Предотвращаем горизонтальный сдвиг при появлении/исчезновении скроллбара */
html {
    overflow-y: scroll;
}

body.auth-page {
    margin: 0;
    padding: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    min-height: 100vh;
    color: #1a1d23;
    -webkit-font-smoothing: antialiased;
}

/* ===== Фон: меню и hero главной страницы ===== */
.auth-site {
    position: fixed;
    inset: 0;             /* Растягивает на весь экран (top: 0; right: 0; bottom: 0; left: 0) */
    width: 100%;
    height: 100vh;
    overflow: hidden;     /* Скрывает всё, что выходит за пределы первого экрана */
    z-index: 0;
    pointer-events: none; /* Блокирует клики по фоновым элементам */
    margin-top: 64px !important;
}

/* Затемнение страницы — эффект модального окна поверх главной */
.auth-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
}

.auth-main {
    position: relative;
    z-index: 2001;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 40px 20px 64px;
}


/* ===== Карточка ===== */
.auth-card {
    background: #f8f9fb;
    border: 1px solid #d3d6da;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
    padding: 32px;
    width: 100%;
    max-width: 440px;
}
.auth-card.wide { max-width: 800px; }

.auth-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.2px; }
.auth-sub { font-size: 13px; color: #6b7280; margin: 0 0 24px; line-height: 1.5; }

/* ===== Поля ===== */
.auth-field { margin-bottom: 16px; }
.auth-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.auth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d3d6da;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: #1a1d23;
    transition: border-color .15s, box-shadow .15s;
}
.auth-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.auth-input[readonly], .auth-input:disabled {
    background: #eef0f3;
    color: #6b7280;
    cursor: not-allowed;
}
.auth-hint { font-size: 12px; color: #6b7280; margin-top: 6px; line-height: 1.45; }
.auth-hint a { color: #3b82f6; }

/* ===== Кнопки ===== */
.auth-btn {
    width: 200px !important;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    background: #1a1d23;
    opacity: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.auth-btn:hover { opacity: 0.9; }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.auth-btn-ghost {
    background: transparent;
    border: 1px solid #d3d6da;
    color: #1a1d23;
    font-weight: 500;
}
.auth-btn-ghost:hover { background: #eef0f3; }

.auth-actions { display: flex; gap: 10px; margin-top: 18px; }
.auth-actions .auth-btn-ghost { width: auto; padding: 12px 20px; }

/* ===== Сообщения ===== */
.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}
.auth-ok {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #059669;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ===== Ссылки ===== */
.auth-links {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}
.auth-links a { color: #3b82f6; text-decoration: none; font-weight: 500; }
.auth-links a:hover { text-decoration: underline; }

/* ===== Шаги ===== */
.auth-steps { display: flex; gap: 6px; margin-bottom: 24px; }
.auth-step {
    flex: 1;
    text-align: center;
    padding: 9px 6px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    background: #e7e9ec;
    color: #6b7280;
    border: 1px solid transparent;
    transition: all .2s;
    line-height: 1.2;
}
.auth-step.active {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    font-weight: 500;
}
.auth-step.done {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

/* ===== Роли ===== */
.auth-roles { display: flex; gap: 10px; margin-bottom: 16px; }
.auth-role {
    flex: 1;
    padding: 12px;
    border: 1px solid #d3d6da;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    transition: all .15s;
}
.auth-role:hover { border-color: #93c5fd; }
.auth-role.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}
.auth-role input { display: none; }

/* ===== Агентства / документы ===== */
.auth-doc {
    background: #fff;
    border: 1px solid #d3d6da;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}
.auth-doc-icon { font-size: 26px; color: #3b82f6; margin-bottom: 10px; }
.auth-doc-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: #1a1d23; }
.auth-doc-text { font-size: 12px; color: #6b7280; margin-bottom: 16px; line-height: 1.5; }
.auth-doc-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #d3d6da;
    background: #f8f9fb;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #1a1d23;
    cursor: pointer;
    transition: all .15s;
}
.auth-doc-open:hover { border-color: #93c5fd; background: #eff6ff; }
.auth-doc-open.read { border-color: #a7f3d0; background: #ecfdf5; color: #059669; }

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #334155;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #d3d6da;
    border-radius: 10px;
    cursor: pointer;
    line-height: 1.45;
}
.auth-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #3b82f6; cursor: pointer; }

/* ===== Сводка ===== */
.auth-summary {
    background: #fff;
    border: 1px solid #d3d6da;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    font-size: 13px;
}
.auth-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed #e7e9ec;
}
.auth-summary div:last-child { border-bottom: none; }
.auth-summary span:first-child { color: #6b7280; }
.auth-summary span:last-child { font-weight: 500; text-align: right; }

/* ===== Модалка документа ===== */
.auth-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.auth-modal-overlay.show { display: flex; }
.auth-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.auth-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e7e9ec;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.auth-modal-header h2 { font-size: 17px; margin: 0; color: #1a1d23; }
.auth-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0 6px;
}
.auth-modal-close:hover { color: #1a1d23; }
.auth-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    color: #334155;
    line-height: 1.7;
}
.auth-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #e7e9ec;
    text-align: center;
    font-size: 12px;
    color: #f00;
    background: #f8f9fb;
}

@media (max-width: 600px) {
    .auth-card { padding: 22px; border-radius: 12px; }
    .auth-main { padding: 24px 12px 40px; }
    .auth-steps { flex-wrap: wrap; }
    .auth-step { flex: 1 1 45%; }
}
