/* ============================================================
   HQBerry — страницы входа / регистрации (split-screen).
   Левая «витрина» бренда (тёмный графит) + правая форма.
   Самодостаточно: не зависит от шелла приложения.
   ============================================================ */

:root {
    --au-ink:    #161D27;
    --au-muted:  #6B7280;
    --au-line:   #E6E8EC;
    --au-accent: #2563EB;
    --au-accent-d: #1D4FD8;
    --au-green:  #16704A;
    --au-radius: 16px;
}

.auth-body {
    margin: 0;
    background: #F4F5F7;
    color: var(--au-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-shell { min-height: 100vh; min-height: 100dvh; }

.auth-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ───────────────────────── Левая витрина ───────────────────────── */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;     /* контент прижат кверху, футер уходит вниз */
    gap: 28px;
    padding: 44px 52px;
    color: #fff;
    background:
        radial-gradient(120% 80% at 80% 0%, rgba(37,99,235,0.20) 0%, rgba(37,99,235,0) 55%),
        linear-gradient(165deg, #232C3A 0%, #161D27 55%, #10151C 100%);
}
.auth-aside-glow {
    position: absolute;
    width: 460px; height: 460px;
    right: -140px; bottom: -160px;
    background: radial-gradient(circle, rgba(37,99,235,0.28) 0%, rgba(37,99,235,0) 70%);
    pointer-events: none;
}
.auth-aside::before {           /* тонкая сетка для «дорогой» текстуры */
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(80% 60% at 30% 25%, #000 0%, transparent 75%);
    pointer-events: none;
}

.auth-brand {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 11px;
    text-decoration: none; color: #fff; width: fit-content;
}
.auth-brand-mark {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border-radius: 11px;
    background: #fff; color: #161D27;
    font-weight: 800; font-size: 15px; letter-spacing: -0.5px;
}
.auth-brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.3px; }

/* слайдер: занимает середину между лого и футером, слайды крест-накрест по opacity */
.auth-slider {
    position: relative; z-index: 1;
    flex: 1; min-height: 0;
    margin-top: clamp(20px, 5vh, 48px);
}
.auth-slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: center;
    opacity: 0; transform: translateY(10px);
    transition: opacity .35s ease, transform .35s ease;   /* уходящий гаснет быстро */
    pointer-events: none;
}
.auth-slide.is-active {
    opacity: 1; transform: none; pointer-events: auto;
    transition: opacity .5s ease .18s, transform .5s ease .18s;  /* входящий — с задержкой */
}
.auth-slide .auth-aside-title { max-width: 18ch; margin-bottom: 22px; }

/* слайд 2 — категории */
.auth-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-cat {
    display: flex; align-items: center; gap: 9px;
    padding: 11px 13px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 11px;
    background: rgba(255,255,255,0.05);
    font-size: 13.5px; color: rgba(255,255,255,0.9);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.auth-cat i { color: #93B4FF; font-size: 15px; flex: none; }

/* слайд 3 — шаги */
.auth-steps { display: grid; gap: 16px; }
.auth-step { display: flex; align-items: flex-start; gap: 13px; font-size: 14.5px; line-height: 1.4; color: rgba(255,255,255,0.92); }
.auth-step-n {
    flex: none; display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 9px;
    background: rgba(255,255,255,0.10); color: #fff; font-weight: 700; font-size: 14px;
}
.auth-step-sub { font-size: 13px; color: rgba(255,255,255,0.6); }

/* точки-навигация (в футере над бейджем) */
.auth-dots { display: flex; gap: 7px; margin-bottom: 16px; }
.auth-dot {
    width: 7px; height: 7px; padding: 0;
    border: none; border-radius: 50%;
    background: rgba(255,255,255,0.25); cursor: pointer;
    transition: width .25s, background .25s, border-radius .25s;
}
.auth-dot.is-active { width: 22px; border-radius: 4px; background: #fff; }
.auth-eyebrow {
    display: inline-block;
    margin: 0 0 14px;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    font-size: 12.5px; font-weight: 600; letter-spacing: 0.2px;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.05);
}
.auth-aside-title {
    margin: 0 0 26px;
    font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -0.8px;
    max-width: 12ch;
}
.auth-points { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 15px; }
.auth-points li {
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 15px; line-height: 1.45; color: rgba(255,255,255,0.9);
}
.auth-point-ic {
    flex: none;
    display: grid; place-items: center;
    width: 30px; height: 30px; margin-top: -2px;
    border-radius: 9px;
    background: rgba(255,255,255,0.10);
    color: #fff; font-size: 15px;
}

/* мини-превью продукта */
.auth-mock {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 14px;
    backdrop-filter: blur(2px);
    max-width: 380px;
    box-shadow: 0 20px 40px -22px rgba(0,0,0,0.6);
}
.auth-mock-head {
    display: flex; align-items: center; gap: 9px;
    padding-bottom: 11px; margin-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.auth-mock-dot { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52,211,153,0.2); }
.auth-mock-title { font-weight: 700; font-size: 13.5px; }
.auth-mock-bal { margin-left: auto; font-size: 12.5px; color: rgba(255,255,255,0.65); }
.auth-mock-row {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 2px;
    font-size: 13.5px;
}
.auth-mock-ic {
    flex: none; display: grid; place-items: center;
    width: 28px; height: 28px; border-radius: 8px;
    font-size: 13px;
}
.auth-mock-ic.c-amber { background: rgba(245,158,11,0.18); color: #FBBF77; }
.auth-mock-ic.c-blue  { background: rgba(59,130,246,0.18); color: #93B4FF; }
.auth-mock-ic.c-green { background: rgba(16,185,129,0.18); color: #6EE7B7; }
.auth-mock-main { flex: 1; color: rgba(255,255,255,0.92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-mock-sum  { font-weight: 700; font-variant-numeric: tabular-nums; }
.auth-mock-tag  {
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 999px;
    background: rgba(16,185,129,0.18); color: #6EE7B7;
}

.auth-aside-foot { position: relative; z-index: 1; margin-top: auto; padding-top: 24px; }
.auth-free {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px; border-radius: 999px;
    background: rgba(52,211,153,0.14);
    border: 1px solid rgba(52,211,153,0.30);
    color: #8AF0C2; font-weight: 600; font-size: 13.5px;
}
.auth-foot-sub { display: block; margin-top: 10px; font-size: 12.5px; color: rgba(255,255,255,0.5); }

/* ───────────────────────── Правая форма ───────────────────────── */
.auth-panel {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 24px;
    position: relative;
}
.auth-card {
    width: 100%; max-width: 384px;
    animation: auth-rise .5s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-brand-mobile { display: none; color: var(--au-ink); margin-bottom: 26px; }
.auth-brand-mobile .auth-brand-mark { background: #161D27; color: #fff; }

/* trust-бейдж только для мобилы (на десктопе он живёт в тёмной витрине) */
.auth-free-mobile { display: none; }

/* недействительное приглашение (/join) */
.auth-invalid { text-align: center; padding: 8px 0; }
.auth-invalid-ic {
    width: 56px; height: 56px; margin: 0 auto 16px;
    display: grid; place-items: center;
    border-radius: 16px; background: #FDECEC; color: #B42318; font-size: 26px;
}
.auth-invalid .auth-title { margin-bottom: 8px; }
.auth-invalid .auth-btn-primary { margin-top: 22px; }

.auth-head { margin-bottom: 22px; }
.auth-title { margin: 0 0 5px; font-size: 27px; font-weight: 800; letter-spacing: -0.6px; }
.auth-sub { margin: 0; color: var(--au-muted); font-size: 14.5px; }

/* поля */
.auth-field { margin-bottom: 15px; }
.auth-field > label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px; font-weight: 600; color: #374151;
}
.auth-ip { position: relative; }
.auth-field .form-control,
.auth-ip input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1.5px solid var(--au-line);
    border-radius: 12px;
    background: #fff;
    font-size: 15px; color: var(--au-ink);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none; appearance: none;
    box-sizing: border-box;
}
.auth-ip input:focus {
    outline: none;
    border-color: var(--au-accent);
    box-shadow: 0 0 0 3.5px rgba(37,99,235,0.14);
}
.auth-ip input::placeholder { color: #9AA1AC; }
.auth-ip:has(.auth-eye) input { padding-right: 46px; }

.auth-eye {
    position: absolute; top: 0; right: 0;
    height: 50px; width: 44px;
    display: grid; place-items: center;
    border: none; background: none; cursor: pointer;
    color: #9AA1AC; font-size: 16px;
    transition: color .15s;
}
.auth-eye:hover { color: var(--au-ink); }

/* ошибки валидации (Yii has-error) */
.auth-field.has-error .auth-ip input { border-color: #E5484D; }
.auth-field.has-error .auth-ip input:focus { box-shadow: 0 0 0 3.5px rgba(229,72,77,0.14); }
.auth-field .help-block {
    margin: 6px 2px 0;
    font-size: 12.5px; color: #E5484D; line-height: 1.4;
}

/* кнопки */
.auth-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 50px;
    border-radius: 12px;
    font-size: 15px; font-weight: 600;
    text-decoration: none; cursor: pointer;
    border: 1.5px solid transparent;
    transition: transform .08s, box-shadow .2s, background .15s, border-color .15s;
}
.auth-btn:active { transform: translateY(1px); }
.auth-btn i { font-size: 16px; }

.auth-btn-primary {
    margin-top: 4px;
    background: #161D27; color: #fff;
    box-shadow: 0 10px 22px -12px rgba(22,29,39,0.8);
}
.auth-btn-primary:hover { background: #0E141C; box-shadow: 0 14px 26px -12px rgba(22,29,39,0.85); }

.auth-btn-demo {
    background: #fff; color: var(--au-ink);
    border-color: var(--au-line);
}
.auth-btn-demo:hover { border-color: #C7CCD4; background: #FAFBFC; }
.auth-btn-demo i { color: var(--au-accent); }

/* вход по Telegram — наша кнопка в едином стиле (ширина как у остальных) */
.auth-btn-tg { background: #29A9EB; color: #fff; margin-bottom: 10px; }
.auth-btn-tg:hover { background: #1E96D6; }
.auth-btn-tg i { color: #fff; font-size: 17px; }

/* разделитель «или» */
.auth-or {
    display: flex; align-items: center; gap: 14px;
    margin: 18px 0;
    color: #9AA1AC; font-size: 12.5px; font-weight: 500;
}
.auth-or::before, .auth-or::after {
    content: ""; flex: 1; height: 1px; background: var(--au-line);
}

.auth-legal {
    margin: 12px 2px 0;
    font-size: 12px; line-height: 1.5; color: var(--au-muted);
}
.auth-legal a { color: #374151; text-decoration: underline; }

.auth-switch {
    margin: 18px 0 0; text-align: center;
    font-size: 14px; color: var(--au-muted);
}
.auth-switch a { color: var(--au-accent); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-switch-muted { margin-top: 10px; font-size: 13px; }
.auth-switch-muted a { color: var(--au-muted); font-weight: 500; }

/* флеш-сообщения */
.auth-flash {
    display: flex; align-items: center; gap: 9px;
    padding: 11px 14px; margin-bottom: 18px;
    border-radius: 12px;
    font-size: 13.5px; line-height: 1.4;
}
.auth-flash i { font-size: 16px; flex: none; }
.auth-flash.is-error { background: #FDECEC; color: #B42318; }
.auth-flash.is-info  { background: #EFF4FF; color: #1D4FD8; }

/* футер панели */
.auth-foot {
    margin-top: 30px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #9AA1AC;
}
.auth-foot a { color: var(--au-muted); text-decoration: none; }
.auth-foot a:hover { color: var(--au-ink); }

/* ───────────────────────── Адаптив ───────────────────────── */
@media (max-width: 880px) {
    .auth-grid { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-brand-mobile { display: inline-flex; }
    .auth-panel { padding: 32px 20px 40px; justify-content: flex-start; min-height: 100dvh; }
    .auth-card { margin-top: 4vh; }
    .auth-free-mobile {
        display: inline-flex; align-items: center; gap: 7px;
        margin-bottom: 20px;
        padding: 6px 12px; border-radius: 999px;
        background: rgba(22,112,74,0.08);
        color: var(--au-green); font-weight: 600; font-size: 12.5px;
    }
}

@media (max-width: 420px) {
    .auth-title { font-size: 24px; }
    .auth-card { margin-top: 2vh; }
}

/* высокие экраны — не липнуть к краям на десктопе */
@media (min-width: 881px) {
    .auth-aside { padding: clamp(40px, 5vw, 64px); }
}

/* невысокие экраны (небольшие ноутбуки) — поджимаем витрину, чтобы всё влезло */
@media (min-width: 881px) and (max-height: 820px) {
    .auth-aside { padding-top: 30px; padding-bottom: 26px; }
    .auth-slider { margin-top: 18px; }
    .auth-aside-title { font-size: 30px; margin-bottom: 18px; }
    .auth-dots { margin-bottom: 12px; }
    .auth-points { margin-bottom: 20px; gap: 12px; }
    .auth-aside-foot { padding-top: 16px; }
}
@media (min-width: 881px) and (max-height: 680px) {
    .auth-mock { display: none; }   /* совсем низкие — прячем мок, оставляем суть */
}

@media (prefers-reduced-motion: reduce) {
    .auth-card { animation: none; }
    .auth-spin { animation: none; }
}

/* ───────────────────────── reCAPTCHA ───────────────────────── */
/* Прячем плавающий бейдж Google (по требованию владельца). Условие Google —
   показать ссылку на их Политику/Условия: она в .auth-legal на регистрации. */
.grecaptcha-badge { visibility: hidden !important; }

/* ───────────────────────── Мелочи юзабилити ───────────────────────── */
/* состояние загрузки кнопки (анти-двойной-клик + отклик) */
.auth-btn[disabled], .auth-btn.is-loading { opacity: .75; cursor: default; pointer-events: none; }
.auth-spin {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .6s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* подсказка Caps Lock у поля пароля */
.auth-caps {
    display: none;
    align-items: center; gap: 6px;
    margin: 7px 2px 0;
    font-size: 12px; color: #B45309;
}
.auth-caps.show { display: flex; }
