/* ============================================================================
 * Nidoua — Direction artistique Magazine de Noël Contemporain
 * Palette : Ivoire #FAF7F2 · Aubergine #4A344D · Sauge #6B826D · Abricot #E6A984
 * Zéro dégradé violet, zéro carte systématique, zéro pluie de badges.
 * ============================================================================ */

:root {
  --ivory: #faf7f2;
  --paper: #f4eee4;
  --surface: #ffffff;
  --aubergine: #4a344d;
  --aubergine-hover: #38253b;
  --ink: #2b1f2d;
  --muted: #6e616e;
  --muted-light: #8f8290;
  --hairline: #e6ddd1;
  --hairline-strong: #d5c8b8;
  --apricot: #e6a984;
  --apricot-wash: #f9efe7;
  --sage: #6b826d;
  --sage-wash: #eef3ee;
  --danger: #9f3e3e;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Topbar minimaliste façon magazine --- */
.topbar {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--hairline);
}

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

.brand-mark-img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  mix-blend-mode: multiply;
}

.brand-wordmark {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--aubergine);
  line-height: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  background: none;
  border-top: 0;
  border-left: 0;
  border-right: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  color: var(--aubergine);
  border-bottom-color: var(--aubergine);
}

.nav-link-strong {
  color: var(--aubergine);
  font-weight: 600;
}

/* --- Main container --- */
.main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

/* --- Typography éditoriale --- */
h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  color: var(--aubergine);
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2rem, 5.2vw, 3.25rem);
  line-height: 1.09;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  line-height: 1.18;
}

h3 {
  font-size: clamp(1.18rem, 2vw, 1.4rem);
  line-height: 1.25;
}

.eyebrow {
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.editorial-lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 46ch;
}

.serif-italic {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Landing éditoriale : photo 40% + création directe --- */
.landing-editorial {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-top: 20px;
  align-items: center;
}

.landing-photo-frame {
  position: relative;
  margin: 0;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--paper);
}

.landing-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

.landing-content {
  max-width: 520px;
}

.landing-form {
  margin-top: 26px;
}

.inline-profile-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 14px 0 20px;
}

.radio-clean {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}

.radio-clean input {
  accent-color: var(--aubergine);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.radio-clean.active {
  color: var(--ink);
  font-weight: 500;
}

.quiet-footnote {
  margin-top: 16px;
  font-size: 0.84rem;
  color: var(--muted-light);
}

.owned-strip {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

/* --- Step 2 : Création de la première envie + vignettes photo --- */
.editorial-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding-top: 28px;
}

.step2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.ribbon-accent-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: brightness(1.06) contrast(1.04);
  flex-shrink: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  margin-bottom: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.back-link:hover {
  color: var(--aubergine);
}

/* Catégories photographiques façon guide cadeaux */
.cat-photo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.cat-photo-btn {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.cat-photo-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.cat-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-photo-btn.selected .cat-photo-thumb {
  border-color: var(--aubergine);
}

.cat-photo-btn:hover .cat-photo-thumb {
  transform: translateY(-1px);
}

.cat-photo-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}

.cat-photo-btn.selected .cat-photo-label {
  color: var(--aubergine);
  font-weight: 600;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.suggestion-link {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.suggestion-link:hover {
  border-color: var(--aubergine);
  background: var(--paper);
}

/* --- Inputs & Buttons sobres --- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--aubergine);
  margin-bottom: 6px;
}

.input,
.select {
  width: 100%;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-editorial {
  font-size: 1.08rem;
  padding: 15px 16px;
}

.input:focus,
.select:focus {
  border-color: var(--aubergine);
  box-shadow: 0 0 0 3px rgba(74, 52, 77, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--aubergine);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--aubergine-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--aubergine);
  border-color: var(--hairline-strong);
}

.btn-secondary:hover {
  border-color: var(--aubergine);
  background: var(--paper);
}

.btn-whatsapp {
  background: var(--sage);
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #586e5a;
}

.btn-text {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--aubergine);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 1px solid var(--hairline-strong);
}

.btn-text:hover {
  border-bottom-color: var(--aubergine);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 9px 14px;
  font-size: 0.87rem;
}

.btn-danger-link {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* --- Mise en page éditoriale 2 colonnes (Liste prête, Vue Proche, Famille) --- */
.magazine-header {
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.magazine-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: start;
}

.magazine-aside {
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.share-confirm-banner {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--sage-wash);
  border-left: 3px solid var(--sage);
  font-size: 0.92rem;
  color: var(--ink);
}

/* --- Catalogue vertical de cadeaux (zéro carte lourde, filets fins + vignettes photo) --- */
.catalog-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.catalog-list {
  border-top: 1px solid var(--hairline);
}

.catalog-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}

.catalog-row.reserved {
  opacity: 0.72;
}

.catalog-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--paper);
}

.catalog-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--aubergine);
  line-height: 1.25;
}

.catalog-row.reserved .catalog-title {
  text-decoration: line-through;
  text-decoration-color: var(--muted-light);
}

.catalog-meta {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 3px;
}

.catalog-price {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.catalog-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.reserved-status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage);
  white-space: nowrap;
}

.icon-remove {
  background: none;
  border: 0;
  color: var(--muted-light);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 4px 6px;
}

.icon-remove:hover {
  color: var(--danger);
}

/* --- Animation paquet cadeau lors de la réservation --- */
@keyframes ribbonPop {
  0% {
    transform: scale(0.86) rotate(-4deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.06) rotate(2deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.gift-celebration {
  padding: 20px 22px;
  background: var(--apricot-wash);
  border-left: 3px solid var(--apricot);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.gift-celebration-img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: brightness(1.06) contrast(1.04);
  flex-shrink: 0;
  animation: ribbonPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* --- Blocs éditoriaux latéraux (conversion Nidoua & famille) --- */
.editorial-block {
  padding: 22px 0;
  border-bottom: 1px solid var(--hairline);
}

.editorial-block:first-child {
  padding-top: 0;
}

.editorial-block:last-child {
  border-bottom: 0;
}

.editorial-callout {
  background: var(--paper);
  padding: 24px;
  border-radius: var(--radius-md);
}

.backup-code-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--aubergine);
  word-break: break-all;
}

/* --- Famille : portraits sobres --- */
.family-catalog {
  border-top: 1px solid var(--hairline);
}

.family-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
  transition: padding-left 0.15s ease;
}

.family-member-row:hover {
  padding-left: 4px;
}

.member-monogram {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  color: var(--aubergine);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --- Details / Réglages discrets --- */
details.editorial-details {
  border-top: 1px solid var(--hairline);
  padding-top: 14px;
}

details.editorial-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--aubergine);
  padding: 4px 0;
}

details.editorial-details summary::-webkit-details-marker {
  display: none;
}

details.editorial-details[open] summary {
  margin-bottom: 14px;
}

.toggle-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.toggle-line input[type="checkbox"] {
  accent-color: var(--aubergine);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* --- Modal & Toast --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 31, 45, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.modal-sheet {
  width: 100%;
  max-width: 460px;
  background: var(--ivory);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  box-shadow: 0 24px 60px rgba(43, 31, 45, 0.22);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--aubergine);
  color: #ffffff;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(43, 31, 45, 0.24);
  z-index: 80;
  white-space: nowrap;
}

/* --- Footer sobre --- */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 24px 20px 32px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-mark {
  border-radius: 6px;
  mix-blend-mode: multiply;
}

.footer-brand {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 0.96rem;
  color: var(--aubergine);
}

.footer-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted-light);
}

/* --- Responsive Mobile -> Tablette -> Desktop Magazine --- */
@media (max-width: 640px) {
  .topbar {
    padding: 14px 16px;
  }

  .main {
    padding: 0 16px 44px;
  }

  .landing-photo-frame {
    margin: 0 -16px;
    width: calc(100% + 32px);
    border-radius: 0;
    aspect-ratio: 4 / 3;
    max-height: 42vh;
  }

  .landing-editorial {
    padding-top: 0;
    gap: 22px;
  }

  .cat-photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-row {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
  }

  .catalog-thumb {
    width: 60px;
    height: 60px;
  }

  .catalog-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
  }

  .row-2 {
    grid-template-columns: 1fr;
  }

  .ribbon-accent-img {
    width: 68px;
    height: 68px;
  }
}

@media (max-width: 540px) {
  .topbar {
    padding: 14px 16px;
    gap: 10px;
  }

  .topbar-actions {
    gap: 12px;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  .nav-link-app {
    display: none;
  }
}

@media (min-width: 720px) {
  .modal-backdrop {
    align-items: center;
  }
}

@media (min-width: 920px) {
  .topbar {
    padding: 22px 32px;
  }

  .main {
    padding: 0 32px 72px;
  }

  .landing-editorial {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 56px;
    padding-top: 42px;
  }

  .landing-photo-frame {
    aspect-ratio: 4 / 3.4;
  }

  .magazine-columns {
    grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.88fr);
    gap: 52px;
  }

  .magazine-aside {
    border-top: 0;
    border-left: 1px solid var(--hairline);
    padding-top: 0;
    padding-left: 36px;
    position: sticky;
    top: 24px;
  }
}
