/* Assistant Porsche Vintage — styles du widget (couleurs et polices du site, voir src/styles/global.css). */
.pvc {
  --pvc-ink: var(--ink, #0d0d0c);
  --pvc-ink-soft: var(--ink-soft, #171614);
  --pvc-cream: var(--cream, #f3ede2);
  --pvc-paper: var(--paper, #faf6ee);
  --pvc-line: var(--line-cream, #d8cfbf);
  --pvc-grey: var(--warm-grey, #8a847a);
  --pvc-green: var(--green, #1f3d2e);
  --pvc-green-hover: var(--green-hover, #2e5a43);
  --pvc-gold: var(--gold, #c9b98f);
  --pvc-gold-light: var(--gold-light, #dccfac);
  --pvc-gold-deep: var(--gold-deep, #6b5d3a);
  --pvc-text: var(--text-dark, #1c1a17);
  --pvc-muted: var(--muted-on-cream, #5c564d);
  --pvc-serif: var(--serif, 'Cormorant Garamond', Georgia, serif);
  --pvc-sans: var(--sans, 'Manrope', system-ui, sans-serif);
  --pvc-bottom: calc(var(--actionbar-h, 0px) + env(safe-area-inset-bottom, 0px) + 14px);
  font-family: var(--pvc-sans);
  color: var(--pvc-text);
  line-height: 1.55;
}
.pvc[dir='rtl'] {
  --pvc-sans: var(--font-arabic, 'Noto Naskh Arabic'), 'Segoe UI', Tahoma, system-ui, sans-serif;
  --pvc-serif: var(--font-arabic, 'Noto Naskh Arabic'), 'Segoe UI', Tahoma, serif;
}
.pvc *,
.pvc *::before,
.pvc *::after {
  box-sizing: border-box;
}

/* ——— Bouton d'ouverture ——— */
.pvc-launcher {
  position: fixed;
  inset-inline-end: 14px;
  bottom: var(--pvc-bottom);
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 18px 0 14px;
  border: 1px solid var(--pvc-gold);
  background: var(--pvc-ink);
  color: var(--pvc-gold-light);
  font: 500 0.95rem/1 var(--pvc-sans);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(13, 13, 12, 0.28);
  transition: transform 0.25s var(--ease-out, ease), background-color 0.2s;
}
.pvc-launcher:hover {
  background: var(--pvc-ink-soft);
  transform: translateY(-2px);
}
.pvc-launcher:focus-visible,
.pvc button:focus-visible,
.pvc a:focus-visible,
.pvc select:focus-visible,
.pvc input:focus-visible,
.pvc textarea:focus-visible,
.pvc-log:focus-visible {
  outline: 2px solid var(--pvc-gold);
  outline-offset: 2px;
}
.pvc-launcher__icon {
  width: 22px;
  height: 22px;
  flex: none;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9b98f' stroke-width='1.4'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3Cpath d='M8 9.5h8M8 12.5h5'/%3E%3C/svg%3E");
}
.pvc.is-open .pvc-launcher {
  display: none;
}
@media (max-width: 639px) {
  .pvc-launcher {
    width: 52px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .pvc-launcher__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* ——— Panneau ——— */
.pvc-panel {
  position: fixed;
  inset-inline-end: 14px;
  bottom: var(--pvc-bottom);
  z-index: 66;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 28px));
  height: min(640px, calc(100vh - var(--pvc-bottom) - 90px));
  height: min(640px, calc(100dvh - var(--pvc-bottom) - 90px));
  background: var(--pvc-paper);
  border: 1px solid var(--pvc-line);
  box-shadow: 0 24px 60px rgba(13, 13, 12, 0.3);
  overflow: hidden;
}
.pvc-panel[hidden] {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .pvc-panel:not([hidden]) {
    animation: pvc-in 0.28s var(--ease-out, ease) both;
  }
  @keyframes pvc-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
  }
}
@media (max-width: 639px) {
  .pvc-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.pvc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 13px 18px;
  background: var(--pvc-ink);
  color: var(--pvc-cream);
  border-bottom: 1px solid var(--pvc-gold-deep);
}
.pvc[dir='rtl'] .pvc-head {
  padding: 14px 18px 13px 14px;
}
.pvc-title {
  margin: 0;
  font: 500 1.3rem/1.15 var(--pvc-serif);
  letter-spacing: 0.01em;
  color: var(--pvc-cream);
}
.pvc-subtitle {
  margin: 3px 0 0;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pvc-gold);
}
.pvc[dir='rtl'] .pvc-subtitle {
  letter-spacing: 0;
}
.pvc-head__tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.pvc-lang {
  height: 36px;
  max-width: 118px;
  padding: 0 8px;
  border: 1px solid var(--pvc-gold-deep);
  background: var(--pvc-ink-soft);
  color: var(--pvc-cream);
  font: 0.82rem var(--pvc-sans);
}
.pvc-close {
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--pvc-cream);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.pvc-close:hover {
  border-color: var(--pvc-gold-deep);
}

/* ——— Fil de discussion ——— */
.pvc-log {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 8px;
  background: var(--pvc-cream);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
}
.pvc-msg {
  max-width: 92%;
  padding: 11px 14px;
  word-wrap: break-word;
}
.pvc-msg p {
  margin: 0 0 6px;
}
.pvc-msg p:last-child {
  margin-bottom: 0;
}
.pvc-msg--bot {
  align-self: flex-start;
  background: var(--pvc-paper);
  border: 1px solid var(--pvc-line);
  border-inline-start: 2px solid var(--pvc-gold);
}
.pvc-msg--user {
  align-self: flex-end;
  background: var(--pvc-green);
  color: var(--pvc-cream);
}
.pvc-h {
  margin: 2px 0 6px;
  font: 600 1.12rem/1.2 var(--pvc-serif);
  color: var(--pvc-text);
}
.pvc-strong {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pvc-gold-deep);
  margin-top: 8px !important;
}
.pvc[dir='rtl'] .pvc-strong {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.9rem;
}
.pvc-ul,
.pvc-links,
.pvc-cars {
  margin: 0 0 8px;
  padding-inline-start: 18px;
}
.pvc-ul li {
  margin: 2px 0;
}
.pvc-links {
  list-style: none;
  padding: 0;
}
.pvc-links li {
  margin: 4px 0;
}
.pvc-links a,
.pvc-cars a,
.pvc-help a {
  color: var(--pvc-gold-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.pvc-links a::before {
  content: '→ ';
  text-decoration: none;
  display: inline-block;
  margin-inline-end: 2px;
}
.pvc[dir='rtl'] .pvc-links a::before {
  content: '← ';
}
.pvc-cars {
  list-style: none;
  padding: 0;
}
.pvc-cars li {
  display: grid;
  gap: 1px;
  padding: 7px 0;
  border-bottom: 1px solid var(--pvc-line);
}
.pvc-cars span {
  font-size: 0.82rem;
  color: var(--pvc-muted);
}
.pvc-note {
  font-size: 0.78rem;
  color: var(--pvc-muted);
  font-style: italic;
}
.pvc-warn {
  padding: 8px 10px;
  background: #f4e7d8;
  border-inline-start: 3px solid #8c3b1f;
  font-size: 0.86rem;
}

/* ——— Suggestions et boutons ——— */
.pvc-chips,
.pvc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pvc-actions {
  margin-top: 8px;
}
.pvc-chip,
.pvc-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--pvc-gold-deep);
  background: transparent;
  color: var(--pvc-text);
  font: 600 0.8rem/1.2 var(--pvc-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.pvc-chip:hover,
.pvc-btn:hover {
  background: var(--pvc-ink);
  color: var(--pvc-cream);
}
.pvc-btn--primary {
  background: var(--pvc-green);
  border-color: var(--pvc-green);
  color: var(--pvc-cream);
}
.pvc-btn--primary:hover {
  background: var(--pvc-green-hover);
}
.pvc-btn--primary:disabled {
  opacity: 0.6;
  cursor: progress;
}
.pvc-btn--wa::before {
  content: '';
  width: 14px;
  height: 14px;
  margin-inline-end: 6px;
  border-radius: 50%;
  background: #25d366;
  flex: none;
}

/* ——— Saisie ——— */
.pvc-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  background: var(--pvc-paper);
  border-top: 1px solid var(--pvc-line);
}
.pvc-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 12px;
  border: 1px solid var(--pvc-grey);
  background: #fff;
  color: var(--pvc-text);
  font: 16px/1.4 var(--pvc-sans); /* 16 px : pas de zoom automatique sur iPhone */
  resize: none;
}
.pvc-send {
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  background: var(--pvc-green);
  cursor: pointer;
}
.pvc-send:hover {
  background: var(--pvc-green-hover);
}
.pvc-send__icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: auto;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3ede2' stroke-width='1.6'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E");
}
.pvc[dir='rtl'] .pvc-send__icon {
  transform: scaleX(-1);
}

/* ——— Formulaires du chat ——— */
.pvc-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--pvc-line);
}
.pvc-form__title {
  font: 600 1.05rem/1.2 var(--pvc-serif) !important;
  margin: 0 !important;
}
.pvc-field {
  display: grid;
  gap: 4px;
}
.pvc-field label {
  font-size: 0.78rem;
  font-weight: 700;
}
.pvc-field input,
.pvc-field select,
.pvc-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--pvc-grey);
  background: #fff;
  color: var(--pvc-text);
  font: 16px/1.35 var(--pvc-sans);
}
.pvc-field input[type='file'] {
  padding: 8px;
  font-size: 0.85rem;
}
.pvc-field [aria-invalid='true'] {
  border-color: #8c3b1f;
}
.pvc-req {
  color: #8c3b1f;
}
.pvc-help {
  margin: 0 !important;
  font-size: 0.76rem;
  color: var(--pvc-muted);
}
.pvc-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.8rem;
}
.pvc-check input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex: none;
  accent-color: var(--pvc-green);
}
.pvc-status {
  font-size: 0.82rem;
  color: #8c3b1f;
  margin: 0 !important;
}
.pvc-status:empty {
  display: none;
}
.pvc-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.pvc-done {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--pvc-green);
  background: #e8efe9;
}

/* ——— Indicateur de saisie ——— */
.pvc-typing {
  display: flex;
  gap: 4px;
  padding: 14px;
}
.pvc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pvc-gold-deep);
  opacity: 0.4;
}
@media (prefers-reduced-motion: no-preference) {
  .pvc-typing span {
    animation: pvc-dot 1s infinite ease-in-out;
  }
  .pvc-typing span:nth-child(2) {
    animation-delay: 0.15s;
  }
  .pvc-typing span:nth-child(3) {
    animation-delay: 0.3s;
  }
  @keyframes pvc-dot {
    50% {
      opacity: 1;
    }
  }
}
@media print {
  .pvc {
    display: none !important;
  }
}

/* Badge « Netlify » du plan gratuit (coin inférieur droit sur ordinateur, voir global.css) : le widget passe au-dessus. */
@media (min-width: 1200px) {
  html.has-nl-badge .pvc {
    --pvc-bottom: calc(env(safe-area-inset-bottom, 0px) + 82px);
  }
}
