:root {
    --color-accent: #22d3ee;
    --color-accent-hover: #0891b2;
    --color-accent-pink: #ff3ec8;
}

[x-cloak] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 15%, rgba(34, 211, 238, 0.16), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(255, 62, 200, 0.22), transparent 45%),
        #05060f;
    background-attachment: fixed;
    color: #f8fafc;
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

.stage {
    width: 100%;
    max-width: 640px;
    padding: 48px 24px;
    text-align: center;
}

.screen__title {
    font-size: 28px;
    line-height: 1.35;
    font-weight: 600;
    margin: 0 0 24px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.screen__points {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 17px;
    color: #e2e8f0;
}

.screen__microcopy {
    margin-top: 16px;
    font-size: 15px;
    color: #cbd5e1;
}

/* Напоминание не вводить реальные персональные данные (демо, а не боевая
   запись) — по обратной связи от клиента (Наталья) должно бросаться в глаза,
   не растворяться в фоне: яркий белый, жирный, без рамки/подложки. */
.privacy-note {
    position: fixed;
    bottom: 16px;
    right: 16px;
    max-width: 300px;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
    text-align: right;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.button {
    display: inline-block;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    padding: 16px 32px;
    text-decoration: none;
    text-align: center;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button--primary {
    background: var(--color-accent);
    color: #000000;
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}

.button--primary:hover:not(:disabled) {
    background: var(--color-accent-hover);
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.65);
}

.button--secondary {
    background: #1e293b;
    color: #e2e8f0;
}

.button--secondary:hover:not(:disabled) {
    background: #273449;
}

.button--ghost {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid #1e293b;
}

.button--ghost:hover:not(:disabled) {
    color: #f8fafc;
    border-color: var(--color-accent-pink);
}

.button--compact {
    padding: 10px 18px;
    font-size: 14px;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Стоматология: 3 маленькие кнопки в 2-колоночной сетке — третья повисает одна
   слева. Центрируем её по ширине одной колонки вместо растягивания на всю
   строку (найдено при живой проверке демо 2026-09-11). */
.scenario-grid > .scenario-card:nth-child(3):last-child {
    grid-column: 1 / -1;
    max-width: 288px;
    justify-self: center;
}

.scenario-card {
    position: relative;
    border: 1px solid #1e293b;
    border-radius: 12px;
    background: #111827;
    color: #e2e8f0;
    padding: 24px 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.scenario-card__title {
    display: block;
}

.scenario-card__description {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #cbd5e1;
}

.scenario-card:not(.scenario-card--disabled):hover {
    border-color: var(--color-accent);
}

.scenario-card--disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.scenario-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    background: #1e293b;
    color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 999px;
}

.screen--chat {
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 72vh;
    max-height: 640px;
}

.chat-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 4px 12px;
}

.bubble {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.5;
}

.bubble span {
    white-space: pre-wrap;
}

.bubble--user {
    align-self: flex-end;
    background: var(--color-accent);
    color: #000000;
    border-bottom-right-radius: 4px;
}

.bubble--assistant {
    align-self: flex-start;
    background: #111827;
    border: 1px solid #1e293b;
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.bubble--waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 13px;
    background: transparent;
    border: none;
    padding: 0 16px;
}

.waiting-dots {
    display: inline-flex;
    gap: 3px;
}

.waiting-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #64748b;
    animation: waiting-pulse 1.2s infinite ease-in-out;
}

.waiting-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.waiting-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes waiting-pulse {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: scale(0.85);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-input {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #1e293b;
}

.chat-input input {
    flex: 1;
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 12px 14px;
    color: #e2e8f0;
    font-size: 15px;
    font-family: inherit;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.chat-input input:disabled {
    opacity: 0.6;
}

.fallback-banner {
    background: #1c1330;
    border: 1px solid var(--color-accent);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    text-align: left;
    font-size: 14px;
    color: #e2e8f0;
}

.fallback-banner__actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.screen--crm {
    text-align: left;
}

.crm-card {
    border: 1px solid #1e293b;
    border-radius: 14px;
    background: #111827;
    padding: 24px;
    text-align: left;
}

.crm-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid #1e293b;
}

.crm-card__name {
    font-size: 22px;
    font-weight: 600;
    color: #e2e8f0;
}

.crm-card__status {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    background: var(--color-accent);
    color: #000000;
    padding: 4px 12px;
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
}

.crm-card__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 24px;
    padding: 20px 0;
}

.crm-card__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-card__field-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.crm-card__field-value {
    font-size: 15px;
    color: #e2e8f0;
}

.crm-card__field-value--empty {
    color: #94a3b8;
    font-style: italic;
}

.crm-card__summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #0b1120;
    border-left: 3px solid var(--color-accent-pink);
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.crm-card__summary-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #cbd5e1;
}

.crm-card__followup {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 62, 200, 0.08);
    border: 1px solid var(--color-accent-pink);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 18px;
    box-shadow: 0 0 14px rgba(255, 62, 200, 0.25);
}

.crm-card__followup-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-accent-pink);
}

.crm-card__followup-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #f5d9ef;
}

.crm-card__ai-mark {
    margin: 0 0 20px;
    padding-top: 16px;
    border-top: 1px solid #1e293b;
    font-size: 13px;
    color: #94a3b8;
}

.crm-card .button {
    width: 100%;
}

.crm-card__actions {
    display: flex;
    gap: 12px;
}

.crm-card__actions .button {
    flex: 1;
    width: auto;
}

.summary-list {
    text-align: left;
    margin-bottom: 28px;
}

.summary-list__heading {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #e2e8f0;
}

.summary-list__items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-list__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #111827;
    border: 1px solid #1e293b;
    border-left: 3px solid var(--color-accent);
    border-radius: 8px;
    padding: 10px 14px;
}

.summary-list__scenario {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
}

.summary-list__detail {
    font-size: 14px;
    color: #cbd5e1;
}

.summary-list__followup {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent-pink);
    margin-top: 2px;
}

.crm-card {
    animation: crm-card-reveal 0.3s ease-out both;
}

.crm-card__field {
    opacity: 0;
    animation: crm-field-reveal 0.25s ease-out forwards;
}

.crm-card__field:nth-child(1) { animation-delay: 0.1s; }
.crm-card__field:nth-child(2) { animation-delay: 0.15s; }
.crm-card__field:nth-child(3) { animation-delay: 0.2s; }
.crm-card__field:nth-child(4) { animation-delay: 0.25s; }
.crm-card__field:nth-child(5) { animation-delay: 0.3s; }
.crm-card__field:nth-child(6) { animation-delay: 0.35s; }
.crm-card__field:nth-child(7) { animation-delay: 0.4s; }
.crm-card__field:nth-child(8) { animation-delay: 0.45s; }

.crm-card__summary {
    opacity: 0;
    animation: crm-field-reveal 0.25s ease-out 0.4s forwards;
}

.crm-card__ai-mark {
    opacity: 0;
    animation: crm-field-reveal 0.25s ease-out 0.45s forwards;
}

@keyframes crm-card-reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes crm-field-reveal {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .crm-card,
    .crm-card__field,
    .crm-card__summary,
    .crm-card__ai-mark {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
