/* =========================================================
   Foxenium — страницы входа и регистрации
   (Pages/Login.cshtml, Pages/Register.cshtml)

   Самостоятельный файл: подключается ТОЛЬКО в этих страницах
   (в App.razor его подключать не нужно). Все классы с
   префиксом fx-, чтобы не пересекаться с login.css, который
   по-прежнему использует ChangePassword.
   ========================================================= */

:root {
    --fx-navy: #0A2E4D;
    --fx-blue: #0F436E;
    --fx-deep: #062038;
    --fx-orange: #EE7B1B;
    --fx-amber: #F58A28;
    --fx-light: #F8FAFC;

    --fx-slate-50: #f8fafc;
    --fx-slate-100: #f1f5f9;
    --fx-slate-200: #e2e8f0;
    --fx-slate-300: #cbd5e1;
    --fx-slate-400: #94a3b8;
    --fx-slate-500: #64748b;
    --fx-slate-600: #475569;
    --fx-slate-800: #1e293b;

    --fx-font: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

[hidden] { display: none !important; }

/* ---------- Страница ---------- */
.fx-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--fx-font);
    color: var(--fx-slate-800);
    background-color: var(--fx-light);
    /* сетка «аналитики» на фоне */
    background-image:
        linear-gradient(to right, rgba(10, 46, 77, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(10, 46, 77, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fx-body ::selection {
    background: rgba(238, 123, 27, 0.2);
    color: var(--fx-navy);
}

.fx-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

/* ---------- Карточка split-screen ---------- */
.fx-shell {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(10, 46, 77, 0.18);
    animation: fx-fade-up 0.5s ease-out both;
}

@keyframes fx-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .fx-shell { animation: none; }
}

/* ---------- Левая колонка: бренд ---------- */
.fx-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 48px;
    overflow: hidden;
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, rgba(239, 246, 255, 0.7) 100%);
}

.fx-brand-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
    pointer-events: none;
}

/* z-index здесь НЕ задаём: иначе создаётся отдельный контекст наложения,
   и mix-blend-mode у логотипа перестаёт «растворять» его белый фон */
.fx-brand-top,
.fx-brand-bottom {
    position: relative;
}

/* у PNG-логотипа белый фон — multiply «растворяет» его в подложке */
.fx-logo {
    display: block;
    width: 100%;
    max-width: 340px;
    height: auto;
    margin: 0 0 8px -6px;
    mix-blend-mode: multiply; /* белый фон PNG сливается с подложкой */
}

.fx-lead {
    margin: 20px 0 0;
    max-width: 28rem;
    font-size: 15px;
    line-height: 1.65;
    color: var(--fx-slate-600);
}

.fx-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.fx-metric {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(4px);
}

.fx-metric-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.fx-metric-icon svg { width: 20px; height: 20px; }

.fx-metric-icon--orange { background: rgba(238, 123, 27, 0.1); color: var(--fx-orange); }
.fx-metric-icon--navy   { background: rgba(10, 46, 77, 0.1);   color: var(--fx-navy); }

.fx-metric-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--fx-slate-500);
}

.fx-metric-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 2px;
}

.fx-metric-value strong {
    font-size: 18px;
    font-weight: 700;
    color: var(--fx-navy);
}

.fx-chip {
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
}

.fx-chip--green { background: #ecfdf5; color: #059669; }
.fx-chip--blue  { background: #eff6ff; color: var(--fx-blue); }

.fx-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    font-weight: 500;
    color: var(--fx-slate-500);
}

.fx-features li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fx-features li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fx-orange);
}

.fx-features li:nth-child(even)::before { background: var(--fx-navy); }

/* ---------- Правая колонка: форма ---------- */
.fx-form-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px;
    background: #fff;
}

.fx-form-wrap {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.fx-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--fx-navy);
}

.fx-subtitle {
    margin: 8px 0 28px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fx-slate-500);
}

/* Переключатель «Вход в систему / Регистрация» */
.fx-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    margin-bottom: 28px;
    background: var(--fx-slate-100);
    border-radius: 12px;
}

.fx-tab {
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: var(--fx-slate-500);
    border-radius: 8px;
    transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.fx-tab:hover { color: var(--fx-navy); }

.fx-tab--active {
    color: var(--fx-navy);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.fx-tab:focus-visible {
    outline: 2px solid var(--fx-blue);
    outline-offset: 2px;
}

/* Сообщение об ошибке */
.fx-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px;
    font-size: 14px;
    line-height: 1.4;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 12px;
}

.fx-alert svg {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

/* Поля */
.fx-form { display: flex; flex-direction: column; gap: 18px; }

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

.fx-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--fx-slate-600);
}

.fx-input-wrap { position: relative; }

.fx-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--fx-slate-400);
    pointer-events: none;
}

.fx-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    font: inherit;
    font-size: 14px;
    color: var(--fx-slate-800);
    background: var(--fx-slate-50);
    border: 1px solid var(--fx-slate-200);
    border-radius: 12px;
    outline: none;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.fx-input::placeholder { color: var(--fx-slate-400); }

.fx-input:focus {
    background: #fff;
    border-color: var(--fx-blue);
    box-shadow: 0 0 0 4px rgba(15, 67, 110, 0.1);
}

.fx-input--password { padding-right: 44px; }

.fx-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--fx-slate-400);
    background: none;
    border: 0;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    transition: color 0.2s;
}

.fx-toggle:hover { color: var(--fx-navy); }

.fx-toggle:focus-visible {
    outline: 2px solid var(--fx-blue);
    outline-offset: -2px;
}

.fx-toggle svg { width: 16px; height: 16px; }

/* Чекбокс «Запомнить меня» */
.fx-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    font-size: 14px;
    color: var(--fx-slate-600);
    cursor: pointer;
    user-select: none;
}

.fx-check:hover { color: var(--fx-slate-800); }

.fx-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--fx-navy);
    cursor: pointer;
}

/* Кнопка «Войти» */
.fx-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 6px;
    padding: 14px 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, var(--fx-navy) 0%, var(--fx-blue) 50%, var(--fx-orange) 100%);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(10, 46, 77, 0.2), 0 4px 6px -4px rgba(10, 46, 77, 0.2);
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s, opacity 0.2s;
}

.fx-submit:hover { filter: brightness(1.1); }
.fx-submit:active { transform: scale(0.99); }

.fx-submit:focus-visible {
    outline: 3px solid rgba(238, 123, 27, 0.5);
    outline-offset: 2px;
}

.fx-submit svg { width: 16px; height: 16px; }

.fx-submit[disabled] {
    opacity: 0.8;
    cursor: wait;
    filter: none;
}

.fx-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fx-spin 0.7s linear infinite;
}

@keyframes fx-spin { to { transform: rotate(360deg); } }

/* Подсказка под полем */
.fx-hint {
    font-size: 12px;
    line-height: 1.4;
    color: var(--fx-slate-400);
}

/* Кнопка-ссылка (<a class="fx-submit fx-submit--link">) */
.fx-submit--link {
    margin-top: 24px;
    text-decoration: none;
}

/* Ссылка в тексте */
.fx-link {
    font-weight: 600;
    color: var(--fx-blue);
    text-decoration: none;
}

.fx-link:hover {
    color: var(--fx-orange);
    text-decoration: underline;
}

/* Примечание под формой */
.fx-note {
    margin: 28px 0 0;
    padding-top: 20px;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    color: var(--fx-slate-500);
    border-top: 1px solid var(--fx-slate-200);
}

/* ---------- Подвал ---------- */
.fx-footer {
    flex: none;
    padding: 16px 24px;
    font-size: 12px;
    text-align: center;
    color: var(--fx-slate-400);
}

/* ---------- Планшет и телефон ---------- */
@media (max-width: 900px) {
    .fx-main { padding: 24px 16px; }

    .fx-shell { grid-template-columns: 1fr; }

    /* на узком экране от бренда оставляем только логотип,
       чтобы форма была сразу на виду */
    .fx-brand {
        align-items: center;
        padding: 28px 24px 20px;
        border-right: 0;
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    }

    .fx-logo { max-width: 220px; margin: 0; }

    .fx-lead,
    .fx-brand-bottom { display: none; }

    .fx-form-side { padding: 32px 24px 36px; }

    .fx-title { font-size: 26px; }
}

@media (max-width: 380px) {
    .fx-form-side { padding: 28px 18px 32px; }
}
