/* ════════════════════════════════════════════════════════════════════
   VibeeCode — страницы авторизации, раскладка «две половины».
   Подключается ТОЛЬКО login/register/forgot/reset: лендинг вшивает
   styles.css в документ, и лишние правила там оплачивались бы LCP.
   Базовые токены, кнопки и поля берутся из styles.css.
   ════════════════════════════════════════════════════════════════════ */

/* ─────────────── Каркас ─────────────── */
body.auth-split { margin: 0; min-height: 100vh; background: var(--bg); overflow-x: hidden; }

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    opacity: 1;
    transition: opacity .22s ease;
}
/* Уход со страницы: скрипт вешает класс перед переходом на соседнюю форму. */
.auth-shell.is-leaving { opacity: 0; }
.auth-shell.is-leaving .auth-card { transform: translateY(-10px) scale(.985); }

/* ─────────────── Левая половина: бренд ─────────────── */
.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 34px;
    padding: 44px 52px;
    border-right: 1px solid var(--border-soft);
    background: linear-gradient(158deg, #0c0c1a 0%, #08080f 58%, #06060c 100%);
}

/* Фон: два медленных пятна + точечная сетка, гаснущая к правому краю. */
.auth-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(120% 90% at 20% 20%, #000 20%, transparent 78%);
    mask-image: radial-gradient(120% 90% at 20% 20%, #000 20%, transparent 78%);
    pointer-events: none;
}
.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    pointer-events: none;
    will-change: transform;
}
.auth-orb-1 { width: 460px; height: 460px; top: -140px; left: -120px; background: rgba(139,92,246,.34); animation: authFloat1 17s ease-in-out infinite; }
.auth-orb-2 { width: 380px; height: 380px; bottom: -130px; right: -90px; background: rgba(34,211,238,.20); animation: authFloat2 21s ease-in-out infinite; }
.auth-orb-3 { width: 250px; height: 250px; top: 42%; left: 44%; background: rgba(244,114,182,.13); animation: authFloat1 25s ease-in-out infinite reverse; }

@keyframes authFloat1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(46px, 38px, 0) scale(1.08); }
}
@keyframes authFloat2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-40px, -30px, 0) scale(1.1); }
}

.auth-brand,
.auth-aside-body,
.auth-aside-foot { position: relative; z-index: 1; }

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-d);
    font-weight: 700;
    font-size: 21px;
    letter-spacing: -.01em;
    color: var(--text);
    text-decoration: none;
    align-self: flex-start;
}
.auth-brand img { display: block; border-radius: 7px; }
.auth-brand span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.auth-aside-body { max-width: 430px; }
.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-2);
    margin: 0 0 16px;
}
.auth-eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent));
}
.auth-aside-h {
    font-family: var(--font-d);
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.12;
    letter-spacing: -.03em;
    margin: 0 0 18px;
    color: var(--text);
}
.auth-aside-h b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: inherit; }
.auth-aside-sub { color: var(--muted); font-size: 15.5px; line-height: 1.6; margin: 0 0 28px; }

.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-points li {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14.6px;
    color: var(--text);
}
.auth-points li::before {
    content: '✓';
    flex: none;
    width: 21px;
    height: 21px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
    color: #c4b5fd;
    background: rgba(139,92,246,.16);
    border: 1px solid rgba(139,92,246,.32);
}

/* Мини-терминал: продукт — рабочее место для агентов, и панель об этом говорит
   лучше любой подписи. Строки проявляются по очереди, каретка мигает. */
.auth-term {
    margin-top: 30px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(6,6,12,.66);
    backdrop-filter: blur(10px);
    box-shadow: 0 24px 60px -30px rgba(0,0,0,.9);
    overflow: hidden;
}
.auth-term-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(255,255,255,.025);
}
.auth-term-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.16); }
.auth-term-bar i:first-child { background: rgba(244,114,182,.5); }
.auth-term-bar i:nth-child(2) { background: rgba(251,191,36,.45); }
.auth-term-bar i:nth-child(3) { background: rgba(52,211,153,.45); }
.auth-term-bar em {
    margin-left: 6px;
    font-style: normal;
    font-family: var(--font-m);
    font-size: 11.5px;
    color: var(--muted-2);
}
.auth-term-body { padding: 14px 16px 16px; font-family: var(--font-m); font-size: 12.6px; line-height: 1.85; }
.auth-term-body p { margin: 0; color: var(--muted); }
.auth-term-body .tl-cmd { color: var(--text); }
.auth-term-body .tl-cmd b { color: var(--accent-2); font-weight: 600; }
.auth-term-body .tl-ok { color: var(--ok); }
.auth-term-body .tl-caret::after {
    content: '▍';
    color: var(--accent-2);
    animation: authCaret 1.05s steps(1) infinite;
}
@keyframes authCaret { 50% { opacity: 0; } }

.auth-aside-foot { color: var(--muted-2); font-size: 12.8px; }
.auth-aside-foot a { color: var(--muted); }
.auth-aside-foot a:hover { color: var(--text); }

/* ─────────────── Правая половина: форма ─────────────── */
.auth-main {
    display: grid;
    place-items: center;
    padding: 48px 40px;
    background:
        radial-gradient(60% 50% at 100% 0%, rgba(139,92,246,.10), transparent 62%),
        radial-gradient(50% 44% at 0% 100%, rgba(34,211,238,.06), transparent 62%),
        var(--bg);
}
.auth-main .auth-card {
    max-width: 400px;
    background: transparent;
    backdrop-filter: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transition: transform .22s ease;
}
.auth-main .auth-card h1 { font-size: 31px; margin: 0 0 8px; letter-spacing: -.03em; }
.auth-main .auth-lead { margin: 0 0 30px; }
.auth-main .auth-card label { margin-bottom: 15px; }
.auth-main .auth-card input { padding: 13.5px 15px; border-radius: 13px; }
.auth-main .btn-block { margin-top: 14px; }

/* Согласие с офертой: галочка и текст в одну строку, шрифт мельче поля. */
.auth-main .auth-card label.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 4px 0 8px;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--muted);
}
.auth-main .auth-card label.consent:focus-within { color: var(--muted); }
.auth-main .auth-card label.consent input {
    width: 17px;
    height: 17px;
    min-width: 17px;
    flex: 0 0 auto;
    margin: 1px 0 0;
    padding: 0;
    accent-color: var(--accent);
}
.auth-main .auth-card label.consent span { flex: 1; min-width: 0; }
.auth-main .auth-card label.consent a { color: var(--accent-2); }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 22px;
    font-size: 13.4px;
    color: var(--muted);
    text-decoration: none;
    transition: color .16s, gap .16s;
}
.auth-back:hover { color: var(--text); gap: 11px; }

/* ─────────────── Появление страницы ─────────────── */
@keyframes authRise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}
@keyframes authSlideLeft {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: none; }
}
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(20px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes authGrow {
    from { opacity: 0; transform: scaleX(0); }
    to   { opacity: 1; transform: none; }
}

.auth-brand      { animation: authSlideLeft .5s .05s cubic-bezier(.22,.68,.32,1) both; }
.auth-eyebrow    { animation: authSlideLeft .5s .12s cubic-bezier(.22,.68,.32,1) both; }
.auth-aside-h    { animation: authSlideLeft .6s .18s cubic-bezier(.22,.68,.32,1) both; }
.auth-aside-sub  { animation: authSlideLeft .6s .24s cubic-bezier(.22,.68,.32,1) both; }
.auth-points     { animation: authSlideLeft .6s .3s cubic-bezier(.22,.68,.32,1) both; }
.auth-term       { animation: authRise .65s .38s cubic-bezier(.22,.68,.32,1) both; }
.auth-aside-foot { animation: authRise .5s .5s ease both; }
.auth-term-body p:nth-child(1) { animation: authRise .38s .62s ease both; }
.auth-term-body p:nth-child(2) { animation: authRise .38s .82s ease both; }
.auth-term-body p:nth-child(3) { animation: authRise .38s 1.02s ease both; }
.auth-main .auth-card { animation: authCardIn .55s .1s cubic-bezier(.22,.68,.32,1) both; }

/* ─────────────── Поля: акцент на активном ─────────────── */
.auth-main .auth-card label { transition: color .18s; }
.auth-main .auth-card label:focus-within { color: var(--accent-2); }
.auth-main .auth-card input:focus {
    border-color: var(--accent);
    background: rgba(139,92,246,.07);
    box-shadow: 0 0 0 4px rgba(139,92,246,.16);
}
.auth-main .alert { animation: authRise .3s ease both; }

/* ─────────────── Узкие экраны ─────────────── */
@media (max-width: 1040px) {
    .auth-aside { padding: 38px 36px; }
    .auth-main { padding: 42px 30px; }
}
@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; min-height: 0; }
    .auth-aside {
        gap: 0;
        padding: 22px 24px;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }
    .auth-aside-body, .auth-aside-foot { display: none; }
    .auth-orb-1 { width: 260px; height: 260px; top: -150px; }
    .auth-orb-2, .auth-orb-3 { display: none; }
    .auth-main { padding: 40px 22px 64px; align-content: start; }
    .auth-main .auth-card { max-width: 420px; padding-top: 14px; }
    .auth-main .auth-card h1 { font-size: 27px; }
}
@media (max-width: 420px) {
    .auth-main { padding: 32px 18px 52px; }
    .auth-main .auth-card h1 { font-size: 25px; }
}

/* ─────────────── Меньше движения ─────────────── */
@media (prefers-reduced-motion: reduce) {
    .auth-shell, .auth-main .auth-card { transition: none; }
    .auth-orb,
    .auth-brand,
    .auth-eyebrow,
    .auth-aside-h,
    .auth-aside-sub,
    .auth-points,
    .auth-term,
    .auth-aside-foot,
    .auth-term-body p,
    .auth-main .auth-card { animation: none; opacity: 1; }
    .auth-term-body .tl-caret::after { animation: none; }
}
