/* ==========================================================================
   auth.css — premium split-layout login page.
   Зависит от tokens.css. Не использует layout.css auth-shell.
   2026-style: Manrope + gradient-mesh brand panel + glass form card.
   ========================================================================== */

/* ---------- anti-FOUC: скрывать body до применения темы ---------- */
body:not([data-theme-ready]) { visibility: hidden; }
body[data-theme-ready] { visibility: visible; }

/* ---------- font: Manrope для заголовков, Inter для тела ---------- */

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body.auth-body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-1);
    background: var(--bg-app);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   SPLIT LAYOUT — десктоп
   ========================================================================== */

.auth-split {
    display: grid;
    grid-template-columns: 55fr 45fr;
    min-height: 100vh;
}

/* ---------- LEFT: brand panel ---------- */
.auth-brand-panel {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;

    /* глубокий тёмно-розовый градиент-меш */
    background:
        radial-gradient(ellipse 80% 60% at 110% -10%, rgba(184, 18, 107, 0.70) 0%, transparent 55%),
        radial-gradient(ellipse 70% 70% at -20% 110%, rgba(120, 10, 80, 0.80) 0%, transparent 55%),
        radial-gradient(ellipse 50% 50% at 60% 50%, rgba(156, 31, 107, 0.18) 0%, transparent 60%),
        linear-gradient(145deg, #0f0810 0%, #1a0a12 40%, #140814 70%, #0c0709 100%);
    color: #fff;
}

/* Световые пятна (blobs) — слои поверх фона */
.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle 420px at 15% 25%, rgba(232, 30, 140, 0.14) 0%, transparent 70%),
        radial-gradient(circle 280px at 85% 75%, rgba(184, 18, 107, 0.20) 0%, transparent 65%),
        radial-gradient(circle 200px at 50% 100%, rgba(120, 5, 70, 0.30) 0%, transparent 60%);
    pointer-events: none;
}

/* Subtle grid noise текстура */
.auth-brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 0h1v1H0z' fill='rgba(255,255,255,0.018)'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
}

/* --- brand panel: top section --- */
.auth-panel-top {
    position: relative;
    z-index: 1;
}

.auth-panel-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-panel-logo-img {
    height: 34px;
    width: auto;
    display: block;
    /* инвертируем для тёмного фона если логотип тёмный — fallback */
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.auth-panel-logo-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.20);
    flex-shrink: 0;
}

.auth-panel-logo-label {
    font-family: 'Manrope', var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --- brand panel: middle — slogan --- */
.auth-panel-body {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 0 40px;
}

.auth-panel-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Manrope', var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(233, 30, 140, 0.90);
    margin-bottom: 20px;
}

.auth-panel-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #E91E8C;
    box-shadow: 0 0 10px rgba(233, 30, 140, 0.80);
    flex-shrink: 0;
    animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(233, 30, 140, 0.80); }
    50%       { opacity: 0.6; box-shadow: 0 0 20px rgba(233, 30, 140, 0.50); }
}

.auth-panel-headline {
    font-family: 'Manrope', var(--font-sans);
    font-size: clamp(32px, 3.2vw, 46px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0 0 20px;
}

.auth-panel-headline-accent {
    /* Градиентный текст в брендовых тонах */
    background: linear-gradient(135deg, #ff6eb4 0%, #E91E8C 45%, #c0186b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-panel-sub {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.50);
    max-width: 400px;
}

/* --- brand panel: feature pills --- */
.auth-panel-features {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 40px;
}

.auth-feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.01em;
    transition: background 200ms ease, border-color 200ms ease;
}

.auth-feature-pill-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #E91E8C;
}

/* --- brand panel: bottom --- */
.auth-panel-footer {
    position: relative;
    z-index: 1;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   RIGHT: form panel
   ========================================================================== */

.auth-form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--bg-app);
    position: relative;
    overflow: hidden;
}

/* Тонкий градиентный блик сверху-справа */
.auth-form-panel::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 30, 140, 0.055) 0%, transparent 70%);
    pointer-events: none;
}

/* ---------- card ---------- */
.auth-card-v2 {
    width: 100%;
    max-width: 400px;
    position: relative;

    /* Анимация появления */
    animation: card-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- card header ---------- */
.auth-card-header {
    margin-bottom: 32px;
}

.auth-card-logo-mobile {
    display: none; /* скрыт на десктопе */
    margin-bottom: 24px;
}

.auth-card-logo-mobile img {
    height: 28px;
    width: auto;
}

.auth-card-title {
    font-family: 'Manrope', var(--font-sans);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.028em;
    line-height: 1.15;
    color: var(--text-1);
    margin: 0 0 8px;
}

.auth-card-sub {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.55;
    margin: 0;
}

/* ---------- alert ---------- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #C8372D;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 20px;
}

:root[data-theme="dark"] .auth-alert {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #F87171;
}

.auth-alert-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #EF4444;
}

/* ---------- form ---------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: 0.01em;
    line-height: 1;
}

/* Обёртка инпута с иконкой */
.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-3);
    pointer-events: none;
    flex-shrink: 0;
    transition: color 180ms ease;
}

.auth-input {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 42px; /* место для иконки слева и глаза справа */
    border: 1.5px solid var(--border-input);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-1);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    outline: none;
    transition:
        border-color 160ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1),
        background 160ms ease;
    -webkit-appearance: none;
    appearance: none;
}

/* Поле без иконки справа (имя) — меньше правый padding */
.auth-input.no-right-icon {
    padding-right: 14px;
}

.auth-input::placeholder {
    color: var(--text-3);
    font-weight: 400;
}

.auth-input:hover:not(:focus) {
    border-color: var(--border-hover);
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow:
        0 0 0 3px rgba(233, 30, 140, 0.14),
        0 1px 4px rgba(233, 30, 140, 0.08);
    background: var(--bg-card);
}

/* При фокусе иконка тоже окрашивается */
.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--accent);
}

/* Кнопка показать/скрыть пароль */
.auth-toggle-pw {
    position: absolute;
    right: 12px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    color: var(--text-3);
    border-radius: 6px;
    transition: color 160ms ease, background 160ms ease;
    -webkit-tap-highlight-color: transparent;
}

.auth-toggle-pw:hover {
    color: var(--text-2);
    background: var(--bg-hover);
}

.auth-toggle-pw:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}

.auth-toggle-pw svg { display: block; }

/* скрытый вариант иконки глаза */
.auth-toggle-pw .eye-off { display: none; }
.auth-toggle-pw.is-visible .eye-on  { display: none; }
.auth-toggle-pw.is-visible .eye-off { display: block; }

/* ---------- submit button ---------- */
.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    padding: 0 20px;
    border: none;
    border-radius: 12px;
    font-family: 'Manrope', var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    /* Брендовый градиент */
    background: linear-gradient(135deg, #e9238c 0%, #c71776 100%);
    color: #fff;

    /* Многослойная тень */
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.14),
        0 4px 12px rgba(233, 30, 140, 0.32),
        0 0 0 0 rgba(233, 30, 140, 0);

    transition:
        transform 140ms cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 140ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 140ms ease;

    margin-top: 4px;
}

/* Световая вспышка при hover */
.auth-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 60%);
    pointer-events: none;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.14),
        0 8px 20px rgba(233, 30, 140, 0.38),
        0 0 0 0 rgba(233, 30, 140, 0);
    filter: brightness(1.05);
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.14),
        0 2px 8px rgba(233, 30, 140, 0.28);
    filter: brightness(0.97);
}

.auth-submit:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(233, 30, 140, 0.35),
        0 4px 12px rgba(233, 30, 140, 0.28);
}

.auth-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------- form footer ---------- */
.auth-form-footer {
    margin-top: 20px;
    text-align: center;
}

.auth-link {
    font-size: 13px;
    color: var(--text-3);
    text-decoration: none;
    transition: color 140ms ease;
}

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

/* ---------- card footer copyright ---------- */
.auth-copyright {
    margin-top: 40px;
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   DARK THEME OVERRIDES
   ========================================================================== */

:root[data-theme="dark"] .auth-form-panel {
    background: var(--bg-app); /* #0B0C0F */
}

:root[data-theme="dark"] .auth-form-panel::before {
    background: radial-gradient(circle, rgba(233, 30, 140, 0.07) 0%, transparent 70%);
}

:root[data-theme="dark"] .auth-input {
    background: var(--bg-card); /* #14151A */
    border-color: var(--border-input); /* #34363F */
    color: var(--text-1); /* #ECEDF1 */
}

:root[data-theme="dark"] .auth-input:focus {
    background: #1a1b21;
    border-color: var(--accent);
    box-shadow:
        0 0 0 3px rgba(233, 30, 140, 0.18),
        0 1px 4px rgba(233, 30, 140, 0.12);
}

:root[data-theme="dark"] .auth-card-title {
    color: var(--text-1);
}

/* ==========================================================================
   MOBILE — одна колонка
   ========================================================================== */

@media (max-width: 900px) {
    .auth-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    /* Брендовая панель сворачивается в тонкий хедер */
    .auth-brand-panel {
        padding: 0;
        min-height: 0;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        /* Горизонтальный градиент-баннер */
        background:
            radial-gradient(ellipse 140% 300% at 100% 50%, rgba(184, 18, 107, 0.65) 0%, transparent 55%),
            radial-gradient(ellipse 80% 200% at 0% 50%, rgba(120, 10, 80, 0.55) 0%, transparent 50%),
            linear-gradient(90deg, #0f0810 0%, #1a0a12 60%, #200c16 100%);
    }

    /* Скрываем тяжёлый контент — только логотип */
    .auth-panel-body,
    .auth-panel-features,
    .auth-panel-footer {
        display: none;
    }

    .auth-panel-top {
        padding: 16px 24px;
    }

    .auth-panel-logo-label {
        font-size: 11px;
    }

    /* Форм-панель: полная высота */
    .auth-form-panel {
        padding: 36px 24px 40px;
        justify-content: flex-start;
        padding-top: 44px;
    }

    .auth-card-logo-mobile {
        display: block;
    }

    /* На мобиле скрываем панельный логотип в заголовке карточки — он в brand-panel */
}

@media (max-width: 480px) {
    .auth-panel-top {
        padding: 14px 20px;
    }

    .auth-form-panel {
        padding: 32px 20px 36px;
    }

    .auth-card-title {
        font-size: 22px;
    }

    .auth-card-v2 {
        max-width: 100%;
    }
}

/* ==========================================================================
   DATALIST CUSTOM ARROW — минимальный (нативный UI браузера)
   ========================================================================== */
input[list] {
    /* Убираем дефолтную стрелку Safari */
    -webkit-appearance: none;
    appearance: none;
}
