/* ===== Базовые переменные ===== */
:root {
    --bg-main: #050814;
    --bg-elevated: #0b1020;
    --bg-elevated-alt: #111827;
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, 0.12);
    --accent-strong: #38bdf8;
    --accent-warn: #f97316;
    --accent-error: #f97373;
    --text-main: #e5e7eb;
    --text-soft: #9ca3af;
    --text-muted: #6b7280;
    --border-subtle: #1f2933;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-pill: 999px;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 32px rgba(34, 211, 238, 0.45);
}

/* ===== Базовая раскладка ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 60%, #030712 100%);
}

body {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

#app {
    width: 100%;
    max-width: 1200px;
    margin: 16px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 55%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.09), transparent 55%),
        var(--bg-main);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== Верхняя панель ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);
    background: linear-gradient(to right, rgba(15, 23, 42, 0.95), rgba(12, 74, 110, 0.7));
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 13px;
}

.brand-core {
    color: #f97316;
}

.brand-divider {
    color: var(--text-muted);
}

.brand-nova {
    color: var(--accent-strong);
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Статусы ===== */
.status-pill,
.user-pill {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.7);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #9ca3af;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8);
}

.status-ok::before {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.status-error::before {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.status-unknown::before {
    background: #eab308;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.25);
}

.user-pill {
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(15, 23, 42, 0.75);
}

.user-anon {
    border-color: rgba(148, 163, 184, 0.5);
}

/* ===== Основная раскладка ===== */
.main-layout {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 16px;
    padding: 16px 20px 12px;
}

/* ===== Карточки слева ===== */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(31, 41, 55, 0.9);
    padding: 16px 16px 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.card h2,
.card h3 {
    margin: 0 0 8px;
}

.card-subtitle {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-soft);
}

.card-info {
    font-size: 13px;
    color: var(--text-soft);
}

.info-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--text-soft);
}

.info-list li {
    margin-bottom: 4px;
}

/* ===== Формы ===== */
.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-soft);
}

.input {
    border-radius: 10px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: radial-gradient(circle at top, #020617, #020617 55%, #020617 100%);
    color: var(--text-main);
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.3s ease;
}

.input:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4);
}

.form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

/* ===== Кнопки ===== */
.btn {
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #22d3ee);
    color: #0b1120;
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.95);
    color: var(--accent-strong);
    border: 1px solid rgba(56, 189, 248, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--text-soft);
    border: 1px solid rgba(75, 85, 99, 0.9);
}

.btn-logout {
    margin-top: auto;
    align-self: stretch;
}

/* ===== Восстановление пароля ===== */
.form-extra {
    margin-top: 4px;
    display: flex;
    justify-content: flex-start;
}

.btn-link {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    color: var(--accent-strong);
    text-decoration: none;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.btn-link:hover {
    opacity: 1;
    color: var(--accent);
}

.btn-link:focus-visible {
    outline: 1px solid var(--accent-strong);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Ошибки и подсказки ===== */
.form-error {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--accent-error);
}

.form-hint {
    margin: 6px 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Чат справа ===== */
.chat-panel {
    background: radial-gradient(circle at top right, rgba(34, 197, 235, 0.11), rgba(8, 47, 73, 0.18), #020617);
    border-radius: 20px;
    border: 1px solid rgba(30, 64, 175, 0.45);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    padding: 14px;
    overflow: hidden;
}

.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
}

/* Сообщения */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

/* Ввод */
.chat-input-bar {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    border-top: 1px solid rgba(30, 64, 175, 0.55);
    padding-top: 8px;
}

.chat-input {
    flex: 1;
    resize: none;
    border-radius: 14px;
    border: 1px solid rgba(30, 64, 175, 0.9);
    padding: 7px 10px;
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-main);
}

/* ===== Нижняя полоса ===== */
.footer {
    padding: 6px 18px;
    border-top: 1px solid rgba(15, 23, 42, 0.9);
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}
