
.cdpf-chat {
  --navy-950: #081630;
  --navy-900: #0b1e3d;
  --navy-800: #122a52;
  --navy-700: #1b3868;
  --gold: #d98e3b;
  --gold-light: #e8b36a;
  --white: #ffffff;
  --muted: #65718a;
  --success: #28966f;
  --danger: #c94d4d;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
  box-sizing: border-box;
}
.cdpf-chat *, .cdpf-chat *::before, .cdpf-chat *::after { box-sizing: border-box; }
.cdpf-chat button, .cdpf-chat input, .cdpf-chat textarea { font: inherit; }
.cdpf-chat button { cursor: pointer; }

.cdpf-chat {
  position: fixed;
  z-index: 9999;
  right: 24px;
  bottom: 22px;
  font-family: var(--font-body);
}
.cdpf-chat__launcher {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-950));
  box-shadow: 0 18px 45px rgba(4,16,38,.38), inset 0 0 0 1px rgba(255,255,255,.12);
  transition: transform .22s ease, box-shadow .22s ease;
}
.cdpf-chat__launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 22px 55px rgba(4,16,38,.46), inset 0 0 0 1px rgba(255,255,255,.18);
}
.cdpf-chat__launcher-icon { width: 29px; height: 29px; }
.cdpf-chat__launcher-icon svg { width: 100%; height: 100%; }
.cdpf-chat__pulse {
  position: absolute;
  inset: -5px;
  border: 2px solid rgba(232,179,106,.55);
  border-radius: 50%;
  animation: cdpf-pulse 2.2s infinite;
  pointer-events: none;
}
@keyframes cdpf-pulse {
  0% { transform: scale(.85); opacity: .85; }
  75%, 100% { transform: scale(1.25); opacity: 0; }
}
.cdpf-chat__teaser {
  position: absolute;
  right: 76px;
  bottom: 12px;
  min-width: 132px;
  padding: 12px 16px;
  border: 1px solid rgba(11,30,61,.10);
  border-radius: 15px 15px 4px 15px;
  color: var(--navy-900);
  background: #fff;
  box-shadow: 0 14px 35px rgba(8,22,48,.20);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity .2s, transform .2s;
}
.cdpf-chat.is-open .cdpf-chat__teaser,
.cdpf-chat.is-open .cdpf-chat__launcher { opacity: 0; pointer-events: none; transform: translateY(10px); }

.cdpf-chat__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(392px, calc(100vw - 32px));
  height: min(650px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 32px 90px rgba(4,16,38,.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(.97);
  transform-origin: right bottom;
  transition: opacity .24s ease, transform .24s ease, visibility .24s;
}
.cdpf-chat.is-open .cdpf-chat__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.cdpf-chat__header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 16px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 10%, rgba(67,108,177,.45), transparent 45%),
    linear-gradient(135deg, var(--navy-800), var(--navy-950));
}
.cdpf-chat__identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cdpf-chat__identity > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cdpf-chat__identity strong { font-family: var(--font-display); font-size: 18px; }
.cdpf-chat__identity div > span { color: rgba(255,255,255,.72); font-size: 12px; }
.cdpf-chat__identity i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: #49d49b;
  box-shadow: 0 0 0 4px rgba(73,212,155,.12);
}
.cdpf-chat__avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--navy-950);
  background: linear-gradient(145deg, var(--gold-light), var(--gold));
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
}
.cdpf-chat__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.10);
  font-size: 25px;
  line-height: 1;
}
.cdpf-chat__close:hover { background: rgba(255,255,255,.18); }
.cdpf-chat__progress-wrap { height: 4px; background: #e9edf4; }
.cdpf-chat__progress {
  width: 0;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width .35s ease;
}
.cdpf-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 14px;
  background:
    linear-gradient(rgba(248,250,253,.94), rgba(248,250,253,.94)),
    radial-gradient(circle at 30% 20%, rgba(217,142,59,.15), transparent 30%);
  scrollbar-width: thin;
  scrollbar-color: #cfd6e2 transparent;
}
.cdpf-chat__messages { display: flex; flex-direction: column; gap: 12px; }
.cdpf-chat__message {
  max-width: 87%;
  padding: 13px 15px;
  border-radius: 17px;
  font-size: 14px;
  line-height: 1.55;
  animation: cdpf-message-in .24s ease both;
}
@keyframes cdpf-message-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.cdpf-chat__message--bot {
  align-self: flex-start;
  border: 1px solid #e4e8ef;
  border-bottom-left-radius: 5px;
  color: var(--navy-900);
  background: #fff;
  box-shadow: 0 7px 20px rgba(11,30,61,.06);
}
.cdpf-chat__message--user {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
}
.cdpf-chat__message strong { font-weight: 700; }
.cdpf-chat__actions { display: grid; gap: 9px; margin-top: 18px; }
.cdpf-chat__choice {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  color: var(--navy-900);
  background: #fff;
  text-align: left;
  font-weight: 600;
  transition: border-color .18s, transform .18s, box-shadow .18s, background .18s;
}
.cdpf-chat__choice:hover {
  transform: translateY(-1px);
  border-color: rgba(217,142,59,.65);
  background: #fffaf4;
  box-shadow: 0 9px 22px rgba(11,30,61,.08);
}
.cdpf-chat__choice-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #b76e22;
  background: rgba(217,142,59,.12);
  font-size: 18px;
}
.cdpf-chat__form { display: grid; gap: 12px; }
.cdpf-chat__field { display: grid; gap: 6px; }
.cdpf-chat__field label { color: var(--navy-900); font-size: 12px; font-weight: 700; }
.cdpf-chat__field input,
.cdpf-chat__field textarea {
  width: 100%;
  border: 1px solid #d9dfe9;
  border-radius: 13px;
  padding: 12px 13px;
  color: var(--navy-900);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.cdpf-chat__field textarea { min-height: 82px; resize: vertical; }
.cdpf-chat__field input:focus,
.cdpf-chat__field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(217,142,59,.12);
}
.cdpf-chat__field input[aria-invalid="true"] { border-color: var(--danger); }
.cdpf-chat__error { color: var(--danger); font-size: 11px; }
.cdpf-chat__consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.cdpf-chat__consent input { margin-top: 2px; accent-color: var(--gold); }
.cdpf-chat__submit {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: var(--navy-950);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(217,142,59,.22);
}
.cdpf-chat__submit:hover { filter: brightness(1.03); transform: translateY(-1px); }
.cdpf-chat__summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e2e6ed;
  border-radius: 15px;
  background: #fff;
}
.cdpf-chat__summary-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  font-size: 12px;
  line-height: 1.45;
}
.cdpf-chat__summary-row span:first-child { color: var(--muted); }
.cdpf-chat__summary-row span:last-child { color: var(--navy-900); font-weight: 700; }
.cdpf-chat__success {
  padding: 16px;
  border: 1px solid rgba(40,150,111,.25);
  border-radius: 16px;
  color: #236c55;
  background: rgba(40,150,111,.08);
  line-height: 1.55;
}
.cdpf-chat__success-actions { display: grid; gap: 9px; margin-top: 14px; }
.cdpf-chat__success-actions a {
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.cdpf-chat__success-actions a:first-child { color: #fff; background: var(--navy-900); }
.cdpf-chat__success-actions a:last-child { color: var(--navy-900); border: 1px solid #dfe4ec; background: #fff; }
.cdpf-chat__footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid #e8ebf0;
  background: #fff;
}
.cdpf-chat__back,
.cdpf-chat__restart {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}
.cdpf-chat__back:disabled { opacity: .35; cursor: not-allowed; }
.cdpf-chat__back:not(:disabled):hover,
.cdpf-chat__restart:hover { color: var(--navy-900); }
.cdpf-chat__typing {
  width: 54px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cdpf-chat__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8f9aaf;
  animation: cdpf-dot 1.1s infinite ease-in-out;
}
.cdpf-chat__typing span:nth-child(2) { animation-delay: .16s; }
.cdpf-chat__typing span:nth-child(3) { animation-delay: .32s; }
@keyframes cdpf-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 600px) {
  .cdpf-chat { right: 14px; bottom: 14px; }
  .cdpf-chat__teaser { display: none; }
  .cdpf-chat__panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .cdpf-chat__header { padding-top: max(16px, env(safe-area-inset-top)); }
  .cdpf-chat__footer { padding-bottom: max(9px, env(safe-area-inset-bottom)); }
}

.cdpf-chat {
  display: block !important;
  position: fixed !important;
  z-index: 2147483000 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none;
  isolation: isolate;
}
.cdpf-chat__launcher,
.cdpf-chat__teaser,
.cdpf-chat__panel { pointer-events: auto; }
.cdpf-chat:not(.is-open) .cdpf-chat__launcher {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (max-width: 600px) {
  .cdpf-chat {
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .cdpf-chat__launcher {
    width: 58px;
    height: 58px;
    box-shadow: 0 14px 38px rgba(4,16,38,.44), inset 0 0 0 1px rgba(255,255,255,.14);
  }
  .cdpf-chat__launcher-icon { width: 26px; height: 26px; }
  .cdpf-chat__panel {
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cdpf-chat, .cdpf-chat *, .cdpf-chat *::before, .cdpf-chat *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
