/* Ask Dhuveli for visitors (docs/assistant.md "On the website"): the chat card
   (partials/ask-chat) as the home page's #ask section and as the floating panel
   on every page of the site (layout.blade.php), with WhatsApp as the second
   step. Loaded by the layout on every page, so no page variables are assumed. */

/* ── The chat card ─────────────────────────────────────────────────────────── */
.ak-card {
    max-width: 760px; margin: 0 auto; background: #fff; border-radius: 22px;
    border: 1px solid rgba(109,74,255,.18);
    box-shadow: 0 24px 60px -28px rgba(109,74,255,.35), 0 2px 10px rgba(13,33,55,.05);
    overflow: hidden; font-family: Montserrat, Roboto, sans-serif; color: #0d2137;
    display: flex; flex-direction: column;
}
.ak-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; color: #fff; background: linear-gradient(110deg, #0866ff 0%, #6d4aff 55%, #b04bff 100%); }
.ak-head strong { display: block; font-size: 1rem; font-weight: 800; }
.ak-head small { display: block; font-size: .74rem; opacity: .85; }
.ak-head > div { flex: 1; min-width: 0; }
.ak-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.18); font-size: 1.05rem; flex: none; }
.ak-mark .ic, .ak-launch .ic, .ak-close .ic, .ak-form button .ic { width: 1em; height: 1em; }
.ak-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255,255,255,.18); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.ak-close:hover { background: rgba(255,255,255,.28); }
.ak-log { display: flex; flex-direction: column; gap: .65rem; padding: 1.2rem; min-height: 220px; max-height: 440px; overflow-y: auto; }
.ak-msg { max-width: 85%; padding: .7rem .95rem; border-radius: 16px; font-size: .9rem; line-height: 1.6; overflow-wrap: anywhere; }
.ak-msg--bot { align-self: flex-start; background: #f1f4f9; color: #0d2137; border-bottom-left-radius: 6px; }
.ak-msg--me { align-self: flex-end; background: linear-gradient(135deg, #0866ff, #6d4aff); color: #fff; border-bottom-right-radius: 6px; }
.ak-msg a { color: #4f46e5; font-weight: 700; }
.ak-msg.is-error { background: #fef2f2; color: #991b1b; }
.ak-msg.is-typing::after { content: ''; display: inline-block; width: 2.2em; height: 1em; vertical-align: -0.15em;
    background: radial-gradient(circle, #8a99a8 40%, transparent 42%) 0 50% / .7em .7em repeat-x; animation: ak-dots 1s steps(4) infinite; }
@keyframes ak-dots { from { width: 0; } to { width: 2.2em; } }
.ak-chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1.2rem 1rem; }
.ak-chips[hidden] { display: none; }
.ak-chips button { border: 1px solid rgba(109,74,255,.28); background: #f7f5ff; color: #4c3bcf; font: inherit; font-size: .8rem; font-weight: 700; padding: .45rem .8rem; border-radius: 999px; cursor: pointer; text-align: left; }
.ak-chips button:hover { background: #efebff; }
.ak-form { display: flex; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid rgba(13,33,55,.09); margin: 0; }
.ak-form input { flex: 1; min-width: 0; box-sizing: border-box; height: 46px; padding: 0 1rem; border-radius: 999px; border: 1px solid rgba(13,33,55,.14); font: inherit; font-size: .92rem; color: #0d2137; background: #fff; }
.ak-form input:focus { outline: none; border-color: #6d4aff; box-shadow: 0 0 0 3px rgba(109,74,255,.15); }
.ak-form button { flex: none; width: 46px; height: 46px; border: 0; border-radius: 999px; color: #fff; cursor: pointer; background: linear-gradient(135deg, #0866ff, #6d4aff); display: grid; place-items: center; font-size: 1rem; }
.ak-form.is-busy button { opacity: .5; pointer-events: none; }
/* The call back: a button in the answer, a small form under it (POST /api/site/callback). */
.ak-cb-open { display: inline-flex; align-items: center; margin-top: .35rem; padding: .45rem .9rem; border: 0; border-radius: 999px; cursor: pointer;
    background: linear-gradient(135deg, #0866ff, #6d4aff); color: #fff; font: inherit; font-size: .84rem; font-weight: 800; }
.ak-cb-open:hover { filter: brightness(1.08); }
.ak-cb { align-self: stretch; display: flex; flex-direction: column; gap: .55rem; margin: 0; padding: .9rem 1rem; border-radius: 16px;
    border: 1px solid rgba(109,74,255,.25); background: #faf9ff; font-size: .84rem; }
.ak-cb strong { font-size: .9rem; font-weight: 800; color: #0d2137; }
.ak-cb label { display: flex; flex-direction: column; gap: .25rem; font-weight: 700; color: #33475b; }
.ak-cb label small { font-weight: 500; color: #6b7c8f; }
.ak-cb input { box-sizing: border-box; width: 100%; height: 42px; padding: 0 .8rem; border-radius: 10px; border: 1px solid rgba(13,33,55,.16);
    background: #fff; font: inherit; font-size: 16px; font-weight: 500; color: #0d2137; }
.ak-cb input:focus { outline: none; border-color: #6d4aff; box-shadow: 0 0 0 3px rgba(109,74,255,.15); }
.ak-cb .ak-cb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ak-cb-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.ak-cb-row button { height: 40px; padding: 0 1rem; border-radius: 999px; font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer; }
.ak-cb-row button[type=submit] { border: 0; color: #fff; background: linear-gradient(135deg, #0866ff, #6d4aff); }
.ak-cb-row button[type=submit]:disabled { opacity: .6; cursor: default; }
.ak-cb-cancel { border: 1px solid rgba(13,33,55,.16); background: #fff; color: #33475b; }
.ak-cb-msg { margin: 0; font-size: .74rem; color: #5a6e82; }
.ak-cb-msg.is-error { color: #b91c1c; font-weight: 700; }
.ak-cb.is-done { background: #f0fdf4; border-color: rgba(21,128,61,.3); }
.ak-cb.is-done strong { color: #166534; }
.ak-note { margin: 0; padding: 0 1.2rem 1rem; font-size: .74rem; color: #4b6076; line-height: 1.5; }
.ak-note a { color: #0f766e; font-weight: 700; }

/* ── The floating button ───────────────────────────────────────────────────── */
.ak-float { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; font-family: Montserrat, Roboto, sans-serif; }
.ak-launch {
    display: inline-flex; align-items: center; gap: .55rem; height: 52px; padding: 0 1.25rem 0 1.05rem;
    border: 0; border-radius: 999px; cursor: pointer; color: #fff; font: inherit; font-size: .95rem; font-weight: 800; letter-spacing: .01em;
    background: linear-gradient(110deg, #0866ff 0%, #6d4aff 45%, #b04bff 70%, #0866ff 100%); background-size: 220% 100%;
    box-shadow: 0 10px 28px rgba(109,74,255,.42), inset 0 0 0 1px rgba(255,255,255,.18);
    transition: background-position .9s ease, transform .15s ease, box-shadow .2s ease;
}
.ak-launch .ic { font-size: 1.15rem; }
.ak-launch:hover { background-position: 100% 50%; box-shadow: 0 14px 34px rgba(109,74,255,.5), inset 0 0 0 1px rgba(255,255,255,.25); }
.ak-launch:active { transform: scale(.97); }
.ak-launch:focus-visible { outline: 3px solid #6d4aff; outline-offset: 3px; }
.ak-float.is-open .ak-launch { display: none; }

/* ── The panel ─────────────────────────────────────────────────────────────── */
.ak-panel { position: fixed; right: 18px; bottom: 18px; z-index: 10000; width: 390px; max-width: calc(100vw - 36px); }
.ak-panel[hidden] { display: none; }
.ak-panel .ak-card { max-width: none; max-height: min(640px, calc(100vh - 36px)); box-shadow: 0 30px 80px -20px rgba(13,33,55,.45), 0 0 0 1px rgba(109,74,255,.12); animation: ak-in .22s ease-out; }
.ak-panel .ak-log { flex: 1; min-height: 160px; max-height: none; }
.ak-panel .ak-human { margin: 0; padding: .55rem 1.2rem; font-size: .78rem; background: #f6fbf8; border-top: 1px solid rgba(13,33,55,.06); }
.ak-panel .ak-human a { color: #15803d; font-weight: 800; text-decoration: none; }
.ak-panel .ak-human a:hover { text-decoration: underline; }
@keyframes ak-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
    .ak-float { right: 14px; bottom: 14px; }
    .ak-launch { height: 48px; font-size: .9rem; }
    .ak-panel { right: 0; left: 0; bottom: 0; width: auto; max-width: none; }
    .ak-panel .ak-card { border-radius: 20px 20px 0 0; max-height: 88vh; }
}
@media print { .ak-float, .ak-panel { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
    .ak-msg.is-typing::after { animation: none; width: 2.2em; }
    .ak-launch { transition: none; }
    .ak-panel .ak-card { animation: none; }
}
