@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800&family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=UnifrakturMaguntia&display=swap');

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #ffffff;
  --black: #1a1a1a;
  --accent: #c9aa71;
  --border: #e8e8e8;
  --muted: #888888;
  --bg-soft: #f8f8f6;
  --success: #2AD783;
  --warning: #f59e0b;
  --font-main: 'Montserrat', sans-serif;
  --font-serif: 'Cormorant Garamond', serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === PROGRESS BAR === */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 1000;
}

#progress-fill {
  height: 100%;
  background: var(--black);
  width: 7.69%; /* 1/13 */
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === STEP CONTAINER === */
#app {
  min-height: 100vh;
  padding-top: 3px;
}

.step {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeInUp 0.4s ease both;
}

.step.active {
  display: flex;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes archiveSlide {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* === STEP HEADER === */
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  top: 3px;
  z-index: 100;
}

.step-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.step-logo {
  height: 36px;
  width: auto;
}

.step-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
}

.step-commune {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--black);
}

/* === STEP BODY === */
.step-body {
  flex: 1;
  padding: 48px 32px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.step-body.wide {
  max-width: 100%;
  padding: 0;
}

/* === STEP FOOTER === */
.step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-top: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  bottom: 0;
  z-index: 100;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--black);
  color: var(--white);
}

.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

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

.btn-accent {
  background: var(--accent);
  color: var(--black);
}

.btn-accent:hover { opacity: 0.85; }

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { font-family: var(--font-main); }

.title-xl {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.title-lg {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
}

.title-md {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.5px;
  line-height: 1.6;
  margin-bottom: 32px;
}

.citation {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--muted);
  line-height: 1.6;
  margin: 24px 0 40px;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
}

.label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}

/* === INPUTS === */
.input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.input {
  width: 100%;
  padding: 16px 20px;
  font-family: var(--font-main);
  font-size: 15px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.input:focus { border-color: var(--black); }
.input::placeholder { color: #ccc; }

/* === AUTOCOMPLETE DROPDOWN === */
#commune-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--black);
  border-top: none;
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

#commune-results.open { display: block; }

.commune-item {
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.commune-item:last-child { border-bottom: none; }
.commune-item:hover { background: var(--bg-soft); }

.commune-item-name {
  font-size: 14px;
  font-weight: 600;
}

.commune-item-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* === COMMUNE BADGE === */
#commune-badge {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  animation: fadeIn 0.3s ease;
}

#commune-badge.show { display: flex; }

.badge-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
}

.badge-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
}

.badge-icon {
  font-size: 24px;
}

/* === BOUTON PASSER === */
.btn-skip {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-skip:hover { border-color: var(--black); color: var(--black); }

/* === STEP 2 — ARCHIVES === */

/* Fond Cassini semi-transparent derrière l'animation */
.s2-cassini-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.archives-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  background: rgba(255,255,255,0.72); /* transparent pour laisser voir Cassini */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
}

/* ── Horloge ancienne Step 2 ──────────────────────────────────────────────── */
.s2-clock {
  width: 140px;
  height: 140px;
  margin: 0 auto 32px;
  filter: drop-shadow(0 3px 12px rgba(0,0,0,0.18));
}

.s2-clock-svg {
  width: 100%;
  height: 100%;
}

.s2-roman {
  font-family: 'UnifrakturMaguntia', cursive;
  font-size: 11px;
  fill: #1a1a1a;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Aiguille des heures — 1 tour en 12h (43200s) */
.s2-hand-h {
  transform-origin: 60px 60px;
  animation: clockHour 43200s linear infinite;
}

/* Aiguille des minutes — 1 tour en 60min (3600s) */
.s2-hand-m {
  transform-origin: 60px 60px;
  animation: clockMinute 3600s linear infinite;
}

/* Trotteuse — 1 tour en 60s */
.s2-hand-s {
  transform-origin: 60px 60px;
  animation: clockSecond 60s steps(60, end) infinite;
}

@keyframes clockHour   { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }
@keyframes clockMinute { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }
@keyframes clockSecond { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }

.archives-commune-name {
  font-size: clamp(32px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 48px;
  color: var(--black);
}

.archives-list {
  width: 100%;
  max-width: 560px;
  text-align: left;
  margin: 0 auto 32px;
  min-height: 240px;
}

.archive-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--muted);
  opacity: 0;
  border-bottom: 1px solid var(--border);
  animation: archiveSlide 0.3s ease forwards;
}

.archive-item .ar-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
}

.archives-counter {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 16px;
}

.archives-progress {
  width: 100%;
  max-width: 560px;
  height: 2px;
  background: var(--border);
  margin: 0 auto;
}

.archives-progress-fill {
  height: 100%;
  background: var(--black);
  width: 0%;
  transition: width 0.3s ease;
}

/* === PHOTO GRID === */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.tab-desc {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: none;
  color: var(--muted);
  opacity: 0.7;
}

.tab.active {
  color: var(--black);
  border-bottom-color: var(--black);
}

.tab.active .tab-desc {
  color: var(--black);
  opacity: 0.5;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 100px;
}

@media (max-width: 768px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

.photo-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-soft);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.photo-item:hover img { transform: scale(1.03); }

.photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-item:hover .photo-overlay { opacity: 1; }

.photo-filter-btn {
  padding: 5px 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.photo-filter-btn:hover { background: rgba(255,255,255,0.2); }

.photo-selected-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: var(--black);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.photo-item.selected {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.photo-item.selected.hero-pick {
  outline-color: var(--black);
  outline-width: 3px;
}

/* Label "★ Principale" sur la photo hero */
.photo-item.hero-pick::after {
  content: '★ Principale';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--black);
  color: var(--white);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  padding: 4px 0;
  z-index: 5;
}

.photo-source {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 2px 6px;
}

/* ── Step 3 — Panneau Briefing ──────────────────────────────────────────── */
.s3-briefing {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 32px;
  min-height: calc(100vh - 130px);
}

.s3-briefing-inner {
  max-width: 520px;
  width: 100%;
}

.s3-briefing-num {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.s3-briefing-title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.s3-briefing-text {
  font-size: 15px;
  color: #444;
  line-height: 1.7;
  margin-bottom: 28px;
}

.s3-briefing-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.s3-briefing-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 13px;
  color: var(--black);
  line-height: 1.5;
}

.s3-bstep-num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: 1.5px solid var(--black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

/* ── Step 3 — Sections galerie ──────────────────────────────────────────── */
.s3-section {
  padding: 0 32px;
  margin-bottom: 48px;
}

.s3-section-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--black);
}

.s3-section-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 3px;
}

.s3-section-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* ── Step 3 — Zone upload ───────────────────────────────────────────────── */
.s3-upload-zone {
  border: 2px dashed var(--border);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 16px;
}

.s3-upload-zone:hover {
  border-color: var(--black);
  background: var(--bg-soft);
}

.s3-upload-icon {
  font-size: 40px;
  font-weight: 200;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 12px;
}

.s3-upload-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
}

.s3-upload-hint {
  font-size: 11px;
  color: var(--muted);
}

/* ── Step 3 — Introduction émotionnelle ─────────────────────────────────── */
.photo-intro {
  padding: 0 32px 20px;
}

.photo-intro-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.2px;
  margin-bottom: 4px;
}

.photo-intro-sub {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-serif);
}

/* ── Suggestion éditoriale sous la grille ────────────────────────────────── */
.photo-suggestion {
  padding: 16px 32px 8px;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-serif);
  line-height: 1.6;
  letter-spacing: 0.2px;
}

/* ── Photo bar améliorée ─────────────────────────────────────────────────── */
.photo-bar-center {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-right: auto;
}

/* ── Feedback émotionnel dynamique ───────────────────────────────────────── */
.photo-feedback {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-serif);
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: 260px;
}

.photo-feedback-visible {
  opacity: 1;
}

/* ── Sélection améliorée — CSS uniquement ────────────────────────────────── */
.photo-item.selected {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(201,170,113,0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-item.hero-pick {
  outline: 3px solid var(--black);
  outline-offset: -3px;
  transform: scale(1.015);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.photo-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 200;
}

.photo-thumbs {
  display: flex;
  gap: 8px;
}

.photo-thumb {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border: 2px solid var(--border);
}

.photo-thumb.hero { border-color: var(--black); }

.photo-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-right: auto;
  transition: color 0.2s;
}

.photo-count.has-selection {
  color: var(--black);
}

/* Lien discret "Passer sans photo" */
.btn-text-link {
  background: none;
  border: none;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  transition: color 0.2s;
}

.btn-text-link:hover { color: var(--black); }

/* === STEP 4 — AFFINER === */
.two-col {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  min-height: calc(100vh - 200px);
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

.panel {
  padding: 32px;
  border-right: 1px solid var(--border);
}

.panel-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.panel-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin-bottom: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 32px;
}

.preset-btn {
  padding: 10px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.preset-btn:hover, .preset-btn.active {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

/* === SLIDERS === */
.slider-group {
  margin-bottom: 20px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.slider-val {
  color: var(--accent);
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  height: 2px;
  -webkit-appearance: none;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--black);
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--black);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* === PREVIEW PANEL === */
.preview-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  overflow: hidden;
}

.preview-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  transition: filter 0.3s ease;
}

/* === LAYOUTS STEPS 5 ET 6 === */
.step5-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.step6-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  flex: 1;
  min-height: calc(100vh - 130px);
}

@media (max-width: 900px) {
  .step5-layout,
  .step6-layout { grid-template-columns: 1fr; }
}

/* Logo Marianne discret sur step 8 */
.reveal-logo { opacity: 0.7; }

/* === STEP 5 — STYLE CARDS === */
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .style-grid { grid-template-columns: 1fr 1fr; }
}

.style-card {
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}

.style-card:hover {
  border-color: #999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* outline évite le layout shift causé par border: 3px */
.style-card.selected {
  border-color: var(--black);
  outline: 2px solid var(--black);
  outline-offset: -1px;
}

.style-card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: var(--black);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.style-swatch {
  height: 96px;
  width: 100%;
  position: relative;
}

/* Ligne blanche subtile pour différencier les swatches sombres */
.style-swatch::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.15);
}

.style-info {
  padding: 14px 16px 16px;
}

.style-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.style-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* === MINI PREVIEW === */
.mini-preview {
  border: 1px solid var(--border);
  height: 310px;
  overflow: hidden;
  position: relative;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.mini-nav {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
}

.mini-nav-text {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
}

/* Dots décoratifs dans la nav */
.mini-nav::before {
  content: '• • •';
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-left: auto;
  letter-spacing: 2px;
}

.mini-hero {
  height: 140px;
  display: flex;
  align-items: flex-end;
  padding: 12px 16px;
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Overlay gradient sur le hero */
.mini-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.55) 100%);
}

.mini-hero-text {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.mini-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px;
}

.mini-card {
  height: 44px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 1px;
}

/* === STEP 6 — EMBELLISSEMENT === */
.slider-hint {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: none;
  color: var(--muted);
}

.color-pastilles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pastille {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.pastille:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.pastille.selected {
  border: 3px solid var(--black);
  transform: scale(1.1);
}

.optim-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.optim-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.3px;
}

/* === VISION GENERATOR — local à Step 7 === */
.vision-generator {
  padding: 28px 32px 0;
  background: var(--white);
}

.vision-intro {
  margin-bottom: 20px;
}

.vision-intro-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.vision-intro-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.vision-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .vision-cards { grid-template-columns: 1fr; }
}

.vision-card {
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  overflow: hidden;
}

.vision-card:hover {
  border-color: #999;
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.vision-card.selected {
  border-color: var(--black);
  border-width: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

/* Mini preview dans chaque vision card */
.vision-preview {
  height: 160px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-soft);
}

.vp-nav {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  flex-shrink: 0;
}

.vp-nav-text {
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
}

.vp-hero {
  flex: 1;
  display: flex;
  align-items: flex-end;
  padding: 8px 10px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.vp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
}

.vp-hero-text {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

.vp-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px;
  background: #fff;
  flex-shrink: 0;
}

.vp-mini-card {
  height: 18px;
  background: var(--bg-soft);
  border-radius: 1px;
}

/* Texte sous la preview */
.vision-info {
  padding: 12px 14px 14px;
}

.vision-axe {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.vision-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 5px;
  line-height: 1.3;
}

.vision-phrase {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

/* Sélectionné : accent sur le nom */
.vision-card.selected .vision-axe {
  color: var(--black);
}

.vision-card.selected .vision-name {
  color: var(--black);
}

/* Séparateur entre visions et modules */
.vision-separator {
  text-align: center;
  margin: 0 0 24px;
  position: relative;
}

.vision-separator::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.vision-separator span {
  position: relative;
  background: var(--white);
  padding: 0 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* === STEP 7 — MODULES === */
.modules-header {
  position: sticky;
  top: 3px;
  background: var(--white);
  z-index: 50;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modules-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.modules-counter {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.modules-price-indicator {
  font-size: 11px;
  font-weight: 700;
  color: var(--black);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 5px 12px;
  letter-spacing: 0.5px;
}

.modules-body {
  padding: 32px;
}

.module-group {
  margin-bottom: 48px;
}

.module-group-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Badge premium intégré dans le titre — plus sobre qu'une étiquette séparée */
.module-group-badge {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
}

.module-group-premium .module-group-title {
  color: var(--black);
  border-bottom-color: var(--accent);
  border-bottom-width: 2px;
}

/* Grille plus aérée — max 3 colonnes, items plus lisibles */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.module-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
  position: relative;
}

.module-item:hover:not(.locked) {
  border-color: #bbb;
  background: var(--bg-soft);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.module-item.checked {
  border-color: var(--black);
  background: #fafafa;
}

.module-item.checked.premium {
  border-color: var(--accent);
  background: rgba(201,170,113,0.04);
}

/* Trait gauche accent sur les items premium cochés */
.module-item.checked.premium::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

/* Signal visuel discret pour les modules IA/patrimoine */
.module-item.ia::after {
  content: 'IA';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent);
  opacity: 0.7;
}

.module-item.locked {
  opacity: 0.5;
  cursor: default;
}

.module-checkbox {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1.5px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--white);
  transition: background 0.15s, border-color 0.15s;
  margin-top: 2px;
}

.module-item.checked .module-checkbox {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.module-item.checked.premium .module-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.module-item.checked .module-checkbox::after {
  content: '✓';
  font-size: 10px;
  font-weight: 800;
}

.module-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.module-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.module-item.ia .module-name {
  padding-right: 24px; /* espace pour le badge IA */
}

.module-desc {
  font-size: 11px;
  color: #666;
  line-height: 1.5;
  font-weight: 400;
  margin-top: 2px;
}

/* === STEP 8 — APERÇU === */

/* Header révélation */
.preview-reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  gap: 24px;
}

.reveal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.reveal-title {
  flex: 1;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reveal-label { color: var(--muted); }

.reveal-commune {
  font-weight: 700;
  color: var(--black);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Tabs — style CHANEL cohérent, sans emoji */
.device-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.device-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-main);
}

.device-tab:hover { border-color: #999; color: var(--black); }

.device-tab.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.device-tab svg { flex-shrink: 0; }

/* Frame wrap — fond sombre pour révélation */
.device-frame-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: #1a1a1a;
  min-height: calc(100vh - 230px);
  overflow-x: auto;
}

/* Casing commun */
.device-casing {
  background: var(--white);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  overflow: hidden;
  transition: width 0.35s ease, border-radius 0.35s ease;
  position: relative;
}

/* Desktop */
.device-casing.desktop {
  width: min(960px, 90vw);
  border-radius: 8px;
}

/* Tablette */
.device-casing.tablet {
  width: min(768px, 85vw);
  border-radius: 20px;
  border: 9px solid #111;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* Mobile */
.device-casing.mobile {
  width: min(375px, 75vw);
  border-radius: 44px;
  border: 11px solid #111;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* Barre du navigateur (desktop) */
.device-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 36px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}

.device-casing.tablet .device-topbar,
.device-casing.mobile .device-topbar {
  display: none;
}

.topbar-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.topbar-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
}

.topbar-dots span:nth-child(1) { background: #ff5f57; }
.topbar-dots span:nth-child(2) { background: #ffbd2e; }
.topbar-dots span:nth-child(3) { background: #28c840; }

.topbar-url {
  flex: 1;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 10px;
  color: #666;
  font-family: monospace;
  text-align: center;
  max-width: 300px;
  margin: 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Notch mobile */
.device-notch {
  display: none;
  height: 28px;
  background: #111;
  position: relative;
  z-index: 2;
}

.device-notch::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: 60px;
  height: 12px;
  background: #111;
  border-radius: 6px;
}

.device-casing.mobile .device-notch { display: block; }

/* Home indicator (mobile) */
.device-home {
  display: none;
  height: 20px;
  background: #fff;
  position: relative;
}

.device-home::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  opacity: 0.25;
}

.device-casing.mobile .device-home { display: block; }

/* Caméra tablette */
.device-casing.tablet .device-notch {
  display: block;
  height: 0;
}

.device-casing.tablet .device-notch::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: -18px;
}

/* iframe */
.device-casing iframe {
  width: 100%;
  height: 580px;
  border: none;
  display: block;
}

.device-casing.tablet iframe { height: 680px; }
.device-casing.mobile iframe { height: 720px; }

/* === STEP 9 — CONFORMITÉ === */
.compliance-score {
  text-align: center;
  margin-bottom: 48px;
}

.score-ring {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--success);
}

.score-context {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.score-bar-wrap {
  width: 200px;
  height: 4px;
  background: var(--border);
  margin: 0 auto 16px;
}

.score-bar-fill {
  height: 100%;
  background: var(--success);
  width: 0%;
  transition: width 1s ease;
}

.compliance-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border: 1px solid var(--success);
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(42,215,131,0.05);
}

.compliance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 640px) {
  .compliance-grid { grid-template-columns: 1fr; }
}

.compliance-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 1px solid var(--border);
  font-size: 12px;
  transition: background 0.15s;
}

.compliance-item.ok {
  border-color: rgba(42,215,131,0.3);
  background: rgba(42,215,131,0.03);
}

.compliance-item.warn {
  border-color: rgba(255,160,0,0.35);
  background: rgba(255,160,0,0.04);
}

.compliance-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.compliance-item.ok  .compliance-icon { background: var(--success); color: #fff; }
.compliance-item.warn .compliance-icon { background: #ffa000; color: #fff; }

.compliance-label { font-size: 12px; line-height: 1.4; }

/* === STEP 10 — HISTOIRE === */

/* ── Switch de mode visuel ──────────────────────────────────────────────── */
.histoire-mode-switch {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.histoire-mode-btn {
  padding: 6px 14px;
  font-family: var(--font-main);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.histoire-mode-btn:hover { border-color: #999; color: var(--black); }
.histoire-mode-btn.active { background: var(--black); color: var(--white); border-color: var(--black); }

/* ── Zone d'erreur dédiée ───────────────────────────────────────────────── */
.histoire-erreur {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* ════════════════════════════════════════════════════════
   MODES VISUELS STEP 10 — locaux, sans contamination
════════════════════════════════════════════════════════ */

/* ── Wrapper commun ─────────────────────────────────────────────────────── */
.histoire-wrap {
  border: 1px solid var(--border);
  padding: 32px;
  transition: background 0.3s, border-color 0.3s;
}

/* ── Mode 1 : Éditorial Prestige (défaut) ───────────────────────────────── */
.histoire-mode-editorial {
  background: #fafaf7;
  border-color: #e0ddd8;
}

.histoire-mode-editorial .histoire-block {
  background: #fff;
  border-color: #e0ddd8;
  border-left-color: var(--accent);
}

.histoire-mode-editorial .histoire-block-era {
  color: var(--accent);
  letter-spacing: 3px;
}

.histoire-mode-editorial .histoire-block-text {
  font-family: var(--font-serif);
  font-style: normal;  /* pas italic en éditorial — plus lisible */
  font-size: 15px;
  line-height: 1.9;
  color: #333;
}

/* ── Mode 2 : Parchemin ancien ──────────────────────────────────────────── */
.histoire-mode-parchemin {
  background: #f5eedc;
  border-color: #c8b87a;
  border-width: 2px;
  box-shadow: inset 0 0 60px rgba(180,150,80,0.08);
}

.histoire-mode-parchemin .histoire-block {
  background: rgba(255,252,240,0.7);
  border-color: #c8b87a;
  border-left-color: #8b6914;
}

.histoire-mode-parchemin .histoire-block-era {
  color: #8b6914;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 10px;
  letter-spacing: 2px;
}

.histoire-mode-parchemin .histoire-block-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.95;
  color: #3a2e10;
}

.histoire-mode-parchemin .histoire-loading,
.histoire-mode-parchemin .histoire-erreur {
  background: transparent;
}

/* ── Mode 3 : Manuscrit illustré ────────────────────────────────────────── */
.histoire-mode-manuscrit {
  background: #1a1a1a;
  border-color: #333;
}

.histoire-mode-manuscrit .histoire-blocks {
  grid-template-columns: 1fr;  /* une colonne, blocs larges */
  gap: 24px;
}

.histoire-mode-manuscrit .histoire-block {
  background: #222;
  border-color: #333;
  border-left-color: var(--accent);
  padding: 28px 32px;
}

.histoire-mode-manuscrit .histoire-block:first-child {
  grid-column: span 1;
  border-top: 2px solid var(--accent);
}

.histoire-mode-manuscrit .histoire-block-era {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.histoire-mode-manuscrit .histoire-block-text {
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 16px;
  line-height: 2;
  color: #e8e4d8;
}

.histoire-mode-manuscrit .histoire-loading {
  background: transparent;
}

.histoire-mode-manuscrit .histoire-pulse-lines span {
  background: var(--accent);
}

.histoire-mode-manuscrit .citation,
.histoire-mode-manuscrit .histoire-loading-label {
  color: rgba(255,255,255,0.5);
}

.histoire-mode-manuscrit .histoire-mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--black);
}

.histoire-mode-manuscrit .histoire-erreur {
  color: rgba(255,255,255,0.5);
}

/* ── Éléments communs (indépendants du mode) ────────────────────────────── */
.histoire-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 8px;
}

.herodote-badge {
  flex-shrink: 0;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 12px;
  background: rgba(201,170,113,0.06);
  white-space: nowrap;
  margin-top: 4px;
}

.histoire-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  text-align: center;
  gap: 20px;
}

/* Animation lignes de texte — plus noble qu'un spinner */
.histoire-pulse-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 200px;
}

.histoire-pulse-lines span {
  display: block;
  height: 2px;
  background: var(--black);
  border-radius: 1px;
  transform-origin: left;
  animation: histPulse 1.4s ease-in-out infinite;
}

.histoire-pulse-lines span:nth-child(1) { width: 100%; animation-delay: 0s; }
.histoire-pulse-lines span:nth-child(2) { width: 80%;  animation-delay: 0.1s; }
.histoire-pulse-lines span:nth-child(3) { width: 65%;  animation-delay: 0.2s; }
.histoire-pulse-lines span:nth-child(4) { width: 45%;  animation-delay: 0.3s; }

@keyframes histPulse {
  0%, 100% { opacity: 0.15; }
  50%       { opacity: 1; }
}

.histoire-loading-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.histoire-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .histoire-blocks { grid-template-columns: 1fr; }
}

.histoire-block {
  padding: 24px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  animation: fadeInUp 0.4s ease both;
  background: #fff;
}

/* Premier bloc : légèrement mis en avant */
.histoire-block:first-child {
  grid-column: span 2;
  border-left-color: var(--black);
}

@media (max-width: 768px) {
  .histoire-block:first-child { grid-column: span 1; }
}

.histoire-block-era {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.histoire-block:first-child .histoire-block-era {
  color: var(--black);
}

.histoire-block-text {
  font-size: 14px;
  line-height: 1.85;
  color: #444;
  font-family: var(--font-serif);
  font-style: italic;
}

/* ── Hero visuel plein largeur ──────────────────────────────────────────── */
.histoire-hero {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  margin-bottom: 32px;
  background: #111;
}

.histoire-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.75);
}

.histoire-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 28px 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
}

.histoire-hero-commune {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 6px;
}

.histoire-hero-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ── Image dans chaque bloc chapitre ───────────────────────────────────── */
.histoire-block-visual {
  margin-bottom: 16px;
  overflow: hidden;
}

.histoire-block-visual img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.histoire-block-visual-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
  padding: 6px 0 0;
  display: block;
  font-style: italic;
}

/* ── Table des matières — style livre ──────────────────────────────────── */
.histoire-toc {
  margin-bottom: 36px;
  padding: 28px 32px;
  border: 1px solid var(--border);
  background: #fafaf7;
}

.toc-intro {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
  font-family: var(--font-serif);
  font-style: italic;
}

.toc-titre {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.toc-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dotted #e0ddd8;
  transition: opacity 0.2s;
}

.toc-item:last-child { border-bottom: none; }

.toc-item-locked {
  opacity: 0.45;
}

.toc-item-partial {
  opacity: 0.7;
}

.toc-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  min-width: 20px;
  font-family: var(--font-serif);
  font-style: italic;
}

.toc-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-label-titre {
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
}

.toc-label-sous {
  font-size: 11px;
  color: var(--muted);
}

.toc-lock {
  font-size: 12px;
  opacity: 0.5;
  flex-shrink: 0;
}

.toc-partial {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  flex-shrink: 0;
}

/* ── Titres de chapitres — style narratif ───────────────────────────────── */
.histoire-block-era {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.era-num {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}

.era-titre {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
  color: var(--black);
}

.era-sous {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-serif);
}

/* ── Chapitre partiel — fade-out au bas ─────────────────────────────────── */
.histoire-block-is-partial {
  position: relative;
}

.histoire-block-partial {
  font-size: 14px;
  line-height: 1.85;
  color: #444;
  font-family: var(--font-serif);
  font-style: italic;
  /* Tronquer visuellement */
  max-height: 120px;
  overflow: hidden;
  position: relative;
}

.histoire-block-partial::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

/* Adaptation selon le mode visuel */
.histoire-mode-parchemin .histoire-block-partial::after {
  background: linear-gradient(to bottom, transparent, #f5eedc);
}

.histoire-mode-manuscrit .histoire-block-partial::after {
  background: linear-gradient(to bottom, transparent, #222);
}

/* ── Bloc verrou narratif ────────────────────────────────────────────────── */
.histoire-verrou {
  margin-top: 32px;
  padding: 32px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--black);
  text-align: center;
  background: #fafaf7;
}

.histoire-verrou-chapters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  text-align: left;
  opacity: 0.5;
}

.histoire-verrou-chapter {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.histoire-verrou-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  min-width: 20px;
  font-family: var(--font-serif);
  font-style: italic;
}

.histoire-verrou-titre {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.histoire-verrou-sous {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
}

.histoire-verrou-message {
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 20px;
  letter-spacing: -0.2px;
}

.histoire-verrou-cta {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 14px 36px;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}

.histoire-verrou-cta:hover { opacity: 0.85; }

/* Adaptations modes visuels pour TOC et verrou */
.histoire-mode-parchemin .histoire-toc,
.histoire-mode-parchemin .histoire-verrou { background: rgba(255,252,240,0.7); border-color: #c8b87a; }

.histoire-mode-manuscrit .histoire-toc,
.histoire-mode-manuscrit .histoire-verrou { background: #222; border-color: #333; }

.histoire-mode-manuscrit .toc-titre,
.histoire-mode-manuscrit .toc-label-titre,
.histoire-mode-manuscrit .histoire-verrou-message { color: #e8e4d8; }

.histoire-mode-manuscrit .toc-label-sous,
.histoire-mode-manuscrit .toc-intro,
.histoire-mode-manuscrit .histoire-verrou-titre { color: rgba(255,255,255,0.5); }

/* ── Régénérer ──────────────────────────────────────────────────────────── */
.histoire-regen {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* === STEP 11 — CASSINI === */
.cassini-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.cassini-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  min-height: calc(100vh - 200px);
  display: block;
}

/* Overlay de présentation */
.cassini-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.88);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.cassini-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.cassini-overlay-inner {
  max-width: 480px;
  text-align: center;
  padding: 48px 32px;
  color: #fff;
}

.cassini-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.cassini-title {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.cassini-desc {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255,255,255,0.6);
  margin-bottom: 32px;
  font-family: var(--font-serif);
  font-style: italic;
}

/* Légende sur la carte */
.cassini-legend {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5);
  padding: 4px 14px;
  z-index: 5;
  display: none;
  white-space: nowrap;
}

.cassini-legend.visible { display: block; }

/* === STEP 12 — TARIFS === */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

.pricing-card {
  border: 1px solid var(--border);
  padding: 32px 24px;
  position: relative;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.pricing-card.recommended {
  border-color: var(--black);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.pricing-card.selected {
  border-color: var(--black);
}

.pricing-card.selected:not(.recommended) {
  background: #fafafa;
}

.pricing-card.recommended::before {
  content: 'RECOMMANDÉ';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--black);
  padding: 0;
  /* remplace l'ancienne étiquette flottante par une barre top */
}

.pricing-plan-name {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Plan recommandé : nom plus visible */
.pricing-card.recommended .pricing-plan-name {
  color: var(--black);
}

.pricing-price {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.pricing-period {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 28px;
  letter-spacing: 0.5px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
}

.pricing-features li {
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.pricing-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* === STEP 13 — PAIEMENT === */
.recap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .recap-grid { grid-template-columns: 1fr; }
}

.recap-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.recap-commune-block {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.recap-hero-thumb {
  width: 120px;
  height: 90px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.recap-commune-info {
  flex: 1;
  padding-top: 4px;
}

.recap-commune-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.recap-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.recap-modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.recap-module {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 7px 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  line-height: 1.3;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-required { color: var(--black); }
.form-optional {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: none;
}

.devis-assurance {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.devis-assurance span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--success);
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-main);
  font-size: 14px;
  border: 1px solid var(--border);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--black); }

.payment-icons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.payment-icon {
  padding: 6px 12px;
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
}

.confirm-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  animation: fadeInUp 0.5s ease;
  padding: 48px 24px;
}

.confirm-check-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.confirm-check {
  font-size: 32px;
  color: #fff;
  font-weight: 800;
  line-height: 1;
}

.confirm-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  max-width: 480px;
}

.confirm-commune {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.confirm-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 40px;
}

.confirm-next-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  text-align: left;
}

.confirm-step {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--black);
}

.confirm-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

/* === UTILITIES === */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.hidden { display: none !important; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }

/* === LOADING PLACEHOLDER === */
.photo-placeholder {
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--border) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* === RESPONSIVE TWEAKS === */
@media (max-width: 640px) {
  .step-header { padding: 16px; }
  .step-body   { padding: 24px 16px; }
  .step-footer { padding: 16px; }
  .two-col     { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card.recommended { transform: none; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .style-grid { grid-template-columns: 1fr 1fr; }
}
