/* ─────────────────────────────────────────────────────────────
   Поддержка — две страницы (/support/chat, /support/email).
   По data/_disign/support-shared.jsx + support-chat.jsx + support-email.jsx.
   Токены base.css (var(--*)). Брейкпоинты <768 / 768–1023 / 1024+. Контейнер 1080.
   Анимации suBlink / suSpin внизу.
   ───────────────────────────────────────────────────────────── */

.su-page { background: var(--bg); color: var(--text); }
.su-wrap {
    max-width: 1080px; margin: 0 auto; width: 100%; box-sizing: border-box;
    padding: 40px 60px 64px;
}
.su-title { margin: 0 0 6px; font-size: 34px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.su-sub   { margin: 0 0 24px; font-size: 16px; color: var(--text-muted); }

.su-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.su-col-main { min-width: 0; display: flex; flex-direction: column; }

.su-card {
    padding: 28px; border-radius: 18px;
    background: var(--bg-elevated); border: 1px solid var(--divider);
}

/* ── Email-форма ─────────────────────────────────────────────── */
.su-form { display: flex; flex-direction: column; gap: 16px; }
.su-field { display: flex; flex-direction: column; }
.su-label { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 7px; }

.su-input {
    width: 100%; height: 46px; padding: 0 14px; border-radius: 11px; box-sizing: border-box;
    border: 1.5px solid var(--divider); background: var(--bg);
    font-size: 14px; color: var(--text); font-family: inherit; outline: none;
}
.su-input:focus { border-color: var(--accent); }
.su-input::placeholder { color: var(--text-dim); }

.su-input--icon { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.su-input--icon .su-input-ic { color: var(--text-muted); display: flex; flex-shrink: 0; }
.su-input--icon input {
    flex: 1; min-width: 0; height: 100%; border: none; background: transparent;
    font-size: 14px; color: var(--text); font-family: inherit; outline: none;
}

.su-select-wrap { position: relative; }
.su-select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px; }
.su-select-chev {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--text-muted); display: flex;
}

.su-textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }

.su-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* honeypot — спрятать от людей, оставить доступным ботам */
.su-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.su-turnstile { min-height: 65px; }

/* Прикрепить файл (email + чат-кнопка email-страницы) */
.su-attach {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    padding: 14px; border-radius: 12px; border: 1.5px dashed var(--divider);
    background: transparent; color: var(--text-muted); cursor: pointer; font-family: inherit;
    transition: border-color .15s ease, color .15s ease;
}
.su-attach:hover { border-color: var(--accent); }
.su-attach.has-file { border-color: var(--accent); color: var(--text); }
.su-attach-ic { display: flex; flex-shrink: 0; }
.su-attach-text { font-size: 13px; font-weight: 600; }
.su-attach-hint { color: var(--text-dim); font-weight: 500; }

.su-consent { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.su-consent input { margin-top: 3px; accent-color: var(--accent); }
.su-consent span { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.su-submit {
    height: 50px; border-radius: 12px; width: 100%;
    background: var(--accent); color: #fff; border: none;
    font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 10px 24px rgba(255, 107, 53, 0.28);
    transition: opacity .15s ease;
}
.su-submit:hover { opacity: .94; }
.su-submit[disabled] { opacity: .55; cursor: default; box-shadow: none; }

.su-error {
    font-size: 13px; color: #DC4444; font-weight: 600;
    padding: 10px 12px; border-radius: 10px; background: rgba(220,68,68,0.08);
}
.su-error[hidden] { display: none; }

/* ── Success ─────────────────────────────────────────────────── */
.su-success { text-align: center; margin-top: 16px; }
.su-success[hidden] { display: none; }
.su-success-ic {
    width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px;
    background: rgba(31,138,91,0.10); color: #1F8A5B;
    display: flex; align-items: center; justify-content: center;
}
.su-success-title { font-size: 20px; font-weight: 800; color: var(--text); }
.su-success-sub { margin: 8px 0 0; font-size: 14px; color: var(--text-muted); line-height: 1.5; }

/* ════════ ЧАТ (support-chat.jsx, без фикции) ════════════════════ */
/* Колонка: гейт-шаги (email-бар, капча) НАД карточкой, затем сама карточка */
.su-chatwrap { display: flex; flex-direction: column; gap: 14px; width: 100%; }

/* Карточка чата — растёт по контенту (фикс. высоты больше нет).
   Фон = основной (--bg): в светлой теме белый, в тёмной — тёмный фон страницы.
   Раньше был --bg-elevated (серый) → просвечивал сквозь почти прозрачную ленту. */
.su-chat {
    display: flex; flex-direction: column; height: auto;
    border-radius: 18px; overflow: hidden;
    border: 1px solid var(--divider); background: var(--bg);
}

/* Шапка */
.su-chat-head {
    padding: 14px 18px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid var(--divider); flex-shrink: 0;
}
.su-chat-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, var(--navy) 120%);
    display: flex; align-items: center; justify-content: center;
}
.su-chat-head-info { flex: 1; min-width: 0; }
.su-chat-head-title { font-size: 15px; font-weight: 800; color: var(--text); }
.su-chat-head-sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.su-chat-head-sub svg { color: var(--text-muted); flex-shrink: 0; }

/* Email-бар «Куда отправить ответ?» — отдельная плашка НАД карточкой */
.su-email-bar {
    padding: 16px 18px; border-radius: 16px;
    background: var(--accent-soft); border: 1px solid var(--divider);
}
.su-chat-emailbar-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 800; color: var(--accent); }
.su-chat-emailfield {
    display: flex; align-items: center; gap: 8px;
    height: 44px; padding: 0 6px 0 14px; border-radius: 11px;
    background: var(--bg); border: 1.5px solid var(--divider);
}
.su-chat-emailfield.is-valid { border-color: #1F8A5B; }
.su-chat-emailfield input {
    flex: 1; min-width: 0; height: 100%; border: none; background: transparent;
    font-size: 14px; font-weight: 500; color: var(--text); font-family: inherit; outline: none;
}
.su-chat-save {
    flex-shrink: 0; height: 32px; padding: 0 14px; border-radius: 8px;
    background: var(--accent); color: #fff; border: none;
    font-size: 12px; font-weight: 800; cursor: pointer; font-family: inherit;
}
.su-chat-save[disabled] { opacity: .5; cursor: default; }
.su-chat-saved {
    display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
    padding: 0 10px; height: 32px; border-radius: 8px;
    background: rgba(31,138,91,0.10); color: #1F8A5B; font-size: 12px; font-weight: 800;
}
.su-chat-saved[hidden] { display: none; }
.su-chat-emailbar-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Лента сообщений (su-thread) — больше воздуха, растёт до 60vh со скроллом */
.su-thread {
    flex: 1 1 auto; min-height: 400px; max-height: 60vh; overflow-y: auto;
    padding: 22px 18px; display: flex; flex-direction: column; gap: 12px;
    background: rgba(11,20,55,0.01);
}
:root[data-theme="dark"] .su-thread { background: rgba(255,255,255,0.01); }
.su-bubble {
    max-width: 78%; padding: 12px 16px; border-radius: 14px;
    font-size: 14px; line-height: 1.55; word-wrap: break-word;
}
/* bot-пузырь: контрастный фон (--card) + граница + тень + чёткий текст */
.su-bubble--bot {
    align-self: flex-start; background: var(--card); color: var(--text);
    border: 1px solid var(--divider); border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px rgba(11, 20, 55, 0.10);
}
:root[data-theme="dark"] .su-bubble--bot { background: var(--card); border-color: rgba(255,255,255,0.10); box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.su-bubble--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }

/* Капча-гейт — отдельная плашка НАД карточкой (box даёт рамку) */
.su-gate { padding: 0; }
.su-gate[hidden] { display: none; }
.su-gate-box {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 12px;
    background: var(--bg); border: 1.5px solid var(--divider);
}
.su-gate-widget { flex-shrink: 0; min-height: 32px; display: flex; align-items: center; }
.su-gate-text { flex: 1; min-width: 0; }
.su-gate-title { font-size: 13px; font-weight: 700; color: var(--text); }
.su-gate-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.su-gate-guard { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; opacity: .7; color: var(--text-muted); }
.su-gate-guard span { font-size: 8px; font-weight: 700; color: var(--text-dim); letter-spacing: 0.04em; }

/* Подсказка-гейт «остался шаг — пройдите проверку» (НАД карточкой, у капчи) */
.su-verifyhint {
    margin: 0; padding: 10px 14px; border-radius: 12px;
    display: flex; align-items: center; gap: 8px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 12px; font-weight: 700;
}
.su-verifyhint[hidden] { display: none; }
.su-verifyhint svg { flex-shrink: 0; }

/* Композер */
.su-composer { padding: 8px 18px 16px; flex-shrink: 0; display: flex; align-items: flex-end; gap: 10px; }
.su-composer.is-locked { opacity: .55; pointer-events: none; }
/* плейсхолдер композера — заметнее (был var(--text-dim), сливался) */
.su-composer textarea::placeholder { color: var(--text-muted); opacity: 1; }
.su-composer-clip {
    width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
    background: transparent; border: 1px solid var(--divider); color: var(--text-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.su-composer textarea {
    flex: 1; min-width: 0; resize: none; min-height: 42px; max-height: 96px;
    padding: 11px 14px; border-radius: 11px;
    border: 1.5px solid var(--divider); background: var(--bg);
    font-size: 14px; color: var(--text); font-family: inherit; outline: none; line-height: 1.4;
}
.su-composer-send {
    width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
    background: var(--accent); color: #fff; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(255,107,53,0.28);
}
.su-composer-send[disabled] { background: var(--text-dim); box-shadow: none; cursor: default; }

.su-attach-name { padding: 0 18px 12px; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.su-attach-name[hidden] { display: none; }
.su-chat .su-error { margin: 0 18px 12px; }

/* ── Sidebar (SupportSidebar) ────────────────────────────────── */
.su-side { display: flex; flex-direction: column; gap: 12px; }
.su-side .su-card { padding: 18px; border-radius: 16px; }
.su-side-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.su-side-ic {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.su-side-title { font-size: 14px; font-weight: 800; color: var(--text); }
.su-side-title--m { margin-bottom: 12px; }

.su-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.su-tips li { display: flex; align-items: flex-start; gap: 9px; }
.su-tip-ic {
    width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.su-tips li span:last-child { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

.su-channel {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
    border: 1px solid var(--divider); text-decoration: none; margin-bottom: 8px;
    transition: border-color .15s ease;
}
.su-channel:last-child { margin-bottom: 0; }
.su-channel:hover { border-color: rgba(255,107,53,0.4); }
.su-channel-ic {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.su-channel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.su-channel-label { font-size: 13px; font-weight: 700; color: var(--text); }
.su-channel-sub { font-size: 11px; color: var(--text-muted); }
.su-channel-arrow { color: var(--text-dim); display: flex; flex-shrink: 0; }

.su-note {
    padding: 14px 16px; border-radius: 14px; background: var(--accent-soft);
    display: flex; gap: 10px; align-items: flex-start;
}
.su-note-ic { color: var(--accent); flex-shrink: 0; display: flex; margin-top: 1px; }
.su-note span:last-child { font-size: 12px; color: var(--text); line-height: 1.5; }

/* ── Планшет 768–1023 ───────────────────────────────────────── */
@media (max-width: 1023px) {
    .su-wrap { padding: 32px 32px 56px; }
    .su-grid { grid-template-columns: 1fr; gap: 20px; }
    .su-title { font-size: 30px; }
    .su-col-main { margin-bottom: 4px; }
}

/* ── Мобайл <768 ────────────────────────────────────────────── */
@media (max-width: 767px) {
    .su-wrap { padding: 22px 18px 40px; }
    .su-title { font-size: 26px; }
    .su-sub { font-size: 14px; }
    .su-card { padding: 18px; }
    .su-chat { height: auto; }
    .su-thread { min-height: 300px; max-height: 56vh; }
}

/* ════════ Email-гейт (модалка ДО входа в чат/форму) ════════════
   Обязательная, неотменяемая (нет X/Esc/клика-вне). Оверлей с blur
   перекрывает всю страницу. Дизайн — по confirm.css (var(--*)). */
.su-emailgate-ov {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: rgba(8, 16, 40, 0.45);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; transition: opacity 0.2s ease;
}
.su-emailgate-ov.is-open { opacity: 1; }
.su-lock { overflow: hidden; }

.su-emailgate-card {
    position: relative; box-sizing: border-box; width: 420px; max-width: 100%;
    padding: 28px 28px 24px; background: var(--bg); color: var(--text);
    border-radius: 20px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    transform: scale(0.96); opacity: 0; transition: transform 0.2s ease, opacity 0.2s ease;
}
.su-emailgate-ov.is-open .su-emailgate-card { transform: scale(1); opacity: 1; }

.su-emailgate-ico {
    width: 56px; height: 56px; margin-bottom: 18px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
}
.su-emailgate-ico svg { width: 24px; height: 24px; }
.su-emailgate-title { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--text); }
.su-emailgate-body { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-muted); }

.su-emailgate-input {
    width: 100%; height: 48px; margin-top: 18px; padding: 0 14px; box-sizing: border-box;
    font-size: 15px; font-weight: 600; color: var(--text);
    background: var(--bg-elevated); border: 1.5px solid var(--divider); border-radius: 12px;
    font-family: inherit; outline: none;
}
.su-emailgate-input:focus { border-color: var(--accent); }
.su-emailgate-input::placeholder { color: var(--text-dim); font-weight: 500; }

.su-emailgate-err { margin-top: 10px; font-size: 13px; font-weight: 600; color: #DC4444; }
.su-emailgate-err[hidden] { display: none; }

.su-emailgate-btn {
    width: 100%; height: 48px; margin-top: 16px; border: none; border-radius: 12px;
    background: var(--accent); color: #fff; font-family: inherit; font-size: 15px; font-weight: 800;
    cursor: pointer; box-shadow: 0 8px 20px rgba(255, 107, 53, 0.33);
    transition: opacity .15s ease;
}
.su-emailgate-btn:hover { opacity: .94; }
.su-emailgate-btn[disabled] { opacity: .5; cursor: default; box-shadow: none; }

@media (max-width: 640px) {
    .su-emailgate-ov { align-items: flex-end; padding: 0; }
    .su-emailgate-card {
        width: 100%; border-radius: 20px 20px 0 0; transform: translateY(100%);
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
    .su-emailgate-ov.is-open .su-emailgate-card { transform: translateY(0); }
    .su-emailgate-title { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
    .su-emailgate-ov, .su-emailgate-card { transition: none; }
    .su-emailgate-card { transform: none; opacity: 1; }
}

/* ── Анимации (индикаторы / проверка) ────────────────────────── */
@keyframes suBlink { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes suSpin { to { transform: rotate(360deg); } }
