/*
 * Dimitex — оформление экранов авторизации (вход / регистрация / восстановление).
 *
 * Перенос макета Claude Design «Димитекс Платформа» (палитра «Индиго»).
 * Файл статический и НЕ участвует в сборке Tailwind: `tailwind.min.css`
 * компилируется отдельной командой, поэтому новые утилитарные классы там
 * не появятся без `npm run build:css`. Всё оформление auth-экранов держим
 * здесь, чтобы страницы не зависели от пересборки CSS.
 *
 * Шрифт Inter подключается локально из assets/css/fonts.css — Google Fonts
 * CDN намеренно не используется.
 */

/*
 * Собственный box-sizing: на страницах рядом подключён tailwind.min.css,
 * чей preflight выставляет border-box глобально, но auth.css не должен от
 * этого зависеть — без правила поля с padding вылезают за карточку.
 */
.auth-split,
.auth-split *,
.auth-split *::before,
.auth-split *::after {
    box-sizing: border-box;
}

:root {
    --auth-accent: #4f46e5;
    --auth-accent-d: #4338ca;
    --auth-accent-soft: #eef2ff;
    --auth-accent-deep: #312e81;
    --auth-ring: rgba(79, 70, 229, .30);
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-line: #e2e8f0;
}

@keyframes dmtxUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------- каркас */

body.auth-body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    color: var(--auth-ink);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

.auth-split {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
}

/* ------------------------------------------------------- брендовая панель */

.auth-brand {
    flex: 1 1 420px;
    min-width: 300px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, var(--auth-accent-deep), var(--auth-accent));
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: clamp(32px, 4vw, 56px);
}

/* Сетчатый оверлей поверх градиента — как в макете. */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg,  rgba(255, 255, 255, .05) 0 1px, transparent 1px 16px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 16px);
    pointer-events: none;
}

.auth-brand > * { position: relative; }

.auth-logo {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: inherit;
}

.auth-logo__mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 19px;
    font-weight: 800;
    flex: 0 0 auto;
}

.auth-logo__text {
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -.02em;
}

.auth-logo__text span { color: rgba(255, 255, 255, .6); }

.auth-brand__body {
    margin-top: auto;
    padding-top: 48px;
}

.auth-brand__title {
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.12;
    letter-spacing: -.02em;
    font-weight: 800;
    margin: 0;
}

.auth-brand__lead {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
    margin: 18px 0 30px;
    max-width: 420px;
}

.auth-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-bullets li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, .92);
}

.auth-bullets li::before {
    content: '✔';
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    display: grid;
    place-items: center;
    font-size: 13px;
}

.auth-brand__note {
    margin-top: 48px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .6);
}

/* --------------------------------------------------------- панель формы */

.auth-pane {
    flex: 1 1 480px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.auth-pane__top {
    padding: 22px clamp(20px, 4vw, 40px);
    display: flex;
    justify-content: flex-end;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--auth-muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}

.auth-back:hover { color: var(--auth-accent-d); }

.auth-pane__body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px clamp(20px, 4vw, 40px) 56px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    animation: dmtxUp .4s ease both;
}

.auth-card--wide { max-width: 520px; }

/* --------------------------------------------------------------- заголовки */

.auth-title {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    color: var(--auth-ink);
}

.auth-subtitle {
    font-size: 15px;
    line-height: 1.55;
    color: var(--auth-muted);
    margin: 0 0 28px;
}

.auth-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--auth-accent-soft);
    color: var(--auth-accent);
    display: grid;
    place-items: center;
    margin-bottom: 20px;
}

.auth-icon--ok {
    background: #ecfdf5;
    color: #059669;
}

/* -------------------------------------------------- табы Клиент/Сотрудник */

.auth-tabs {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 26px;
}

.auth-tab {
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all .15s;
    font-family: inherit;
    background: none;
    color: var(--auth-muted);
}

.auth-tab.is-active {
    background: #fff;
    color: var(--auth-accent-d);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .14);
}

/* ------------------------------------------------------------------ поля */

.auth-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
}

.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 7px;
}

.auth-label-row .auth-label { margin-bottom: 0; }

.auth-input {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--auth-line);
    border-radius: 11px;
    font-size: 15px;
    font-family: inherit;
    color: var(--auth-ink);
    background: #fff;
    outline: none;
    transition: all .15s;
}

.auth-input::placeholder { color: #94a3b8; }

.auth-input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px var(--auth-ring);
}

.auth-field { margin-bottom: 18px; }
.auth-field--tight { margin-bottom: 14px; }

.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.auth-grid--three {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.auth-hint {
    font-size: 12.5px;
    line-height: 1.5;
    color: #94a3b8;
    margin: 7px 0 0;
}

/* Поле с кнопкой-глазом. */
.auth-pw { position: relative; }
.auth-pw .auth-input { padding-right: 46px; }

.auth-pw__eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #94a3b8;
    display: grid;
    place-items: center;
    transition: color .15s;
}

.auth-pw__eye:hover { color: #475569; }

/* --------------------------------------------------------------- чекбокс */

.auth-check {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 24px;
    user-select: none;
}

.auth-check--center { align-items: center; }

/* Настоящий input скрыт визуально, но остаётся в форме и доступен с клавиатуры. */
.auth-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.auth-check__box {
    width: 19px;
    height: 19px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    transition: all .15s;
    background: #fff;
    border: 1px solid #cbd5e1;
    margin-top: 1px;
}

.auth-check__box svg {
    opacity: 0;
    transition: opacity .15s;
}

.auth-check input:checked + .auth-check__box {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
}

.auth-check input:checked + .auth-check__box svg { opacity: 1; }

.auth-check input:focus-visible + .auth-check__box {
    box-shadow: 0 0 0 4px var(--auth-ring);
}

.auth-check__text {
    font-size: 14.5px;
    color: #334155;
    line-height: 1.5;
}

.auth-check__text--small { font-size: 13.5px; }

/* ---------------------------------------------------------------- кнопки */

.auth-btn {
    width: 100%;
    background: var(--auth-accent);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 11px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 10px 26px var(--auth-ring);
    transition: background .15s;
    display: block;
    text-align: center;
    text-decoration: none;
}

.auth-btn:hover { background: var(--auth-accent-d); }
.auth-btn:disabled { opacity: .6; cursor: default; }

.auth-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--auth-accent);
    text-decoration: none;
    transition: color .15s;
}

.auth-link:hover { color: var(--auth-accent-d); }
.auth-link--small { font-size: 13.5px; }

.auth-foot {
    text-align: center;
    font-size: 14.5px;
    color: var(--auth-muted);
    margin: 26px 0 0;
}

.auth-note {
    text-align: center;
    font-size: 13.5px;
    color: #94a3b8;
    margin: 22px 0 0;
    line-height: 1.5;
}

/* ------------------------------------------------------------- соцвход */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-line);
}

.auth-divider span {
    font-size: 13px;
    color: #94a3b8;
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-social__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #fff;
    border: 1px solid var(--auth-line);
    padding: 12px;
    border-radius: 11px;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    font-family: inherit;
    color: #334155;
    text-decoration: none;
    transition: all .15s;
}

.auth-social__btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.auth-social__btn svg { flex: 0 0 auto; }

/* ------------------------------------------------------------ сообщения */

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-radius: 11px;
    padding: 13px 15px;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-alert svg { flex: 0 0 auto; margin-top: 1px; }

.auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.auth-alert--info {
    background: var(--auth-accent-soft);
    border: 1px solid var(--auth-accent);
    color: var(--auth-accent-d);
    font-size: 13.5px;
}

.auth-alert--info b { font-weight: 700; }

.auth-alert a { color: inherit; text-decoration: underline; }

.auth-alert__mark {
    flex: 0 0 auto;
    font-weight: 800;
    margin-top: -1px;
}

/* Мягкая справочная плашка (например «не помните почту?»). */
.auth-hintbox {
    background: #f8fafc;
    border: 1px solid #eef1f6;
    border-radius: 11px;
    padding: 14px 16px;
    margin-top: 22px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--auth-muted);
}

.auth-hintbox a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-hintbox a:hover { color: var(--auth-accent-d); }

/* ------------------------------------------------------------------ тур */

/*
 * Страница lead/tour.php (веха v1.93, фаза 02). Классы живут здесь, а не в
 * Tailwind: tailwind.min.css собирается отдельной командой, новые утилиты в
 * нём не появятся без пересборки.
 */

.auth-tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin: 24px 0 8px;
}

.auth-tour-card {
    background: #fff;
    border: 1px solid #eef1f6;
    border-radius: 14px;
    padding: 16px 18px;
}

.auth-tour-card__title {
    font-weight: 700;
    font-size: 15px;
    color: var(--auth-ink);
    margin-bottom: 5px;
}

.auth-tour-card__text {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--auth-muted);
    margin: 0;
}

.auth-tour-heading {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--auth-ink);
    margin: 32px 0 14px;
}

.auth-tour-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-tour-step {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #eef1f6;
    border-radius: 14px;
    padding: 14px 16px;
}

.auth-tour-step__num {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--auth-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 14px;
}

.auth-copyright {
    text-align: center;
    font-size: 12.5px;
    color: #94a3b8;
    padding: 0 clamp(20px, 4vw, 40px) 28px;
}

/* ------------------------------------------------------------- адаптив */

/*
 * На узких экранах брендовая панель сворачивается в компактную шапку:
 * градиент и логотип остаются, длинный текст и буллеты убираются,
 * чтобы форма не уезжала за первый экран.
 */
@media (max-width: 900px) {
    .auth-split { min-height: 0; }

    .auth-brand {
        flex: 1 1 100%;
        padding: 20px clamp(18px, 5vw, 32px);
    }

    .auth-brand__body { padding-top: 22px; }
    .auth-brand__title { font-size: 22px; }
    .auth-brand__lead { margin: 12px 0 0; font-size: 14.5px; }
    .auth-bullets,
    .auth-brand__note { display: none; }

    .auth-pane { flex: 1 1 100%; }
    .auth-pane__top { padding: 16px clamp(18px, 5vw, 32px) 0; }
    .auth-pane__body { padding: 20px clamp(18px, 5vw, 32px) 40px; }
}

@media (max-width: 420px) {
    .auth-title { font-size: 23px; }
    .auth-tabs { display: flex; width: 100%; }
    .auth-tab { flex: 1; }
}
