@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Charte Graphique */
  --navy: #004080;
  --navy-dark: #002b5e;
  --orange: #f07800;
  --orange-hover: #e06c00;
  --orange-light: #fff4eb;
  
  /* Couleurs UI */
  --bg-page: #F3F6F9;
  --bg-card: #ffffff;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --error: #ef4444;
  --success: #10b981;
  
  /* Variables de structure */
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(0, 64, 128, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 64, 128, 0.08);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pc14-wrapper, #pc14-wrapper * {
  box-sizing: border-box;
}

#pc14-wrapper {
  background-color: transparent;
  font-family: 'Poppins', sans-serif;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  margin: 20px 0;
}

/* ── Container Principal ── */
#pc14-app {
  width: 100%;
  max-width: 900px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 600px;
  position: relative;
}

/* ── Stepper Minimaliste ── */
.stepper-wrapper {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}

.step-dot.completed {
  background: var(--orange);
}

.step-dot.active {
  background: var(--navy);
  width: 28px;
  border-radius: 6px;
}

/* ── Panels / Étapes ── */
.panel {
  display: none;
  flex: 1;
  flex-direction: column;
}

.panel.active {
  display: flex;
  animation: slideUpFade 0.5s ease forwards;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Étape 1 : Storytelling ── */
.story-container {
  display: flex;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.story-slide {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.story-slide.active {
  opacity: 1;
  visibility: visible;
  position: relative; /* Pour que le conteneur prenne la hauteur */
}

.slide-visual {
  flex: 1;
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#pc14-wrapper .slide-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  margin: 0;
}

.slide-content {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
}

.slide-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
  display: inline-block;
}

.slide-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 20px;
}

.slide-title em {
  color: var(--orange);
  font-style: normal;
}

.slide-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
}

.slide-desc strong {
  color: var(--text-main);
  font-weight: 600;
}

.slide-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 40px;
}

.slide-dots {
  display: flex;
  gap: 8px;
}

.s-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.s-dot.active {
  background: var(--orange);
  width: 24px;
  border-radius: 4px;
}

.slide-nav-btns {
  display: flex;
  gap: 12px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 20px;
  font-weight: bold;
}

.btn-icon:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-2px);
}

.btn-icon.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-primary {
  background: var(--orange);
  color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(240, 120, 0, 0.2);
}

.btn-primary:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(240, 120, 0, 0.3);
}

/* ── Formulaire (Étapes 2 à 4) ── */
.form-panel-body {
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.step-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.step-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--orange);
}

.form-header-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 8px;
}

.form-header-title em {
  color: var(--orange);
  font-style: normal;
}

.form-header-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Grilles & Cartes */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.selection-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selection-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.selection-card.selected {
  border-color: var(--orange);
  background: var(--orange-light);
}

.selection-card.selected::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 16px;
  width: 20px;
  height: 20px;
  background: var(--orange) url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><polyline points="20 6 9 17 4 12"></polyline></svg>') no-repeat center;
  background-size: 12px;
  border-radius: 50%;
}

.card-icon { font-size: 24px; margin-bottom: 4px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.grid-col-full { grid-column: 1 / -1; }

/* Dispos */
.dispo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.dispo-card:hover { border-color: #cbd5e1; }
.dispo-card.selected {
  border-color: var(--navy);
  background: rgba(0, 64, 128, 0.03);
  color: var(--navy);
}

.checkbox-circle {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.dispo-card.selected .checkbox-circle {
  border-color: var(--navy);
  background: var(--navy);
}
.dispo-card.selected .checkbox-circle::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

/* Form Fields */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.input-label {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--navy) !important;
  margin: 0 0 6px 0 !important;
  display: block !important;
}

/* Forcer les styles contre les thèmes WordPress invasifs */
.input-field {
  padding: 14px 16px !important;
  border: 2px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  font-family: 'Poppins', sans-serif !important;
  font-size: 14px !important;
  color: var(--text-main) !important;
  background: #f8fafc !important;
  transition: var(--transition) !important;
  outline: none !important;
  width: 100% !important;
  box-shadow: none !important;
  margin: 0 !important;
  line-height: 1.5 !important;
  min-height: auto !important;
}

.input-field:focus {
  background: white !important;
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 4px rgba(240, 120, 0, 0.1) !important;
}

.input-field::placeholder { color: #94a3b8; }

.input-field.error { border-color: var(--error) !important; background: #fef2f2 !important; }

/* Autocomplétion OSM */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 999;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.suggestion-item {
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-page);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--bg-page); color: var(--navy); }

/* Section Titres Internes */
.section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Pills */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 30px;
  background: white;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.pill:hover { border-color: var(--navy); color: var(--navy); }
.pill.selected { background: var(--navy); border-color: var(--navy); color: white; }

/* Recap */
.recap-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recap-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: start;
}

.recap-lbl {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.recap-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
}

.recap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.r-tag {
  background: var(--orange-light);
  color: var(--orange-dark);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

/* Textarea & RGPD */
.motiv-textarea {
  min-height: 120px;
  resize: vertical;
}

.rgpd-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 24px;
}

.rgpd-box:hover { background: #f1f5f9; }
.rgpd-box.checked { background: var(--orange-light); border-color: #fbd38d; }

.rgpd-cb {
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  margin-top: 2px;
}

.rgpd-box.checked .rgpd-cb {
  background: var(--orange);
  border-color: var(--orange);
}

.rgpd-box.checked .rgpd-cb::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.rgpd-text {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.6;
}

/* Nav Actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 32px;
}

.btn-secondary {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 0;
  transition: var(--transition);
}

.btn-secondary:hover { color: var(--navy); }

.error-msg {
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
  display: none;
  margin-top: 16px;
  padding: 12px;
  background: #fef2f2;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--error);
}

/* ── Succès ── */
.success-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  flex: 1;
  background: var(--navy);
  color: white;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  animation: scaleBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleBounce {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.success-title { font-size: 32px; font-weight: 800; margin-bottom: 16px; color: #f07800; }
.success-desc { font-size: 16px; line-height: 1.6; max-width: 400px; opacity: 0.9; }

/* ── Popup ── */
#pc14-popup-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30, 41, 59, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

#pc14-popup-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 450px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: scaleBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#pc14-popup-box h3 { font-size: 22px; font-weight: 700; color: var(--navy); margin: 0 0 12px 0; }
#pc14-popup-box p { font-size: 15px; color: var(--text-muted); line-height: 1.6; margin: 0 0 24px 0; }

#pc14-popup-box .btn-primary {
  display: block;
  width: 100%;
  text-decoration: none;
}

#pc14-popup-box .btn-secondary { margin-top: 8px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #pc14-wrapper { padding: 0; margin: 0; background: var(--bg-card); align-items: flex-start; }
  #pc14-app { border-radius: 0; min-height: 100vh; max-width: 100%; box-shadow: none; }
  
  .story-slide { flex-direction: column; }
  .slide-visual { flex: 0 0 220px; }
  .slide-content { padding: 32px 24px; }
  .slide-title { font-size: 26px; }
  
  .form-panel-body { padding: 32px 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .recap-row { grid-template-columns: 1fr; gap: 4px; margin-bottom: 12px; }
}

/* ── Overrides Thème ── */
#pc14-wrapper h2::after {
  display: none !important;
}
