/* =========================================================
   МСК-Логистика · Академия склада — страница входа
   Самостоятельный файл, не зависит от style.css
   ========================================================= */

:root {
    --brand:          #2b5ce6;
    --brand-dark:     #2450cc;
    --brand-soft:     #e7effd;

    --ink:            #0e1726;
    --ink-muted:      #5b6577;
    --ink-faint:      #8a93a5;

    --surface:        #ffffff;
    --page-top:       #f8fbff;
    --page-bottom:    #eef3fc;
    --line:           #e6ebf3;
    --field:          #f6f8fc;
    --field-line:     #e4e9f2;

    --ok:             #16a34a;

    --radius-card:    24px;
    --radius-field:   12px;

    --shadow-card:    0 24px 64px rgba(17, 34, 68, .10);
    --shadow-btn:     0 8px 20px rgba(43, 92, 230, .28);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: linear-gradient(180deg, var(--page-top) 0%, var(--page-bottom) 100%);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }


/* ---------- Шапка ---------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 14px 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand__mark {
    width: 44px;
    height: 44px;
    flex: none;
    object-fit: contain;
}

.brand__name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.brand__sub {
    font-size: 13px;
    color: var(--ink-faint);
    line-height: 1.2;
}


/* ---------- Основная область ---------- */

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 40px 32px;
}

.auth-layout {
    width: 100%;
    max-width: 1860px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 40px;
    align-items: stretch;
}


/* ---------- Левая часть ---------- */

.hero {
    /* Ширина текстового блока. От неё считается ширина светлой вуали,
       поэтому текст никогда не вылезает на «занятую» часть картинки. */
    --text-w: min(540px, 52%);

    position: relative;
    min-height: 800px;
    display: flex;
    align-items: center;
}

/*
 * Свечение под иллюстрацией — мягкое цветное пятно,
 * из-за него картинка не выглядит наклейкой на белом листе.
 */
.hero::before {
    content: "";
    position: absolute;
    inset: 6% -4% 6% 10%;
    z-index: 0;
    border-radius: 50%;
    background:
        radial-gradient(60% 60% at 70% 40%, rgba(43, 92, 230, .20), transparent 70%),
        radial-gradient(50% 50% at 35% 75%, rgba(124, 77, 224, .14), transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

/* Иллюстрация заполняет всю левую колонку по высоте. */
.hero__art {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: 28px;
    box-shadow:
        0 30px 70px rgba(17, 34, 68, .16),
        0 2px 0 rgba(255, 255, 255, .7) inset;
    pointer-events: none;
    animation: hero-in .9s ease-out both;
}

.hero__art img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 66% center;
    display: block;
    /* Очень медленное движение кадра: сцена «живёт», но не отвлекает */
    animation: hero-pan 32s ease-in-out infinite alternate;
}

/*
 * Светлая вуаль слева: гарантирует читаемость заголовка поверх
 * иллюстрации при любой ширине экрана.
 */
/* Лёгкий холодный подсвет сверху — «складской» свет */
.hero__art::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(43, 92, 230, .06) 0%, transparent 35%);
}

/*
 * Светлая вуаль под текстом.
 *
 * Ширина задана в пикселях, а не в процентах: текстовый блок тоже ограничен
 * пикселями, поэтому вуаль гарантированно перекрывает его на любом экране.
 * На процентах при узкой колонке подзаголовок вылезал на пол и стеллажи.
 */
.hero__art::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: calc(var(--text-w) + 540px);
    z-index: 1;
    background: linear-gradient(
        90deg,
        #f8fbff 0,
        #f8fbff var(--text-w),
        rgba(248, 251, 255, .55) calc(var(--text-w) + 190px),
        rgba(248, 251, 255, 0) 100%
    );
}

/* Блик, медленно проходящий по картинке */
.hero__shine {
    position: absolute;
    top: -30%;
    bottom: -30%;
    width: 22%;
    left: -30%;
    z-index: 1;
    background: linear-gradient(
        100deg,
        transparent,
        rgba(255, 255, 255, .42),
        transparent
    );
    transform: skewX(-12deg);
    animation: hero-shine 9s ease-in-out 1.4s infinite;
    pointer-events: none;
}

@keyframes hero-in {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

@keyframes hero-pan {
    from { transform: scale(1.02); object-position: 62% center; }
    to   { transform: scale(1.07); object-position: 72% center; }
}

@keyframes hero-shine {
    0%        { left: -30%; opacity: 0; }
    12%       { opacity: 1; }
    45%, 100% { left: 115%; opacity: 0; }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
    .hero__art,
    .hero__art img,
    .hero__shine {
        animation: none;
    }
    .hero__shine { display: none; }
}

.hero__content {
    position: relative;
    z-index: 2;
    /* Ширина согласована с вуалью выше — текст всегда на чистом фоне */
    max-width: var(--text-w);
    padding: 8px 0 8px 40px;
}

.hero__title {
    margin: 0 0 20px;
    font-size: clamp(27px, 2.3vw, 36px);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -.02em;
}

.hero__lead {
    margin: 0 0 40px;
    max-width: 440px;
    font-size: 18px;
    color: var(--ink-muted);
}

.hero__features {
    display: grid;
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 17px;
    font-weight: 600;
    max-width: 330px;
}

.feature__icon {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature__icon--blue   { background: #e8f0fe; color: #2b5ce6; }
.feature__icon--violet { background: #f1eafe; color: #7c4de0; }
.feature__icon--green  { background: #e6f7ee; color: #12a05c; }


/* ---------- Карточка входа ---------- */

.auth-card {
    /* z-index: карточка всегда поверх иллюстрации, иначе та наезжает на поля */
    position: relative;
    z-index: 2;
    align-self: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 42px 40px;
}

.auth-card__head { text-align: center; }

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 22px;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.auth-card__title {
    margin: 0 0 12px;
    font-size: 33px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-card__lead {
    margin: 0 0 30px;
    color: var(--ink-muted);
    font-size: 16px;
}

.field { margin-bottom: 20px; }

.field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 14.5px;
    font-weight: 600;
}

.field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.field__icon {
    position: absolute;
    left: 16px;
    color: var(--ink-faint);
    pointer-events: none;
    display: flex;
}

.field__input {
    width: 100%;
    padding: 15px 16px 15px 50px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: var(--radius-field);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.field__input::placeholder { color: var(--ink-faint); }

.field__input:focus,
.field__input.is-scanning {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(43, 92, 230, .14);
}


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

.btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    font: inherit;
    font-size: 16.5px;
    font-weight: 700;
    border-radius: var(--radius-field);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .08s;
}

.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.btn--primary:hover { background: var(--brand-dark); }

.btn--outline {
    background: var(--surface);
    color: var(--brand);
    border-color: #ccd9f7;
}

.btn--outline:hover {
    background: #f5f8ff;
    border-color: var(--brand);
}


/* ---------- Разделитель ---------- */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 22px 0;
    color: var(--ink-faint);
    font-size: 14px;
}

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


/* ---------- Подвал карточки ---------- */

.auth-help {
    margin: 26px 0 0;
    text-align: center;
    font-size: 14px;
    color: var(--ink-faint);
}

.auth-status {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 13.5px;
    color: var(--ink-muted);
}

.auth-status__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ok);
}


/* ---------- Сообщение об ошибке ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 13px 16px;
    border-radius: var(--radius-field);
    background: #fdecec;
    border: 1px solid #f7c9c9;
    color: #b3261e;
    font-size: 14.5px;
    text-align: left;
}

.alert__icon { flex: none; margin-top: 2px; }


/* ---------- Подсказка про сканер ---------- */

.scan-hint {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: var(--radius-field);
    background: var(--brand-soft);
    color: #1e46b4;
    font-size: 14px;
    text-align: center;
}


/* ---------- Подвал страницы ---------- */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 20px 32px;
    text-align: center;
    font-size: 14px;
    color: var(--ink-faint);
}


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

@media (max-width: 1500px) {
    .auth-layout { grid-template-columns: minmax(0, 1fr) 420px; gap: 30px; }
    .hero { min-height: 660px; }
    .auth-card { padding: 36px 32px; }
}

@media (max-width: 1300px) {
    .auth-main { padding: 28px 20px; }
    .auth-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }

    /* Карточка входа — первой: на складе заходят с телефона */
    .auth-card {
        order: -1;
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
    }

    .hero__content { text-align: center; }
    .hero__lead { margin-left: auto; margin-right: auto; }
    .hero__features {
        max-width: 340px;
        margin: 0 auto;
        text-align: left;
    }

    .hero { min-height: 0; }
    .hero::before { display: none; }
    .hero__art { display: none; }
    .hero__content { max-width: none; padding: 0; }
    .hero__title { font-size: 30px; }
    .hero__lead { margin-bottom: 28px; font-size: 16.5px; }
    .feature { max-width: none; }
}

@media (max-width: 560px) {
    .site-header { padding: 12px 18px; }
    .auth-main { padding: 22px 16px; }
    .auth-card { padding: 28px 20px; border-radius: 20px; }
    .auth-card__title { font-size: 28px; }
    .auth-badge { font-size: 11.5px; padding: 8px 14px; }
    .hero__title { font-size: 26px; }
    .site-footer { padding: 18px 16px; font-size: 13px; }
    .auth-status { justify-content: center; }
}
