/* ============================================================
   Amazon Advies — vraag-chat widget (bottom-right)
   Greeting bubble + round launcher + question form.
   Relies on tokens from styles.css.
   ============================================================ */
#aa-chat {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  font-family: var(--font-sans);
  display: flex; flex-direction: column; align-items: flex-end; gap: 16px;
}

/* round launcher */
.aa-launch {
  position: relative; width: 62px; height: 62px; border-radius: 50%;
  background: var(--cta); color: #fff; border: 0; cursor: pointer; flex: none;
  display: grid; place-items: center;
  box-shadow: 0 14px 30px color-mix(in srgb,var(--cta) 38%, transparent);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.aa-launch:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 18px 38px color-mix(in srgb,var(--cta) 46%, transparent); }
.aa-launch svg { width: 27px; height: 27px; }
.aa-launch__on { position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; border-radius: 50%; background: #34D27B; border: 2.5px solid var(--cta); }
#aa-chat[data-open="true"] .aa-launch { display: none; }

/* greeting bubble */
.aa-greet {
  position: relative; width: 290px; max-width: calc(100vw - 44px);
  background: var(--white); border-radius: 20px; padding: 34px 20px 20px;
  box-shadow: 0 22px 50px rgba(21,39,62,.20), 0 4px 12px rgba(21,39,62,.10);
  border: 1px solid var(--rule);
  cursor: pointer;
  transform: translateY(10px) scale(.96); opacity: 0; pointer-events: none;
  transform-origin: bottom right; transition: transform .3s var(--ease-out), opacity .25s;
}
#aa-chat[data-greeting="true"] .aa-greet { transform: none; opacity: 1; pointer-events: auto; }
#aa-chat[data-open="true"] .aa-greet { display: none; }
.aa-greet__av {
  position: absolute; top: -26px; left: 24px; width: 56px; height: 56px; border-radius: 50%;
  overflow: hidden; border: 3px solid var(--white); box-shadow: 0 6px 16px rgba(21,39,62,.2); background: var(--navy-600);
}
.aa-greet__av img { width: 100%; height: 100%; object-fit: cover; }
.aa-greet__dot { position: absolute; top: 18px; left: 63px; width: 14px; height: 14px; border-radius: 50%; background: #34D27B; border: 3px solid var(--white); z-index: 2; }
.aa-greet__txt { font-size: 16.5px; font-weight: 600; color: var(--ink); line-height: 1.4; margin: 6px 0 0; }
.aa-greet__close {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb,var(--navy) 7%, transparent); border: 0; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; transition: background .2s, color .2s;
}
.aa-greet__close:hover { background: color-mix(in srgb,var(--navy) 12%, transparent); color: var(--ink); }
.aa-greet__close svg { width: 15px; height: 15px; }

/* form panel */
.aa-panel {
  position: absolute; right: 0; bottom: 0; width: 360px; max-width: calc(100vw - 32px);
  background: var(--white); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 30px 70px rgba(21,39,62,.28), 0 8px 20px rgba(21,39,62,.12);
  border: 1px solid var(--rule);
  transform: translateY(14px) scale(.98); opacity: 0; pointer-events: none;
  transform-origin: bottom right; transition: transform .28s var(--ease-out), opacity .22s;
}
#aa-chat[data-open="true"] .aa-panel { transform: none; opacity: 1; pointer-events: auto; }

.aa-head { background: var(--navy); color: #fff; padding: 18px 18px 20px; position: relative; display: flex; align-items: center; gap: 13px; }
.aa-head__av { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none; border: 2px solid color-mix(in srgb,#fff 28%, transparent); }
.aa-head__av img { width: 100%; height: 100%; object-fit: cover; }
.aa-head__t { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.aa-head__t small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 11px; color: #9FE9C0; letter-spacing: .03em; margin-top: 3px; }
.aa-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb,#fff 12%, transparent); border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.aa-close:hover { background: color-mix(in srgb,#fff 22%, transparent); }
.aa-close svg { width: 16px; height: 16px; }

.aa-body { padding: 18px; }
.aa-intro { font-size: 14.5px; color: var(--muted); margin: 0 0 16px; }
.aa-intro b { color: var(--ink); }
.aa-form { display: grid; gap: 13px; }
.aa-form .btn { width: 100%; justify-content: center; margin-top: 2px; }
.aa-foot-note { font-size: 12px; color: var(--muted-2); text-align: center; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.aa-foot-note svg { width: 13px; height: 13px; color: var(--accent-deep); }

/* success */
.aa-success { padding: 34px 24px 30px; text-align: center; display: none; }
#aa-chat[data-sent="true"] .aa-form-wrap { display: none; }
#aa-chat[data-sent="true"] .aa-success { display: block; }
.aa-success__ico { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; background: color-mix(in srgb,var(--accent) 16%, transparent); color: var(--accent-deep); display: grid; place-items: center; }
.aa-success__ico svg { width: 32px; height: 32px; }
.aa-success h4 { font-family: var(--font-display); font-size: 21px; color: var(--ink); }
.aa-success p { font-size: 14.5px; color: var(--muted); margin-top: 10px; }
.aa-success .aa-replay { margin-top: 18px; background: none; border: 0; color: var(--cta); font-weight: 700; font-size: 14px; cursor: pointer; font-family: var(--font-sans); }

@media (prefers-reduced-motion: reduce) { .aa-panel, .aa-greet, .aa-launch { transition: none; } }
