/* ============================================================
   ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ
============================================================ */
:root {
    --bg-page: #2a100b;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-input: rgba(255, 255, 255, 0.07);
    --bg-input-focus: rgba(255, 255, 255, 0.12);

    --fg-main: #f6efc3;
    --fg-muted: rgba(246, 239, 195, 0.7);

    --border: rgba(246, 239, 195, 0.35);
    --border-strong: rgba(246, 239, 195, 0.55);

    --btn-bg: rgba(246, 239, 195, 0.12);
    --btn-bg-hover: rgba(246, 239, 195, 0.22);

    --btn-primary-bg: rgba(246, 239, 195, 0.25);
    --btn-primary-bg-hover: rgba(246, 239, 195, 0.35);

    --radius: 12px;
    --transition: 0.25s ease;

    --green: #4caf50;
    --yellow: #ffeb3b;
    --blue: #2196f3;
    --red: #f44336;
    --gray: #777;
}

/* ============================================================
   БАЗОВЫЕ СТИЛИ
============================================================ */
body {
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    color: var(--fg-main);
    font-family: "Inter", sans-serif;
}

.page-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   ШАПКА
============================================================ */
.page-header {
    width: 100%;
    padding: 20px 20px 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

/* ЕДИНЫЙ ЛОГОТИП */
.header-logo-unified {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.header-logo {
    width: 80px;
    height: auto;
    object-fit: contain;
}

/* ТЕКСТ */
.header-title {
    font-size: 36px;
    margin: 0;
    font-weight: 700;
}

.header-subtitle {
    margin: 5px 0 0;
    font-size: 20px;
    color: var(--fg-muted);
}

/* ============================================================
   ИНДИКАТОРЫ (десктоп)
============================================================ */
.indicators-panel {
    position: absolute;
    right: 40px;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray);
}

.indicator-label {
    font-size: 13px;
}

/* ============================================================
   КНОПКИ
============================================================ */
.btn {
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 15px;
    color: var(--fg-main);
    background: var(--btn-bg);
    transition: var(--transition);
    margin-top: 8px;
}

.btn:hover {
    background: var(--btn-bg-hover);
}

.btn-primary {
    background: var(--btn-primary-bg);
}

.btn-primary:hover {
    background: var(--btn-primary-bg-hover);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   ОСНОВНАЯ СЕТКА
============================================================ */
.layout {
    display: flex;
    gap: 25px;
    padding: 25px 30px;
}

.form-column {
    flex: 1;
    min-width: 750px;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.chat-column {
    flex: 0 0 auto;
    min-width: 300px;
    max-width: 400px;
}

/* ============================================================
   КАРТОЧКИ
============================================================ */
.card {
    background: var(--bg-card);
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 22px;
    margin: 0 0 18px;
}

/* ============================================================
   ПОЛЯ (уменьшена ширина на 30px)
============================================================ */
.field-group {
    margin-bottom: 14px;
}

.field-label {
    font-size: 16px;
    margin-bottom: 4px;
    display: block;
}

.field-input,
.field-textarea,
select {
    width: calc(100% - 30px);
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--fg-main);
    font-size: 14px;
    line-height: 1.2;
    transition: var(--transition);
    margin-top: 3px;
}

.field-input:focus,
.field-textarea:focus,
select:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-strong);
    outline: none;
}

.field-textarea {
    resize: vertical;
}

.field-hint {
    font-size: 12px;
    color: var(--fg-muted);
    margin-top: 4px;
}

/* Две колонки */
.two-columns {
    display: flex;
    gap: 16px;
}

.two-columns .field {
    flex: 1;
}

/* ============================================================
   КАСТОМНЫЕ SELECT
============================================================ */
.custom-select {
    appearance: none;
    background: url("data:image/svg+xml;utf8,<svg fill='%23f6efc3' height='20' width='20' viewBox='0 0 20 20'><path d='M5 7l5 5 5-5'/></svg>") no-repeat right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.custom-select option {
    background: #2a100b;
    color: var(--fg-main);
}

/* ============================================================
   ДИНАМИЧЕСКИЕ БЛОКИ
============================================================ */
.dynamic-block {
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.dynamic-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dynamic-block-title {
    font-size: 17px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--fg-main);
    cursor: pointer;
    font-size: 20px;
}

/* ============================================================
   ЧАТ (десктоп)
============================================================ */
.chat-panel {
    background: #2a100b !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: var(--radius);
    background: #2a100b !important;
}

.chat-input-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.chat-input {
    flex: 1;
}

/* ============================================================
   FAB-КНОПКА
============================================================ */
.chat-fab {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: rgba(246, 239, 195, 0.9);
    color: #2a100b;
    padding: 14px 20px;
    border-radius: 50px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(246, 239, 195, 0.5);
    transition: var(--transition);
    z-index: 9999;
}

/* ============================================================
   МОБИЛЬНЫЙ ЧАТ
============================================================ */
.mobile-chat-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10000;
}

.mobile-chat-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2a100b !important;
    border-top: 1px solid var(--border);
    padding: 18px;
    border-radius: 18px 18px 0 0;
    height: 70%;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   АДАПТИВ
============================================================ */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 900px) {

    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    /* ЛОГОТИП В МОБИЛЬНОЙ ВЕРСИИ */
    .header-logo {
        width: 60px;
    }

    .header-title {
        font-size: 26px;
        line-height: 1.2;
    }

    .header-subtitle {
        font-size: 15px;
        line-height: 1.3;
        padding: 0 10px;
    }

    /* УБИРАЕМ ИНДИКАТОРЫ */
    .indicators-panel {
        display: none !important;
    }

    .layout {
        flex-direction: column;
    }

    .form-column {
        min-width: 100%;
        max-width: 100%;
    }

    .two-columns {
        flex-direction: column;
        gap: 10px;
    }

    .card {
        padding: 16px;
    }

    .chat-column {
        display: none;
    }

    .chat-fab {
        display: block;
    }
}
