/*
 * Верхний вход в ИИ-консультант.
 * Изолирован от базовой шапки, чтобы компонент одинаково работал в header.html
 * и в захардкоженной копии шапки на главной странице.
 */

.header .header-ai-cta {
    position: relative !important;
    gap: 10px !important;
    min-height: 46px !important;
    padding: 6px 16px 6px 8px !important;
    overflow: hidden !important;
    border: 1px solid rgba(131, 231, 237, 0.36) !important;
    background:
        linear-gradient(115deg, rgba(35, 134, 171, 0.34), transparent 48%),
        #163b67 !important;
    box-shadow:
        0 10px 28px rgba(4, 24, 51, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
    isolation: isolate;
}

.header .header-ai-cta::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, transparent 18%, rgba(141, 226, 234, 0.2) 48%, transparent 78%);
    content: "";
    transform: translateX(-120%);
    transition: transform 0.7s cubic-bezier(.2, .7, .2, 1);
}

.header .header-ai-cta:hover::after {
    transform: translateX(120%);
}

.header .header-ai-cta:hover {
    border-color: rgba(141, 226, 234, 0.68) !important;
    background:
        linear-gradient(115deg, rgba(35, 134, 171, 0.5), transparent 52%),
        #1a4678 !important;
    box-shadow:
        0 13px 34px rgba(4, 24, 51, 0.34),
        0 0 0 3px rgba(114, 220, 230, 0.1) !important;
}

.header-ai-bot {
    position: relative;
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid rgba(143, 231, 237, 0.5);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(141, 226, 234, 0.24), rgba(8, 29, 57, 0.5));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 16px rgba(114, 220, 230, 0.18);
    animation: rgHeaderBotFloat 3.2s ease-in-out infinite;
}

.header-ai-bot::before,
.header-ai-bot::after {
    position: absolute;
    top: 12px;
    width: 3px;
    height: 8px;
    border-radius: 3px;
    background: #8de2ea;
    content: "";
    opacity: 0.72;
}

.header-ai-bot::before { left: -3px; }
.header-ai-bot::after { right: -3px; }

.header-ai-bot__antenna {
    position: absolute;
    top: -6px;
    left: 50%;
    width: 2px;
    height: 7px;
    border-radius: 2px;
    background: #8de2ea;
    transform: translateX(-50%);
}

.header-ai-bot__antenna::after {
    position: absolute;
    top: -2px;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c4f7f2;
    box-shadow: 0 0 8px rgba(141, 226, 234, 0.85);
    content: "";
    transform: translateX(-50%);
    animation: rgHeaderBotSignal 1.8s ease-in-out infinite;
}

.header-ai-bot__face {
    display: flex;
    width: 21px;
    height: 15px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 6px;
    background: rgba(5, 22, 43, 0.72);
}

.header-ai-bot__eye {
    width: 3px;
    height: 6px;
    border-radius: 4px;
    background: #bff8f3;
    box-shadow: 0 0 6px rgba(141, 226, 234, 0.8);
    animation: rgHeaderBotBlink 4.8s infinite;
}

.header-ai-cta__copy {
    display: grid;
    gap: 1px;
    text-align: left;
    line-height: 1.05;
}

.header-ai-cta__copy > span {
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.header-ai-cta__copy small {
    color: #aee9ed;
    font-family: "IBM Plex Mono", "JetBrains Mono", monospace;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.drawer-ai-cta {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 18px;
    border: 1px solid rgba(114, 220, 230, 0.3);
    border-radius: 9px;
    background:
        linear-gradient(115deg, rgba(42, 143, 177, 0.32), transparent 55%),
        #123965;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(4, 24, 51, 0.18);
}

.drawer-ai-cta .header-ai-cta__copy > span { font-size: 14px; }
.drawer-ai-cta .header-ai-cta__copy small { font-size: 8px; }

@keyframes rgHeaderBotBlink {
    0%, 43%, 47%, 100% { transform: scaleY(1); }
    45% { transform: scaleY(0.12); }
}

@keyframes rgHeaderBotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes rgHeaderBotSignal {
    0%, 100% { opacity: 0.55; transform: translateX(-50%) scale(0.8); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

@media (max-width: 1180px) and (min-width: 769px) {
    .header .header-ai-cta { padding-right: 12px !important; }
    .header-ai-cta__copy small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .header-ai-bot,
    .header-ai-bot__antenna::after,
    .header-ai-bot__eye {
        animation: none;
    }
    .header .header-ai-cta::after { display: none; }
}
