/* ============================================================
   БКМ-СТАТУС — ai.css  (ИИ-ассистент)
   ============================================================ */

.ai-box {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}
.ai-header {
    background: #142D49;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ai-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    flex-shrink: 0;
}
.ai-title { color: #fff; font-size: 13px; font-weight: 600; }
.ai-limit-badge {
    margin-left: auto;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}
.ai-messages {
    flex: 1;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-page);
    min-height: 220px;
    overflow-y: auto;
}
.ai-msg {
    max-width: 86%;
    padding: 9px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.5;
}
.ai-msg--bot {
    background: #fff;
    border: 0.5px solid var(--border);
    color: var(--text);
    align-self: flex-start;
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
}
.ai-msg--user {
    background: var(--blue);
    color: #fff;
    align-self: flex-end;
    border-radius: var(--radius) var(--radius) 4px var(--radius);
}
.ai-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 9px 12px;
    background: #fff;
    border: 0.5px solid var(--border);
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
    align-self: flex-start;
}
.ai-typing span {
    width: 6px; height: 6px;
    background: #B4B2A9;
    border-radius: 50%;
    animation: ai-blink 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-blink { 0%,80%,100%{opacity:0.3} 40%{opacity:1} }

.ai-chips {
    padding: 8px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 0.5px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}
.ai-chip {
    background: var(--blue-light);
    color: var(--navy);
    font-size: 11px;
    padding: 4px 11px;
    border-radius: 20px;
    cursor: pointer;
    border: 0.5px solid var(--border-dark);
    transition: background 0.1s;
    font-family: var(--font);
}
.ai-chip:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.ai-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border-top: 0.5px solid var(--border);
    background: #fff;
    flex-shrink: 0;
}
.ai-input-row input {
    flex: 1;
    border: 0.5px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 8px 11px;
    font-size: 13px;
    outline: none;
    background: var(--bg-page);
    color: var(--text);
}
.ai-input-row input:focus { border-color: var(--blue); background: #fff; }
.ai-send-btn {
    background: var(--blue);
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.ai-send-btn:hover { background: var(--navy); }
.ai-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 5px 0 8px;
    background: #fff;
    flex-shrink: 0;
}
.ai-footer a { color: var(--blue); cursor: pointer; }

/* Полноэкранная страница ассистента */
.ai-page-wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px; }
.ai-page-wrap .ai-box { height: 600px; }

/* ============================================================
   Режим заглушки "бот на обучении" (hero-виджет на главной)
   ============================================================ */
.ai-box--training { overflow: hidden; }

.ai-header--training {
    background: linear-gradient(135deg, #1A3A5C 0%, #142D49 100%);
    padding: 14px 16px;
    gap: 12px;
    align-items: center;
}

/* Анимированная иконка бота */
.ai-bot-avatar {
    position: relative;
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-bot-svg {
    width: 40px; height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
    animation: ai-bot-bob 3.4s ease-in-out infinite;
}
.ai-bot-antenna {
    transform-origin: 20px 3px;
    animation: ai-bot-antenna 1.6s ease-in-out infinite;
}
.ai-bot-eye {
    transform-origin: center;
    animation: ai-bot-blink 4.2s ease-in-out infinite;
}
.ai-bot-eye--r { animation-delay: 0.05s; }
.ai-bot-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--orange);
    opacity: 0;
    animation: ai-bot-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

@keyframes ai-bot-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}
@keyframes ai-bot-antenna {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.4); opacity: 0.6; }
}
@keyframes ai-bot-blink {
    0%, 92%, 100% { transform: scaleY(1); }
    95%           { transform: scaleY(0.1); }
}
@keyframes ai-bot-pulse {
    0%   { transform: scale(0.9); opacity: 0.6; }
    80%  { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Текст шапки */
.ai-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.ai-header--training .ai-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-title-beta {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    background: var(--orange);
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.ai-subtitle {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    font-weight: 400;
}

/* Бейдж "Скоро в строю" */
.ai-badge-training {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--orange);
    background: rgba(224,122,31,0.12);
    border: 1px solid rgba(224,122,31,0.35);
    padding: 4px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.ai-badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--orange);
    box-shadow: 0 0 0 0 rgba(224,122,31,0.6);
    animation: ai-badge-pulse 1.8s ease-out infinite;
}
@keyframes ai-badge-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(224,122,31,0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(224,122,31,0); }
    100% { box-shadow: 0 0 0 0 rgba(224,122,31,0); }
}

/* Тело заглушки */
.ai-training-body {
    padding: 14px 16px 12px;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    gap: 11px;
    flex: 1;
}

.ai-training-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--navy);
    background: #fff;
    border: 0.5px solid var(--border);
    border-left: 3px solid var(--orange);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.ai-gear {
    display: inline-block;
    font-size: 14px;
    color: var(--orange);
    animation: ai-gear-spin 3.8s linear infinite;
    transform-origin: center;
    line-height: 1;
}
@keyframes ai-gear-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.ai-training-status-text {
    flex: 1;
    transition: opacity 0.22s ease;
    font-variant-numeric: tabular-nums;
}

.ai-training-intro {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text);
}
.ai-training-intro b { color: var(--navy); }

.ai-skills-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 2px;
}
.ai-skills {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ai-skills li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text);
}
.ai-skill-ico {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    margin-top: 1px;
}
.ai-skill-ico svg { width: 14px; height: 14px; display: block; }

.ai-cta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 0.5px dashed var(--border-dark);
}
.ai-cta-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    flex: 1;
    min-width: 140px;
}
.ai-cta-btn {
    background: var(--orange);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.ai-cta-btn:hover { background: #C96A10; color: #fff; }

/* Задизейбленная строка ввода */
.ai-input-row--disabled {
    opacity: 0.6;
    pointer-events: none;
}
.ai-input-row--disabled input {
    background: #F0F3F7;
    color: var(--text-muted);
    font-style: italic;
    cursor: not-allowed;
}
.ai-input-row--disabled .ai-send-btn {
    background: var(--text-muted);
    cursor: not-allowed;
}
