/* ── WIDGET CONTACT FLOTTANT ── */

:root {
  --wgt-accent: #FF5C28;
  --wgt-accent-dark: #E04A1E;
  --wgt-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --wgt-radius: 16px;
  --wgt-shadow: 0 8px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.08);
}

/* ── FLOATING BUTTON ── */
#wgt-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wgt-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(255,92,40,.40);
  z-index: 9998;
  transition: transform 200ms ease, background 200ms ease, box-shadow 200ms ease;
  outline: none;
  overflow: hidden;
}

#wgt-btn:hover {
  transform: scale(1.05);
  background: var(--wgt-accent-dark);
  box-shadow: 0 6px 24px rgba(255,92,40,.55);
}

#wgt-btn:active {
  transform: scale(0.96);
}

.wgt-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 220ms ease, transform 220ms ease;
}

.wgt-icon-chat  { opacity: 1; transform: scale(1) rotate(0deg); }
.wgt-icon-close { opacity: 0; transform: scale(0.7) rotate(-90deg); }

#wgt-btn.is-open .wgt-icon-chat  { opacity: 0; transform: scale(0.7) rotate(90deg); }
#wgt-btn.is-open .wgt-icon-close { opacity: 1; transform: scale(1) rotate(0deg); }

@keyframes wgt-pulse {
  0%   { box-shadow: 0 4px 20px rgba(255,92,40,.40); }
  40%  { box-shadow: 0 4px 20px rgba(255,92,40,.40), 0 0 0 10px rgba(255,92,40,.15); }
  80%  { box-shadow: 0 4px 20px rgba(255,92,40,.40), 0 0 0 18px rgba(255,92,40,.0); }
  100% { box-shadow: 0 4px 20px rgba(255,92,40,.40); }
}

#wgt-btn.pulsing {
  animation: wgt-pulse 1.3s ease-out;
}

/* ── POPUP ── */
#wgt-popup {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  background: #fff;
  border-radius: var(--wgt-radius);
  box-shadow: var(--wgt-shadow);
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: var(--wgt-font);
  transform-origin: bottom right;
  -webkit-font-smoothing: antialiased;
}

#wgt-popup[hidden] {
  display: none !important;
}

@keyframes wgt-in {
  from { opacity: 0; transform: scale(0.88) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@keyframes wgt-out {
  from { opacity: 1; transform: scale(1)    translateY(0); }
  to   { opacity: 0; transform: scale(0.90) translateY(8px); }
}

#wgt-popup.wgt-entering { animation: wgt-in  260ms cubic-bezier(0.34,1.4,0.64,1) forwards; }
#wgt-popup.wgt-leaving  { animation: wgt-out 180ms ease forwards; }

/* ── SCREENS CONTAINER ── */
.wgt-screens {
  position: relative;
  height: 450px;
  overflow: hidden;
}

.wgt-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  transform: translateX(100%);
  will-change: transform;
}

.wgt-screen.wgt-active {
  transform: translateX(0);
}

/* ── HEADER ── */
.wgt-header {
  background: var(--wgt-accent);
  padding: 16px 16px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 10px;
}

.wgt-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.wgt-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wgt-header-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 3px;
}

.wgt-header-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,.75);
  margin-bottom: 6px;
  line-height: 1.3;
}

.wgt-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,.85);
  font-weight: 500;
}

.wgt-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(74,222,128,.3);
}

.wgt-close-btn {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms;
  outline: none;
}

.wgt-close-btn:hover { background: rgba(255,255,255,.32); }

/* ── SUBHEADER ── */
.wgt-subheader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0eeec;
  flex-shrink: 0;
  background: #fff;
}

.wgt-back-btn {
  background: none;
  border: 1.5px solid #e5e5e5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  transition: background 150ms, border-color 150ms;
  outline: none;
  flex-shrink: 0;
}

.wgt-back-btn:hover { background: #f5f5f5; border-color: #ccc; }

.wgt-subheader-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111;
}

/* ── BODY ── */
.wgt-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── CARDS (Screen 1) ── */
.wgt-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f7f6f5;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  padding: 13px 13px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
  text-align: left;
  outline: none;
  font-family: var(--wgt-font);
}

.wgt-card:last-child { margin-bottom: 0; }

.wgt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  background: #fff;
}

.wgt-card:active { transform: translateY(0); }

.wgt-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wgt-card-icon--green  { background: #dcfce7; color: #16a34a; }
.wgt-card-icon--orange { background: #fff7ed; color: #ea580c; }
.wgt-card-icon--purple { background: #ede9fe; color: #7c3aed; }

.wgt-card-text { flex: 1; min-width: 0; }

.wgt-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #111;
  margin-bottom: 2px;
}

.wgt-card-sub { font-size: 11.5px; color: #888; }

.wgt-card-arrow { font-size: 20px; color: #ccc; flex-shrink: 0; line-height: 1; }

/* ── FOOTER (Screen 1) ── */
.wgt-footer {
  padding: 10px 14px;
  text-align: center;
  font-size: 10.5px;
  color: #bbb;
  border-top: 1px solid #f0eeec;
  flex-shrink: 0;
  font-family: var(--wgt-font);
}

/* ── FORMS ── */
.wgt-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.wgt-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.wgt-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wgt-label {
  font-size: 10px;
  font-weight: 700;
  color: #444;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-family: var(--wgt-font);
}

.wgt-input {
  padding: 10px 13px;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--wgt-font);
  color: #111;
  background: #fff;
  outline: none;
  transition: border-color 150ms;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.wgt-input::placeholder { color: #bbb; }
.wgt-input:focus { border-color: var(--wgt-accent); }

.wgt-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.wgt-honeypot { display: none; }

/* Tel row: input + round send button */
.wgt-tel-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wgt-tel-row .wgt-input { flex: 1; }

.wgt-submit-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wgt-accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms, transform 150ms;
  outline: none;
  box-shadow: 0 3px 10px rgba(255,92,40,.35);
}

.wgt-submit-round:hover { background: var(--wgt-accent-dark); transform: scale(1.05); }
.wgt-submit-round:active { transform: scale(0.97); }

.wgt-submit-full {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--wgt-font);
  border: none;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
  outline: none;
  margin-top: 2px;
  letter-spacing: -.01em;
}

.wgt-submit-full:hover { background: #2a2a2a; transform: translateY(-1px); }
.wgt-submit-full:active { transform: translateY(0); }

/* ── CONFIRMATION ── */
.wgt-confirm-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.wgt-confirm-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(34,197,94,.35);
}

.wgt-confirm-title {
  font-size: 22px;
  font-weight: 800;
  color: #111;
  letter-spacing: -.02em;
}

.wgt-confirm-text {
  font-size: 14px;
  color: #777;
  line-height: 1.5;
}

.wgt-confirm-close-btn {
  margin-top: 6px;
  padding: 9px 22px;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 13px;
  font-family: var(--wgt-font);
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
  outline: none;
}

.wgt-confirm-close-btn:hover { border-color: #aaa; color: #111; }

/* ── SCREEN 3 : RDV sans formulaire ── */
.wgt-rdv-body {
  display: flex;
  flex-direction: column;
}

.wgt-rdv-text {
  font-size: 14px;
  color: #222;
  line-height: 1.65;
  margin-bottom: 10px;
}

.wgt-rdv-text-sm {
  font-size: 12.5px;
  color: #888;
  line-height: 1.55;
  margin-bottom: 22px;
}

.wgt-rdv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--wgt-font);
  border: none;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
  outline: none;
  letter-spacing: -.01em;
}

.wgt-rdv-btn:hover { background: #2a2a2a; transform: translateY(-1px); }
.wgt-rdv-btn:active { transform: translateY(0); }

.wgt-rdv-btn-icon {
  display: flex;
  align-items: center;
  opacity: .85;
}

/* ── MOBILE ── */
@media (max-width: 767px) {
  #wgt-popup {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    transform-origin: bottom center;
  }

  .wgt-screens {
    height: min(450px, calc(80svh - 0px));
  }

  #wgt-btn {
    bottom: 20px;
    right: 20px;
  }
}
