/* ==========================================================================
   Vadum Chat — widget de conversație, tematizabil
   Fiecare demo suprascrie doar variabilele --vc-* de mai jos.
   Nu depinde de niciun framework.
   ========================================================================== */

.vadum-chat {
  /* Paletă — suprascrie-le în :root sau pe .vadum-chat din fiecare demo */
  --vc-accent: #FF7A45;
  --vc-accent-ink: #FFFFFF;
  --vc-bg: #FFFFFF;
  --vc-surface: #F4F5F7;
  --vc-text: #14171C;
  --vc-muted: #6B7280;
  --vc-border: #E4E7EC;
  --vc-shadow: 0 24px 60px -12px rgba(12, 16, 24, .28), 0 8px 20px -8px rgba(12, 16, 24, .16);
  --vc-radius: 18px;
  --vc-font: inherit;

  position: fixed;
  right: clamp(14px, 3vw, 26px);
  bottom: clamp(14px, 3vw, 26px);
  z-index: 2147483000;
  font-family: var(--vc-font);
  -webkit-font-smoothing: antialiased;
}

.vadum-chat *,
.vadum-chat *::before,
.vadum-chat *::after { box-sizing: border-box; }

/* ---------- Butonul plutitor ---------- */

.vc-launcher {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--vc-accent);
  color: var(--vc-accent-ink);
  cursor: pointer;
  box-shadow: var(--vc-shadow);
  transition: transform .25s cubic-bezier(.34, 1.4, .64, 1), box-shadow .25s ease;
}

.vc-launcher:hover { transform: translateY(-3px) scale(1.04); }
.vc-launcher:active { transform: translateY(-1px) scale(.98); }
.vc-launcher:focus-visible { outline: 3px solid var(--vc-accent); outline-offset: 4px; }

.vc-launcher svg { width: 27px; height: 27px; transition: opacity .2s ease, transform .3s ease; }
.vc-launcher .vc-ico-close { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); }

.vadum-chat.is-open .vc-launcher .vc-ico-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
.vadum-chat.is-open .vc-launcher .vc-ico-close { opacity: 1; transform: rotate(0) scale(1); }

/* Puls discret — atrage atenția fără să enerveze */
.vc-launcher::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--vc-accent);
  animation: vc-pulse 2.6s ease-out infinite;
  pointer-events: none;
}

.vadum-chat.is-open .vc-launcher::after,
.vadum-chat.has-engaged .vc-launcher::after { animation: none; opacity: 0; }

@keyframes vc-pulse {
  0%   { transform: scale(1);    opacity: .7; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* Bulina cu numărul de mesaje necitite */
.vc-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 21px; height: 21px;
  padding: 0 6px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: #E5484D;
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  border: 2px solid var(--vc-bg);
  transform: scale(0);
  transition: transform .3s cubic-bezier(.34, 1.5, .64, 1);
}
.vc-badge.is-visible { transform: scale(1); }

/* ---------- Bula de invitație ---------- */

.vc-teaser {
  position: absolute;
  right: 74px;
  bottom: 12px;
  width: max-content;
  max-width: min(268px, calc(100vw - 110px));
  padding: 12px 15px;
  border-radius: 15px 15px 3px 15px;
  background: var(--vc-bg);
  color: var(--vc-text);
  border: 1px solid var(--vc-border);
  box-shadow: var(--vc-shadow);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  transform: translateY(8px) scale(.95);
  transform-origin: 100% 100%;
  pointer-events: none;
  transition: opacity .35s ease, transform .35s cubic-bezier(.34, 1.3, .64, 1);
}

.vc-teaser.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.vadum-chat.is-open .vc-teaser { opacity: 0; transform: translateY(8px) scale(.95); pointer-events: none; }

.vc-teaser-close {
  position: absolute;
  top: -7px; right: -7px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--vc-border);
  background: var(--vc-bg);
  color: var(--vc-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.vc-teaser-close:hover { color: var(--vc-text); }

/* ---------- Panoul ---------- */

.vc-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(384px, calc(100vw - 28px));
  height: min(590px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--vc-radius);
  background: var(--vc-bg);
  border: 1px solid var(--vc-border);
  box-shadow: var(--vc-shadow);
  opacity: 0;
  transform: translateY(14px) scale(.97);
  transform-origin: 100% 100%;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.34, 1.25, .64, 1);
}

.vadum-chat.is-open .vc-panel { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Antet ---------- */

.vc-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--vc-accent);
  color: var(--vc-accent-ink);
}

.vc-avatar {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  /* peste accent, un cerc deschis lasă inițialele albe la 3,7:1;
     unul închis le duce peste 6:1 */
  background: rgba(0, 0, 0, .22);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
}

.vc-header-text { min-width: 0; flex: 1; }
.vc-title { font-size: 15px; font-weight: 650; line-height: 1.25; }
.vc-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  opacity: .88;
  margin-top: 2px;
}
.vc-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .7);
  animation: vc-blip 2.4s ease-out infinite;
}
@keyframes vc-blip {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.vc-close {
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  opacity: .8;
  cursor: pointer;
}
.vc-close:hover { opacity: 1; background: rgba(255, 255, 255, .15); }

/* ---------- Mesaje ---------- */

.vc-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 6px;
  background: var(--vc-surface);
  scrollbar-width: thin;
  scrollbar-color: var(--vc-border) transparent;
}
.vc-log::-webkit-scrollbar { width: 8px; }
.vc-log::-webkit-scrollbar-thumb { background: var(--vc-border); border-radius: 4px; }

.vc-msg {
  display: flex;
  margin-bottom: 10px;
  animation: vc-in .32s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes vc-in {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

.vc-msg-bot { justify-content: flex-start; }
.vc-msg-user { justify-content: flex-end; }

.vc-bubble {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.vc-msg-bot .vc-bubble {
  background: var(--vc-bg);
  color: var(--vc-text);
  border: 1px solid var(--vc-border);
  border-bottom-left-radius: 5px;
}

.vc-msg-user .vc-bubble {
  background: var(--vc-accent);
  color: var(--vc-accent-ink);
  border-bottom-right-radius: 5px;
}

.vc-bubble strong { font-weight: 650; }
.vc-bubble a { color: inherit; text-underline-offset: 2px; }

/* Indicator de scriere */
.vc-typing { display: flex; gap: 4px; padding: 4px 2px; }
.vc-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--vc-muted);
  opacity: .5;
  animation: vc-bounce 1.3s ease-in-out infinite;
}
.vc-typing span:nth-child(2) { animation-delay: .16s; }
.vc-typing span:nth-child(3) { animation-delay: .32s; }
@keyframes vc-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: .45; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Sugestii rapide ---------- */

.vc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 4px 16px 14px;
  background: var(--vc-surface);
}

.vc-chip {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--vc-accent);
  background: var(--vc-bg);
  color: var(--vc-accent);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.2;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  animation: vc-in .3s ease both;
}
.vc-chip:hover { background: var(--vc-accent); color: var(--vc-accent-ink); transform: translateY(-1px); }
.vc-chip:focus-visible { outline: 2px solid var(--vc-accent); outline-offset: 2px; }

/* ---------- Compunere ---------- */

.vc-form {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 11px 12px;
  background: var(--vc-bg);
  border-top: 1px solid var(--vc-border);
  overflow: hidden;          /* nimic nu scapă peste subsol */
}

.vc-input {
  flex: 1;
  min-width: 0;              /* altfel textarea refuză să se micșoreze */
  max-height: 108px;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--vc-border);
  border-radius: 21px;
  background: var(--vc-surface);
  color: var(--vc-text);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  transition: border-color .18s ease, box-shadow .18s ease;
}
/* Placeholder pe un singur rând, tăiat elegant dacă nu încape —
   altfel se rupea pe două rânduri și ieșea din casetă. */
.vc-input::placeholder {
  color: var(--vc-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vc-input:focus {
  outline: none;
  border-color: var(--vc-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--vc-accent) 18%, transparent);
}

.vc-send {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--vc-accent);
  color: var(--vc-accent-ink);
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease;
}
.vc-send:disabled { opacity: .35; cursor: default; }
.vc-send:not(:disabled):hover { transform: scale(1.07); }
.vc-send svg { width: 18px; height: 18px; }

.vc-footer {
  flex: none;
  padding: 0 12px 9px;
  background: var(--vc-bg);
  color: var(--vc-muted);
  font-size: 11px;
  text-align: center;
}
.vc-footer a { color: inherit; font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.vc-footer a:hover { color: var(--vc-accent); }

/* ---------- Mobil ---------- */

@media (max-width: 560px) {
  .vc-panel {
    position: fixed;
    right: 10px; left: 10px;
    bottom: 84px;
    width: auto;
    height: min(560px, calc(100dvh - 108px));
  }
  .vc-teaser { max-width: min(230px, calc(100vw - 100px)); font-size: 13.5px; }
  .vc-launcher { width: 56px; height: 56px; }
}

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

/* ==========================================================================
   Carduri de recapitulare — apar la confirmarea unei rezervări sau estimări
   ========================================================================== */

.vc-card {
  max-width: 92%;
  padding: 15px 16px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  background: var(--vc-bg);
  border: 1.5px solid var(--vc-accent);
  box-shadow: 0 8px 22px -12px rgba(12, 16, 24, .22);
  animation: vc-in .34s cubic-bezier(.22, 1, .36, 1) both;
}

.vc-card.is-success {
  border-color: #3ECF8E;
  background: color-mix(in srgb, #3ECF8E 7%, var(--vc-bg));
}

.vc-card-title {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; padding-bottom: 11px;
  border-bottom: 1px solid var(--vc-border);
  font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  color: var(--vc-text);
}
.vc-card-title svg { width: 17px; height: 17px; flex: none; color: var(--vc-accent); }
.vc-card.is-success .vc-card-title svg { color: #2FA872; }

.vc-card-rows { display: grid; gap: 9px; }

.vc-card-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  font-size: 14px;
}
.vc-card-k { color: var(--vc-muted); flex: none; }
.vc-card-v { font-weight: 600; text-align: right; color: var(--vc-text); }

.vc-card-note {
  margin-top: 12px; padding-top: 11px;
  border-top: 1px solid var(--vc-border);
  font-size: 12.8px; line-height: 1.5; color: var(--vc-muted);
}

/* Sugestia principală — se distinge de celelalte */
.vc-chip.is-primary {
  background: var(--vc-accent);
  color: var(--vc-accent-ink);
  border-color: var(--vc-accent);
}
.vc-chip.is-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
