/* ============================================================
   Media Vision — страницы входа (account / office)
   Дизайн приведён к палитре и анимациям основного сайта:
   чёрный #0a0a0b, алый #D80032 → бордо #78121E,
   Montserrat (заголовки) + Mulish (текст), орбы, reveal-плавность.
   ============================================================ */

:root {
    --bg: #0a0a0b;
    --bg-2: #0f0f12;
    --card: #141419;
    --card-2: #18181e;
    --line: #232329;
    --line-light: #2c2c34;
    --text: #f4f4f6;
    --muted: #9b9ba3;
    --muted-2: #6e6e76;
    --red: #d80032;
    --red-bright: #ef233c;
    --maroon: #78121e;
    --grad: linear-gradient(90deg, #d80032 0%, #78121e 100%);
    --shadow-red: 0 10px 40px rgba(216, 0, 50, .35);
    --radius: 20px;
    --radius-sm: 12px;
    --font-head: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    --font-body: 'Mulish', 'Segoe UI', Arial, sans-serif;

    /* Легат-имена, которые используют inline-стили страниц (login, 2fa, forgot) */
    --text-primary: var(--text);
    --text-secondary: var(--muted);
    --text-tertiary: var(--muted-2);
    --divider: var(--line);
    --input-bg: var(--card);
    --input-border: var(--line);
    --input-border-focus: var(--red-bright);
    --input-ring: rgba(216, 0, 50, .14);
    --color-danger: var(--red-bright);
    --color-danger-bg: rgba(216, 0, 50, .08);
    --success-bg: rgba(74, 222, 128, .08);
    --success-border: rgba(74, 222, 128, .35);
    --success-text: #86efac;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--red); color: #fff; }

/* ---------- Орбы: те же, что на главном сайте ---------- */
.auth-orb {
    position: fixed; border-radius: 50%; filter: blur(95px);
    z-index: 0; pointer-events: none; will-change: transform;
}
.auth-orb-1 { width: 540px; height: 540px; top: -160px; left: -180px; opacity: .4;
    background: radial-gradient(circle, rgba(216, 0, 50, .55), transparent 68%);
    animation: authOrb1 26s ease-in-out infinite alternate; }
.auth-orb-2 { width: 480px; height: 480px; top: 32%; right: -200px; opacity: .32;
    background: radial-gradient(circle, rgba(120, 18, 30, .7), transparent 68%);
    animation: authOrb2 34s ease-in-out infinite alternate; }
.auth-orb-3 { width: 400px; height: 400px; bottom: -140px; left: 24%; opacity: .26;
    background: radial-gradient(circle, rgba(216, 0, 50, .4), transparent 68%);
    animation: authOrb3 40s ease-in-out infinite alternate; }
@keyframes authOrb1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(110px, 80px) scale(1.18); } }
@keyframes authOrb2 { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-90px, -70px) scale(0.92); } }
@keyframes authOrb3 { from { transform: translate(0, 0) scale(0.95); } to { transform: translate(70px, -90px) scale(1.12); } }

/* ---------- Каркас: форма слева, бренд-панель справа ---------- */
.auth-split { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.auth-left {
    flex: 0 1 660px;
    display: flex; flex-direction: column; justify-content: center;
    padding: 4.5rem clamp(1.6rem, 5vw, 5.5rem) 4.5rem clamp(1.6rem, 7vw, 7.5rem);
}

.auth-right {
    flex: 1; position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center; gap: 1.2rem;
    padding: 4rem clamp(2rem, 5vw, 5.5rem);
    border-left: 1px solid var(--line);
    background:
        radial-gradient(ellipse 65% 50% at 68% 42%, rgba(216, 0, 50, .1), transparent 62%),
        var(--bg-2);
}

/* ---------- Плавное появление блоков (каскад) ---------- */
.ain { animation: authUp .8s cubic-bezier(.22, .61, .36, 1) both; animation-delay: var(--d, 0s); }
@keyframes authUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.auth-left > * { animation: authUp .8s cubic-bezier(.22, .61, .36, 1) both; }
.auth-left > *:nth-child(1)  { animation-delay: .05s; }
.auth-left > *:nth-child(2)  { animation-delay: .12s; }
.auth-left > *:nth-child(3)  { animation-delay: .18s; }
.auth-left > *:nth-child(4)  { animation-delay: .24s; }
.auth-left > *:nth-child(5)  { animation-delay: .3s; }
.auth-left > *:nth-child(6)  { animation-delay: .36s; }
.auth-left > *:nth-child(7)  { animation-delay: .42s; }
.auth-left > *:nth-child(8)  { animation-delay: .48s; }
.auth-left > *:nth-child(9)  { animation-delay: .54s; }
.auth-left > *:nth-child(10) { animation-delay: .6s; }

/* Поля формы выходят вслед за карточкой (скрытые input пропускаем) */
.auth-left form > *:not([type="hidden"]) { animation: authUp .6s cubic-bezier(.22, .61, .36, 1) both; }
.auth-left form > *:nth-child(3) { animation-delay: .42s; }
.auth-left form > *:nth-child(4) { animation-delay: .49s; }
.auth-left form > *:nth-child(5) { animation-delay: .56s; }
.auth-left form > *:nth-child(6) { animation-delay: .63s; }
.auth-left form > *:nth-child(7) { animation-delay: .7s; }

/* ---------- Логотип ---------- */
.auth-brand { display: inline-flex; margin-bottom: 2.4rem; }
.auth-brand img { height: 34px; width: auto; }
.auth-brand svg { border-radius: 10px; }

/* ---------- Заголовки страницы ---------- */
.auth-heading {
    font-family: var(--font-head); font-weight: 800;
    font-size: clamp(1.9rem, 3.4vw, 2.7rem);
    letter-spacing: -.02em; line-height: 1.15;
    margin-bottom: .55rem;
}
.auth-subheading { color: var(--muted); font-size: 1.02rem; margin-bottom: 2.1rem; }
.auth-divider {
    height: 1px; background: var(--line); margin: 0 0 2.1rem;
    transform-origin: left;
    animation: authLine .9s .3s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes authLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Бренд-панель справа ---------- */
.auth-kicker {
    display: inline-flex; align-items: center; gap: .6rem;
    font-family: var(--font-head); font-weight: 700; font-size: .85rem;
    letter-spacing: .22em; text-transform: uppercase; color: var(--red-bright);
}
.auth-kicker::before, .auth-kicker::after {
    content: ''; width: 34px; height: 2px; background: var(--red-bright); border-radius: 2px;
    animation: authDash 1s .5s ease both;
}
@keyframes authDash { from { width: 0; } to { width: 34px; } }

.auth-hero-title {
    font-family: var(--font-head); font-weight: 900;
    font-size: clamp(2.2rem, 3.8vw, 3.7rem);
    letter-spacing: -.025em; line-height: 1.12;
}
.auth-hero-title .w {
    display: inline-block; margin-right: .26em;
    opacity: 0; transform: translateY(.55em); filter: blur(8px);
    animation: authWord .85s cubic-bezier(.22, .61, .36, 1) forwards;
    animation-delay: calc(.25s + var(--i) * .07s);
}
@keyframes authWord { to { opacity: 1; transform: none; filter: blur(0); } }

.auth-hero-sub { color: var(--muted); font-size: 1.08rem; max-width: 460px; }

.auth-hero-badge {
    display: inline-flex; align-items: center; gap: .6rem; width: max-content;
    font-size: .92rem; font-weight: 600; color: var(--muted);
    border: 1px solid var(--line-light); border-radius: 500px;
    padding: .55rem 1.2rem; background: rgba(20, 20, 25, .5);
}
.auth-hero-badge svg { width: 18px; height: 18px; color: var(--red-bright); }

/* ---------- Поля ввода: плавность на каждом действии ---------- */
.auth-form-group { margin-bottom: 1.15rem; }

.auth-form-group label,
.auth-label-row label {
    display: block;
    font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); margin-bottom: .5rem;
    transition: color .25s ease;
}
.auth-form-group:focus-within label { color: var(--red-bright); }

.auth-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.auth-label-row label { margin-bottom: 0; }
.auth-label-row a {
    font-size: .85rem; font-weight: 600; color: var(--muted-2);
    text-decoration: none; transition: color .25s ease;
}
.auth-label-row a:hover { color: var(--red-bright); }

.auth-input {
    width: 100%; height: 52px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0 1.1rem;
    font-size: 1rem; font-family: inherit;
    outline: none;
    caret-color: var(--red-bright);
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.auth-input::placeholder { color: var(--muted-2); transition: color .25s ease; }
.auth-input:focus::placeholder { color: var(--muted); }
.auth-input:hover { border-color: var(--line-light); }
.auth-input:focus {
    border-color: var(--red-bright);
    background: var(--card-2);
    box-shadow: 0 0 0 4px rgba(216, 0, 50, .14);
}

.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 52px; }
.auth-input-eye {
    position: absolute; right: 2px; top: 2px; bottom: 2px; width: 48px;
    background: transparent; border: 0; color: var(--muted-2); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    transition: color .25s ease, transform .2s ease;
}
.auth-input-eye:hover { color: var(--red-bright); }
.auth-input-eye:active { transform: scale(.9); }
.auth-input-eye svg { flex-shrink: 0; }

/* Код 2FA: те же токены, что и у полей */
.code-cell {
    border-radius: var(--radius-sm) !important;
    font-family: var(--font-head) !important;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease !important;
}

/* ---------- Чекбокс ---------- */
.auth-checkbox {
    display: flex; align-items: center; gap: .6rem;
    margin: .2rem 0 1.6rem; cursor: pointer; width: max-content;
}
.auth-checkbox input[type="checkbox"] {
    width: 18px; height: 18px; border-radius: 6px;
    border: 1px solid var(--line-light);
    appearance: none; -webkit-appearance: none;
    background: var(--card); cursor: pointer; position: relative; flex-shrink: 0;
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.auth-checkbox input[type="checkbox"]:hover { border-color: var(--red-bright); }
.auth-checkbox input[type="checkbox"]:checked {
    background: var(--grad); border-color: transparent;
    box-shadow: 0 4px 14px rgba(216, 0, 50, .35);
}
.auth-checkbox input[type="checkbox"]:checked::after {
    content: ''; position: absolute; top: 3px; left: 6px;
    width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: authCheck .25s ease both;
}
@keyframes authCheck {
    from { transform: rotate(45deg) scale(.4); opacity: 0; }
    to   { transform: rotate(45deg) scale(1);  opacity: 1; }
}
.auth-checkbox span { font-size: .95rem; color: var(--muted); user-select: none; transition: color .25s ease; }
.auth-checkbox:hover span { color: var(--text); }

/* ---------- Кнопка: как btn-primary на сайте + блик ---------- */
.auth-btn {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: .55rem;
    width: 100%; height: 54px; border: 0; border-radius: 500px;
    background: var(--grad); color: #fff;
    font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(216, 0, 50, .28);
    transition: transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.auth-btn::after {
    content: ''; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: skewX(-20deg);
    transition: left .55s ease;
}
.auth-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-red); }
.auth-btn:hover::after { left: 125%; }
.auth-btn:active { transform: translateY(-1px); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 0 6px 24px rgba(216, 0, 50, .15); }
.auth-btn:disabled::after { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
.auth-spinner {
    width: 16px; height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor; border-right-color: currentColor;
    border-radius: 50%;
    animation: spin .5s linear infinite;
}

/* ---------- Ошибка / успех ---------- */
.auth-error, .auth-success {
    display: none;
    padding: .85rem 1.05rem; border-radius: var(--radius-sm);
    font-size: .93rem; font-weight: 600; line-height: 1.5;
    margin-bottom: 1.2rem;
    animation: authUp .4s ease both;
}
.auth-error { background: rgba(216, 0, 50, .08); border: 1px solid rgba(216, 0, 50, .35); color: #ffb3c0; }
.auth-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-text); }

/* ---------- Подвал страницы ---------- */
.auth-footer { margin-top: 1.8rem; font-size: .93rem; color: var(--muted); text-align: center; line-height: 1.6; }
.auth-footer a { color: var(--text); font-weight: 600; text-decoration: none; transition: color .25s ease; }
.auth-footer a:hover { color: var(--red-bright); }

/* ---------- Адаптив ---------- */
@media (max-width: 980px) {
    .auth-right { display: none; }
    .auth-left { flex: 1; padding: 3.6rem 1.5rem; }
}
@media (max-width: 520px) {
    .auth-input { height: 50px; font-size: 16px; }
    .auth-btn { height: 52px; }
}

/* ---------- Бережно к prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .auth-hero-title .w { opacity: 1; transform: none; filter: none; }
}
