:root {
  --pink: #d94a7a;
  --pink-dark: #b13760;
  --pink-light: #fbeef2;
  --cream: #fffaf3;
  --gold: #d9a441;
  --text: #3a2c2c;
  --text-muted: #7a6a6a;
  --border: #efe1e1;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(60, 30, 40, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #fff5f8 0%, #fdf7ef 100%);
  color: var(--text);
  overflow-x: hidden;
}

.site-header {
  text-align: center;
  padding: 28px 16px 18px;
}
.brand { font-size: 1.9rem; font-weight: 700; color: var(--pink-dark); }
.brand-icon { margin-right: 8px; }
.brand-tagline { color: var(--text-muted); margin: 4px 0 0; font-size: 0.95rem; }

.wizard-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 60px;
  align-items: start;
}

@media (max-width: 880px) {
  .wizard-layout { grid-template-columns: 1fr; gap: 18px; }
  .preview-panel { order: -1; }
  .preview-sticky { position: static; }
}

@media (max-width: 640px) {
  .wizard-layout { padding: 0 14px 40px; }
  .site-header { padding: 20px 14px 12px; }
  .brand { font-size: 1.55rem; }
  .brand-tagline { font-size: 0.85rem; }
  .wizard-panel { padding: 16px; min-height: 0; }
  .preview-sticky { padding: 16px; }
  .step-title { font-size: 1.12rem; }
  .progress-bar li { font-size: 0.66rem; min-width: 56px; padding-bottom: 8px; }
  .option-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .option-card { padding: 12px 8px; }
  .wizard-nav { flex-direction: column-reverse; gap: 10px; }
  .wizard-nav .btn { width: 100%; }
  .modal { padding: 26px 20px; }
}

.wizard-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.progress-bar {
  display: flex;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  gap: 4px;
  flex-wrap: wrap;
}
.progress-bar li {
  flex: 1;
  min-width: 70px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 4px solid var(--border);
  transition: all 0.25s ease;
}
.progress-bar li.active { color: var(--pink-dark); font-weight: 700; border-color: var(--pink); }
.progress-bar li.done { color: var(--gold); border-color: var(--gold); }

.step-content { flex: 1; }
.step-title { font-size: 1.3rem; margin: 0 0 4px; color: var(--pink-dark); }
.step-subtitle { color: var(--text-muted); margin: 0 0 20px; font-size: 0.92rem; }

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.option-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  background: var(--cream);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  user-select: none;
}
.option-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.option-card.selected { border-color: var(--pink); background: var(--pink-light); }
.option-card .swatch {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08);
}
.option-card .option-label { font-size: 0.85rem; font-weight: 600; }
.option-card .option-check {
  font-size: 0.75rem; color: var(--pink-dark); font-weight: 700; min-height: 1em;
}

.field-group { margin-bottom: 18px; }
.field-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.field-group input,
.field-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px; /* >=16px evite le zoom automatique sur iOS Safari au focus */
  font-family: inherit;
}
.field-group input:focus,
.field-group textarea:focus { outline: none; border-color: var(--pink); }
.field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.honeypot-field { position: absolute; left: -9999px; top: -9999px; }

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 13px 22px;
  min-height: 44px; /* taille de cible tactile confortable */
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: var(--pink-dark); }
.btn-primary:disabled { background: #e6b9c8; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 2px solid var(--border); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.error-box {
  background: #fdeaea;
  border: 1px solid #f3b7b7;
  color: #a83232;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

/* ---- Preview panel ---- */
.preview-panel { position: relative; }
.preview-sticky {
  position: sticky;
  top: 20px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.preview-title { font-size: 1.05rem; margin: 0 0 16px; color: var(--pink-dark); text-align: center; }

.preview-visual {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-placeholder {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
}
.placeholder-icon { font-size: 2.6rem; margin-bottom: 10px; }
.preview-placeholder p { margin: 0; font-size: 0.88rem; line-height: 1.4; }

.preview-loader {
  text-align: center;
  padding: 40px 10px;
}
.loader-spinner-lg {
  width: 42px; height: 42px;
  margin: 0 auto 16px;
  border: 4px solid var(--pink-light);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loader-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.loader-text span { font-size: 0.78rem; opacity: 0.8; }

.ai-preview-actions {
  margin-top: 16px;
  text-align: center;
}
.btn-ai {
  background: linear-gradient(135deg, var(--gold), var(--pink));
  color: #fff;
  width: 100%;
}
.btn-ai:disabled {
  background: #e9e0e0;
  color: #a89a9a;
  cursor: not-allowed;
}
.btn-small { padding: 8px 16px; min-height: 38px; font-size: 0.82rem; }
.ai-preview-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 8px 0 0;
}
.ai-preview-error { margin-top: 10px; text-align: left; }

.ai-preview-result {
  margin-top: 16px;
  text-align: center;
}
.ai-preview-img {
  width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.recap-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
}
.recap-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  color: var(--text-muted);
}
.recap-list li span:last-child { color: var(--text); font-weight: 600; text-align: right; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30, 15, 20, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-overlay.visible { display: flex; }
.modal {
  background: #fff;
  border-radius: 18px;
  padding: 32px 28px;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-icon { font-size: 2.6rem; margin-bottom: 10px; }
.modal h3 { margin: 0 0 10px; color: var(--pink-dark); }
.modal p { color: var(--text-muted); margin: 0 0 22px; font-size: 0.92rem; }

.loading { color: var(--text-muted); text-align: center; padding: 60px 0; }
