/* Widget chatbot Aquilus · Aquila */

.aquila-chat {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    font-family: inherit;
}

.aquila-chat__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.1rem 0.75rem 0.85rem;
    border: 1px solid rgba(196, 163, 90, 0.55);
    border-radius: 999px;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    color: #f5f5f5;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    font-size: 0.9rem;
    font-weight: 600;
}

.aquila-chat__toggle:hover {
    border-color: #c4a35a;
}

.aquila-chat__toggle .aquila-chat__robot {
    width: 1.55rem;
    height: 1.55rem;
    flex-shrink: 0;
}

.aquila-chat__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.65rem);
    width: min(380px, calc(100vw - 2rem));
    height: min(520px, calc(100vh - 6rem));
    display: none;
    flex-direction: column;
    background: #0c0c0c;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.aquila-chat.is-open .aquila-chat__panel {
    display: flex;
}

.aquila-chat__head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(196, 163, 90, 0.12), transparent);
}

.aquila-chat__brand {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    min-width: 0;
}

.aquila-chat__brand .aquila-chat__robot {
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.aquila-chat__head strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
}

.aquila-chat__head span {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: #a3a3a3;
}

.aquila-chat__quota {
    margin-top: 0.35rem !important;
    color: #c4a35a !important;
    font-size: 0.7rem !important;
}

.aquila-chat__head-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.aquila-chat__new {
    border: 1px solid rgba(196, 163, 90, 0.45);
    background: rgba(196, 163, 90, 0.12);
    color: #e8d5a3;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.aquila-chat__new:hover {
    border-color: #c4a35a;
    color: #fff;
}

.aquila-chat__honey {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.aquila-chat__close {
    border: 0;
    background: transparent;
    color: #a3a3a3;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
}

.aquila-chat__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.aquila-chat__list {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.aquila-chat__msg {
    display: flex;
}

.aquila-chat__msg--user {
    justify-content: flex-end;
}

.aquila-chat__msg--fade-in {
    animation: aquilaChatFadeIn 0.38s ease both;
}

.aquila-chat__msg--fade-out {
    animation: aquilaChatFadeOut 0.22s ease both;
    pointer-events: none;
}

@keyframes aquilaChatFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aquilaChatFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(4px);
    }
}

.aquila-chat__bubble {
    max-width: 88%;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}

.aquila-chat__bubble--typing {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 7.5rem;
    padding: 0.7rem 0.95rem;
}

.aquila-chat__typing-label {
    font-size: 0.78rem;
    color: #a3a3a3;
    letter-spacing: 0.01em;
    animation: aquilaChatLabelPulse 1.6s ease-in-out infinite;
}

.aquila-chat__typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.aquila-chat__typing-dots i {
    display: block;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: #c4a35a;
    opacity: 0.35;
    animation: aquilaChatDot 1.2s ease-in-out infinite;
}

.aquila-chat__typing-dots i:nth-child(2) {
    animation-delay: 0.18s;
}

.aquila-chat__typing-dots i:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes aquilaChatDot {
    0%,
    80%,
    100% {
        opacity: 0.25;
        transform: translateY(0) scale(0.9);
    }
    40% {
        opacity: 1;
        transform: translateY(-3px) scale(1);
    }
}

@keyframes aquilaChatLabelPulse {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aquila-chat__msg--fade-in,
    .aquila-chat__msg--fade-out,
    .aquila-chat__typing-label,
    .aquila-chat__typing-dots i {
        animation: none !important;
    }

    .aquila-chat__typing-dots i {
        opacity: 0.7;
    }
}

.aquila-chat__bubble strong {
    color: #fff;
    font-weight: 700;
}

.aquila-chat__bubble a {
    color: #c4a35a;
    text-decoration: underline;
}

.aquila-chat__msg--assistant .aquila-chat__bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e5e5;
    white-space: normal;
}

.aquila-chat__msg--user .aquila-chat__bubble {
    background: rgba(196, 163, 90, 0.18);
    border: 1px solid rgba(196, 163, 90, 0.35);
    color: #fff;
    white-space: pre-wrap;
}

.aquila-chat__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #090909;
    position: relative;
}

.aquila-chat__disclaimer {
    margin: 0;
    padding: 0 0.85rem 0.7rem;
    background: #090909;
    color: #737373;
    font-size: 0.62rem;
    line-height: 1.35;
    border: 0;
}

.aquila-chat__form textarea {
    resize: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: #121212;
    color: #fff;
    padding: 0.55rem 0.7rem;
    font: inherit;
    font-size: 0.88rem;
    min-height: 2.6rem;
}

.aquila-chat__send {
    align-self: end;
    border: 0;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    background: #c4a35a;
    color: #111;
    font-weight: 700;
    cursor: pointer;
}

.aquila-chat__send:disabled {
    opacity: 0.55;
    cursor: wait;
}

.aquila-chat .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 520px) {
    .aquila-chat {
        right: 0.65rem;
        bottom: 0.65rem;
    }

    .aquila-chat__toggle-label {
        font-size: 0.82rem;
    }
}
