/* ==========================================================================
   AI assistant widget + "contact the designer" credit.
   Uses the tokens from styles.css so it follows any palette change.
   ========================================================================== */

.ax-dock { position: fixed; inset: 0; z-index: 60; pointer-events: none; font-family: var(--font-body); --ax-eye-x: 0px; --ax-eye-y: 0px; --ax-edge: clamp(14px, 2.2vw, 24px); }
.ax-dock > * { pointer-events: auto; }
.ax-dock button { font-family: inherit; }
.ax-dock [hidden] { display: none !important; }
.ax-dock svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ax-dock :focus-visible { outline: 2px solid var(--tech); outline-offset: 3px; }

/* ---------- Launcher: a small version of the hero robot ---------- */
.ax-launcher { position: absolute; bottom: var(--ax-edge); inset-inline-end: var(--ax-edge); width: 64px; height: 64px; border-radius: 50%; cursor: pointer; padding: 0;
  display: grid; place-items: center; border: 1px solid var(--glass-border); background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%); backdrop-filter: blur(var(--blur)) saturate(160%);
  box-shadow: var(--glass-shadow), 0 0 0 1px var(--glass-edge), 0 14px 34px -12px rgba(248, 152, 24, .55);
  transition: transform .25s ease, box-shadow .25s ease; }
.ax-launcher:hover { transform: translateY(-3px) scale(1.04); }
.ax-launcher::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(248, 152, 24, .45); opacity: 0; animation: ax-ring 3.2s ease-out infinite; pointer-events: none; }
.ax-open .ax-launcher::after { animation: none; }
@keyframes ax-ring { 0% { transform: scale(.86); opacity: .9; } 70%, 100% { transform: scale(1.22); opacity: 0; } }

.ax-bot { position: relative; display: block; width: 42px; height: 36px; }
.ax-bot-head { position: absolute; inset: 0 4px; border-radius: 46% 46% 44% 44%; overflow: hidden;
  background: linear-gradient(180deg, var(--robot-accent) 0 21%, #fff 21% 60%, #e7eaf1 100%);
  box-shadow: inset 0 -3px 5px rgba(15, 23, 40, .12), 0 3px 8px -3px rgba(15, 23, 40, .35); }
.ax-bot-ear { position: absolute; top: 12px; width: 7px; height: 14px; border-radius: 4px; background: var(--robot-joint); box-shadow: inset 0 0 0 1.5px var(--robot-accent); }
.ax-bot-ear:nth-child(1) { left: 0; }
.ax-bot-ear:nth-child(2) { right: 0; }
.ax-bot-visor { position: absolute; left: 3px; right: 3px; top: 10px; height: 16px; border-radius: 9px; background: #1d2129; display: flex; align-items: center; justify-content: center; gap: 5px; }
.ax-bot-visor i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--robot-glow); background: #0b0e14; box-shadow: 0 0 6px var(--robot-glow);
  transform: translate(var(--ax-eye-x), var(--ax-eye-y)); animation: ax-blink 5.5s infinite; }
@keyframes ax-blink { 0%, 93%, 100% { scale: 1 1; } 96% { scale: 1 .1; } }

/* ---------- Teaser bubble ---------- */
.ax-teaser { position: absolute; bottom: calc(var(--ax-edge) + 12px); inset-inline-end: calc(var(--ax-edge) + 78px); max-width: 250px; padding: 11px 15px; cursor: pointer;
  border-radius: 16px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, .92); color: var(--ink); text-align: start;
  font-size: .9rem; font-weight: 500; line-height: 1.4; box-shadow: var(--glass-shadow); animation: ax-pop .45s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes ax-pop { from { opacity: 0; transform: translateY(8px) scale(.94); } }

/* ---------- Panel ---------- */
.ax-panel { position: absolute; bottom: calc(var(--ax-edge) + 78px); inset-inline-end: var(--ax-edge); width: min(392px, calc(100vw - 2 * var(--ax-edge)));
  height: min(600px, calc(100vh - var(--ax-edge) - 170px)); height: min(600px, calc(100dvh - var(--ax-edge) - 170px)); min-height: 340px;
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); color: var(--ink);
  background: rgba(250, 252, 255, .86); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 0 0 1px var(--glass-edge), 0 30px 80px -24px rgba(24, 45, 90, .45);
  animation: ax-pop .3s ease both; }

.ax-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid rgba(15, 23, 40, .07);
  background: linear-gradient(120deg, rgba(255, 231, 199, .75), rgba(255, 255, 255, .35) 55%, rgba(168, 232, 255, .4)); }
html[dir='rtl'] .ax-head { padding: 12px 16px 12px 12px; }
.ax-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: inset 0 0 0 1px rgba(15, 23, 40, .06); flex: none; }
.ax-avatar .ax-bot { transform: scale(.72); }
.ax-titles { display: flex; flex-direction: column; min-width: 0; margin-inline-end: auto; line-height: 1.25; }
.ax-title { font-family: var(--font-display); font-size: 1.02rem; }
.ax-subtitle { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ax-subtitle::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 3px rgba(47, 191, 113, .2); }
.ax-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.ax-icon-btn:hover { background: rgba(255, 255, 255, .85); color: var(--ink); }

.ax-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.ax-msg { max-width: 88%; display: flex; flex-direction: column; gap: 8px; font-size: .93rem; line-height: 1.55; animation: ax-pop .25s ease both; }
.ax-msg-body { padding: 10px 14px; border-radius: 18px; overflow-wrap: anywhere; text-align: start; }
.ax-msg-assistant { align-self: flex-start; }
.ax-msg-assistant .ax-msg-body { background: #fff; border: 1px solid rgba(15, 23, 40, .06); border-start-start-radius: 6px; box-shadow: 0 6px 18px -12px rgba(24, 45, 90, .35); }
.ax-msg-user { align-self: flex-end; }
.ax-msg-user .ax-msg-body { background: var(--ink); color: #fff; border-end-end-radius: 6px; white-space: pre-wrap; }
.ax-msg-note .ax-msg-body { background: var(--brand-soft); border-color: rgba(248, 152, 24, .3); }
.ax-msg-body p { margin: 0; }
.ax-msg-body p + p, .ax-msg-body ul + p, .ax-msg-body p + ul { margin-top: 8px; }
.ax-msg-body ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.ax-msg-body a { color: var(--brand-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.ax-msg-body a[dir='ltr'] { unicode-bidi: isolate; display: inline-block; }

.ax-show { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(248, 152, 24, .45); background: var(--brand-soft); color: var(--brand-ink); font-size: .84rem; font-weight: 600; transition: transform .2s, background .2s; }
.ax-show:hover { transform: translateY(-1px); background: #ffdcab; }
.ax-show svg { width: 15px; height: 15px; }
html[dir='rtl'] .ax-show svg { transform: scaleX(-1); }

/* Request card: the assistant collected a name and a contact, the visitor sends it on. */
.ax-lead { align-self: stretch; padding: 12px 14px 14px; border-radius: 16px; background: linear-gradient(135deg, #fff, var(--brand-soft)); border: 1px solid rgba(248, 152, 24, .35); }
.ax-lead strong { display: block; font-size: .86rem; margin-bottom: 10px; }
.ax-lead-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ax-lead-btn { flex: 1 1 130px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 999px; font-size: .84rem; font-weight: 600;
  background: #fff; border: 1px solid rgba(15, 23, 40, .12); color: var(--ink); transition: transform .2s, box-shadow .2s; }
.ax-lead-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(24, 45, 90, .45); }
.ax-lead-wa { background: linear-gradient(135deg, #ffad3b, var(--brand)); border-color: transparent; color: #1b1203; }

.ax-dots { display: inline-flex; gap: 5px; padding: 6px 2px; }
.ax-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ax-dot 1.1s ease-in-out infinite; }
.ax-dots i:nth-child(2) { animation-delay: .15s; }
.ax-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ax-dot { 0%, 60%, 100% { transform: none; opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }

.ax-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; }
.ax-chips:empty { display: none; }
.ax-chip { padding: 8px 13px; border-radius: 999px; border: 1px solid rgba(15, 23, 40, .1); background: rgba(255, 255, 255, .8); color: var(--ink-2);
  font-size: .84rem; font-weight: 500; cursor: pointer; text-align: start; transition: background .2s, border-color .2s, color .2s; }
.ax-chip:hover { background: #fff; border-color: var(--brand); color: var(--ink); }

.ax-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; border-radius: 24px; background: #fff; border: 1px solid rgba(15, 23, 40, .1); transition: border-color .2s, box-shadow .2s; }
html[dir='rtl'] .ax-form { padding: 6px 14px 6px 6px; }
.ax-form:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(248, 152, 24, .15); }
.ax-input { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.45; padding: 7px 0; max-height: 120px; }
.ax-input:focus-visible { outline: 0; }
.ax-input::placeholder { color: var(--muted); }
.ax-send { width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #1b1203; flex: none;
  background: linear-gradient(135deg, #ffad3b, var(--brand)); box-shadow: 0 8px 18px -8px rgba(248, 152, 24, .8); transition: transform .2s, opacity .2s; }
.ax-send:hover { transform: scale(1.06); }
.ax-send:disabled { opacity: .45; cursor: default; transform: none; }
html[dir='rtl'] .ax-send svg { transform: scaleX(-1); }
.ax-note { margin: 0; padding: 8px 16px 12px; font-size: .72rem; color: var(--muted); text-align: center; }

/* ---------- Designer credit ---------- */
.ax-credit { position: absolute; bottom: calc(var(--ax-edge) + 10px); inset-inline-start: var(--ax-edge); height: 44px; padding: 0 16px 0 14px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(15, 23, 40, .9); color: #fff; font-size: .86rem; font-weight: 600;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 14px 34px -14px rgba(15, 23, 40, .7); transition: transform .25s ease, background .25s ease; }
html[dir='rtl'] .ax-credit { padding: 0 14px 0 16px; }
.ax-credit:hover { transform: translateY(-2px); background: var(--ink); }
.ax-credit-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(248, 152, 24, .25); flex: none; }

.ax-credit-card { position: absolute; bottom: calc(var(--ax-edge) + 66px); inset-inline-start: var(--ax-edge); width: min(340px, calc(100vw - 2 * var(--ax-edge))); padding: 20px;
  border-radius: var(--radius); background: rgba(15, 23, 40, .94); color: #fff; border: 1px solid rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 30px 70px -24px rgba(15, 23, 40, .75); animation: ax-pop .3s ease both; }
.ax-credit-card strong { display: block; font-family: var(--font-display); font-size: 1.12rem; line-height: 1.3; margin-bottom: 8px; }
.ax-credit-card p { margin: 0 0 16px; font-size: .9rem; line-height: 1.6; color: rgba(255, 255, 255, .78); }
.ax-cta-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ax-cta { flex: 1 1 120px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #fff; transition: transform .2s, background .2s; }
.ax-cta:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .18); }
.ax-cta-wa { background: linear-gradient(135deg, #ffad3b, var(--brand)); border-color: transparent; color: #1b1203; }
.ax-cta-wa:hover { background: linear-gradient(135deg, #ffb851, #ffa22b); }

/* Leave room for the floating controls at the very bottom of the page. */
.footer { padding-bottom: 96px; }

/* ---------- Small screens ---------- */
/* Phones: the hero copy sits at the bottom of the screen, so the floating controls
   get their own strip underneath it instead of covering the buttons. */
@media (max-width: 860px) {
  .phase { padding-bottom: 68px; }
  .ax-dock { --ax-edge: 12px; }
  .ax-launcher { width: 52px; height: 52px; bottom: 7px; }
  .ax-launcher .ax-bot { transform: scale(.86); }
  .ax-credit { height: 34px; bottom: 16px; font-size: .8rem; padding-inline: 11px 14px; }
  html[dir='rtl'] .ax-credit { padding-inline: 11px 14px; }
  .ax-credit-label { font-size: 0; }
  .ax-credit-label::after { content: attr(data-short); font-size: .8rem; }
  .ax-credit-card { bottom: 60px; }
  .ax-panel { bottom: 68px; }
}

@media (max-width: 560px) {
  .ax-panel { inset-inline: 8px; bottom: 8px; width: auto; height: min(640px, calc(100vh - 16px)); height: min(640px, calc(100dvh - 16px)); }
  .ax-open .ax-launcher, .ax-open .ax-credit { display: none; }
  .ax-msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  .ax-launcher::after, .ax-bot-visor i, .ax-dots i, .ax-panel, .ax-msg, .ax-teaser, .ax-credit-card { animation: none !important; }
  .ax-log { scroll-behavior: auto; }
}
