/* ============================================================
   Honore Gallery — Widget signup + questionnaire
   À charger sur toutes les pages du site
   Couleurs alignées sur le site (crème / rouge) + mode sombre auto
   ============================================================ */

:root {
  --hng-surface: #faf9f5;        /* fond du modal / champs */
  --hng-surface-2: #ece9df;      /* fond secondaire (consentements) */
  --hng-ink: #1f1e1d;            /* texte principal */
  --hng-soft: rgba(31, 30, 29, 0.6);
  --hng-muted: rgba(31, 30, 29, 0.42);
  --hng-line: rgba(31, 30, 29, 0.18);
  --hng-line-soft: rgba(31, 30, 29, 0.08);
  --hng-accent: #c0392b;         /* rouge */
  --hng-accent-deep: #9e2c20;
  --hng-accent-soft: rgba(192, 57, 43, 0.1);
  --hng-fab-bg: #c0392b;         /* bouton flottant "?" */
  --hng-backdrop: rgba(20, 19, 17, 0.62);
  --hng-on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hng-surface: #211f1b;
    --hng-surface-2: #191713;
    --hng-ink: #ece8df;
    --hng-soft: rgba(236, 232, 223, 0.62);
    --hng-muted: rgba(236, 232, 223, 0.42);
    --hng-line: rgba(236, 232, 223, 0.2);
    --hng-line-soft: rgba(236, 232, 223, 0.12);
    --hng-accent: #e0564a;
    --hng-accent-deep: #c0392b;
    --hng-accent-soft: rgba(224, 86, 74, 0.16);
    --hng-fab-bg: #e0564a;
    --hng-backdrop: rgba(0, 0, 0, 0.66);
  }
}

/* Reset minimal pour éviter conflits avec le site */
.hng-widget *,
.hng-widget *::before,
.hng-widget *::after {
  box-sizing: border-box;
}

/* ---------- BOUTON FLOTTANT "?" ---------- */
.hng-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--hng-fab-bg);
  color: var(--hng-on-accent);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  z-index: 99998;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 220ms ease;
  display: grid;
  place-items: center;
}

.hng-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.hng-fab[hidden] {
  display: none;
}

.hng-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hng-accent);
  color: var(--hng-on-accent);
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid var(--hng-surface);
}

/* ---------- BACKDROP ---------- */
.hng-backdrop {
  position: fixed;
  inset: 0;
  background: var(--hng-backdrop);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}

.hng-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- MODAL ---------- */
.hng-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--hng-surface);
  border-radius: 22px;
  padding: 40px 36px 32px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
  transform: translateY(20px) scale(0.98);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--hng-ink);
}

.hng-backdrop.open .hng-modal {
  transform: translateY(0) scale(1);
}

.hng-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--hng-muted);
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: background 180ms ease, color 180ms ease;
}

.hng-close:hover {
  background: var(--hng-line-soft);
  color: var(--hng-ink);
}

/* ---------- TYPOGRAPHIE ---------- */
.hng-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hng-muted);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 10px;
}

.hng-eyebrow::before {
  content: "";
  display: block;
  width: 18px;
  height: 1px;
  background: var(--hng-line);
}

.hng-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.15;
  color: var(--hng-ink);
}

.hng-subtitle {
  color: var(--hng-soft);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 24px;
}

/* ---------- CHAMPS DE FORMULAIRE ---------- */
.hng-field {
  margin-bottom: 14px;
}

.hng-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--hng-soft);
  margin-bottom: 6px;
}

.hng-input,
.hng-select,
.hng-textarea {
  width: 100%;
  border: 1px solid var(--hng-line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--hng-surface);
  color: var(--hng-ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.hng-input:focus,
.hng-select:focus,
.hng-textarea:focus {
  border-color: var(--hng-accent);
  box-shadow: 0 0 0 3px var(--hng-accent-soft);
}

.hng-textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.hng-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ---------- CONSENTEMENTS ---------- */
.hng-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--hng-line-soft);
  border-radius: 10px;
  background: var(--hng-surface-2);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 180ms ease;
}

.hng-consent.checked {
  border-color: var(--hng-accent);
  background: var(--hng-accent-soft);
}

.hng-consent input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--hng-accent);
  cursor: pointer;
}

.hng-consent-text {
  font-size: 12px;
  line-height: 1.45;
  color: var(--hng-soft);
}

.hng-consent-text strong {
  color: var(--hng-ink);
  font-weight: 600;
}

/* ---------- BOUTONS ---------- */
.hng-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.hng-btn-primary {
  width: 100%;
  background: var(--hng-accent);
  color: var(--hng-on-accent);
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.hng-btn-primary:hover:not(:disabled) {
  background: var(--hng-accent-deep);
}

.hng-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hng-btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--hng-soft);
  border: 1px solid var(--hng-line);
  border-radius: 999px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease;
}

.hng-btn-secondary:hover {
  border-color: var(--hng-accent);
  color: var(--hng-ink);
}

/* ---------- PROGRESSION QUESTIONNAIRE ---------- */
.hng-progress {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--hng-line-soft);
  margin: 8px 0 4px;
  overflow: hidden;
}

.hng-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--hng-accent), var(--hng-accent-deep));
  transition: width 600ms ease;
  border-radius: 999px;
}

.hng-progress-label {
  font-size: 12px;
  color: var(--hng-soft);
  margin-bottom: 18px;
}

/* ---------- CHECKBOXES MULTI ---------- */
.hng-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hng-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--hng-line);
  border-radius: 999px;
  background: var(--hng-surface);
  font-size: 13px;
  cursor: pointer;
  transition: all 180ms ease;
}

.hng-checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--hng-accent);
}

.hng-checkbox:hover {
  border-color: var(--hng-accent);
}

.hng-checkbox.checked {
  border-color: var(--hng-accent);
  background: var(--hng-accent-soft);
  color: var(--hng-ink);
}

/* ---------- FOOTER RGPD ---------- */
.hng-rgpd {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hng-line-soft);
  font-size: 11px;
  line-height: 1.5;
  color: var(--hng-muted);
}

/* ---------- ÉCRAN DE SUCCÈS ---------- */
.hng-success {
  text-align: center;
  padding: 8px 0;
}

.hng-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.12);
  color: #2a9047;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
}

/* ---------- ERREUR ---------- */
.hng-error {
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid rgba(255, 59, 48, 0.32);
  border-radius: 10px;
  background: rgba(255, 59, 48, 0.06);
  color: #b8362b;
  font-size: 13px;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 540px) {
  .hng-modal {
    padding: 32px 22px 24px;
    border-radius: 18px;
  }
  .hng-title {
    font-size: 26px;
  }
  .hng-row {
    grid-template-columns: 1fr;
  }
  .hng-fab {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hng-backdrop,
  .hng-modal,
  .hng-fab,
  .hng-progress-bar {
    transition: none;
  }
}
