/* ═══════════ ENCHANTÉS — éditeur de création ═══════════ */
:root {
  --cream: #fbf7f1;
  --ivory: #fffefb;
  --ink: #3e3640;
  --muted: #8d8189;
  --rose: #e8b4c2;
  --rose-deep: #c25e78;
  --gold: #b99253;
  --hairline: rgba(62, 54, 64, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-width: thin; scrollbar-color: rgba(194, 94, 120, 0.28) transparent; }
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-thumb { background: rgba(194, 94, 120, 0.28); border-radius: 4px; }

body {
  font-family: "Jost", sans-serif; font-weight: 300;
  color: var(--ink); background: var(--cream);
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}

/* ══════════ ENTÊTE ══════════ */
.cr-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(251, 247, 241, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.cr-logo { font-family: "Great Vibes", cursive; font-size: 1.7rem; color: var(--rose-deep); text-decoration: none; }
.cr-top-note { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted); }

/* ══════════ MISE EN PAGE ══════════ */
.cr-layout {
  max-width: 760px; margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem);
}
.cr-apercu {
  background: transparent; border: 1px solid var(--hairline); cursor: pointer;
  font-family: "Jost", sans-serif; font-weight: 300; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink);
  padding: 0.55rem 1.4rem; border-radius: 100px;
  transition: border-color 0.25s, color 0.25s;
}
.cr-apercu:hover { border-color: var(--rose-deep); color: var(--rose-deep); }

/* ══════════ BLOCS ══════════ */
.blk { padding: 0 0 0.4rem; }
/* séparateur de section : fin filet doré centré, distinct des soulignements de champs */
.blk + .blk::before {
  content: ""; display: block;
  width: 44px; height: 1px; margin: 2.6rem auto;
  background: var(--gold); opacity: 0.5;
}
.blk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.blk-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3em; color: var(--muted);
}
.blk-label span {
  font-family: "Cormorant Garamond", serif; font-size: 0.95rem;
  color: var(--gold); margin-right: 0.9rem; letter-spacing: 0.08em;
}
.blk-body.off, .sub-body.off { opacity: 0.35; pointer-events: none; }
.blk-body, .sub-body { transition: opacity 0.3s; }

/* interrupteurs */
.switch { position: relative; display: inline-block; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i {
  display: block; width: 40px; height: 22px; border-radius: 22px;
  background: #e4dcd6; transition: background 0.25s; position: relative;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(62, 54, 64, 0.25);
}
.switch input:checked + i { background: var(--rose-deep); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }

/* champs */
.fld { display: block; flex: 1; }
.fld > span {
  display: block; font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--muted); margin-bottom: 0.4rem;
}
.fld input, .fld textarea {
  width: 100%; background: transparent; color: var(--ink);
  border: none; border-bottom: 1px solid var(--hairline);
  font-family: "Jost", sans-serif; font-weight: 300; font-size: 0.98rem;
  padding: 0.45rem 0.05rem; border-radius: 0; resize: none; overflow: hidden;
  transition: border-color 0.3s;
}
/* ══════════ SÉLECTEUR DE DATE SUR MESURE ══════════ */
.datepick { position: relative; }
.datepick-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: none; border-bottom: 1px solid var(--hairline);
  font-family: "Jost", sans-serif; font-weight: 300; font-size: 0.98rem;
  color: var(--ink); padding: 0.45rem 0.05rem; cursor: pointer;
  transition: border-color 0.3s;
}
.datepick-trigger:hover, .datepick.open .datepick-trigger { border-bottom-color: var(--gold); }
.datepick-trigger.placeholder .dp-label { color: #c8bfc4; }
.datepick-trigger svg { width: 17px; height: 17px; color: var(--gold); flex: none; }

.datepick-pop {
  position: absolute; z-index: 30; top: calc(100% + 8px); left: 0;
  width: 300px; max-width: 90vw;
  background: var(--ivory); border: 1px solid var(--hairline);
  border-radius: 8px; box-shadow: 0 20px 50px rgba(62, 54, 64, 0.14);
  padding: 1rem 1rem 1.1rem;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.dp-title {
  font-family: "Cormorant Garamond", serif; font-size: 1.35rem;
  text-transform: capitalize; color: var(--ink);
}
.dp-nav {
  background: transparent; border: 1px solid var(--hairline); border-radius: 50%;
  width: 30px; height: 30px; cursor: pointer; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; line-height: 1; transition: border-color 0.25s, color 0.25s;
}
.dp-nav:hover { border-color: var(--rose-deep); color: var(--rose-deep); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow {
  text-align: center; font-size: 0.58rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); padding-bottom: 0.35rem;
}
.dp-day {
  aspect-ratio: 1; border: none; background: transparent; cursor: pointer;
  font-family: "Jost", sans-serif; font-weight: 300; font-size: 0.85rem;
  color: var(--ink); border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.dp-day:hover:not(.empty) { background: rgba(194, 94, 120, 0.12); }
.dp-day.empty { cursor: default; }
.dp-day.today { color: var(--gold); }
.dp-day.selected { background: var(--rose-deep); color: #fff; }
.fld-caption {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--muted); margin-bottom: 0.7rem;
}
.fld-message { margin-top: 1.2rem; }
.fld input:focus, .fld textarea:focus { outline: none; border-bottom-color: var(--gold); }
.fld ::placeholder { color: #c8bfc4; }
.fld-note { flex: 1; font-size: 0.85rem; color: var(--muted); align-self: end; padding-bottom: 0.3rem; }
.row2 { display: flex; gap: 1.6rem; margin-bottom: 1.1rem; }
.row2:last-child { margin-bottom: 0; }
.row3 { display: grid; grid-template-columns: 0.7fr 1fr 1.2fr; gap: 1.2rem; }

/* thèmes */
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.theme-card { position: relative; cursor: pointer; display: block; }
.theme-card input { position: absolute; opacity: 0; }
.theme-card img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block;
  border-radius: 6px; border: 2px solid transparent;
  transition: border-color 0.25s, transform 0.25s;
}
.theme-card:hover img { transform: translateY(-2px); }
.theme-card input:checked ~ img { border-color: var(--rose-deep); }
.theme-name {
  display: block; margin-top: 0.5rem;
  font-family: "Cormorant Garamond", serif; font-size: 1.05rem; text-align: center;
}
.theme-card input:checked ~ .theme-name { color: var(--rose-deep); }

/* styles de message */
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  border: 1px solid var(--hairline); background: transparent; cursor: pointer;
  font-family: "Jost", sans-serif; font-weight: 300; font-size: 0.8rem;
  color: var(--ink); padding: 0.45rem 1.1rem; border-radius: 100px;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.chip:hover { border-color: var(--rose-deep); color: var(--rose-deep); }
.chip.active { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; }

/* sous-blocs programme */
.sub { border-top: 1px dashed rgba(62, 54, 64, 0.12); padding: 1rem 0 0.4rem; margin-top: 0.9rem; }
.sub:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.sub-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.sub-head p { font-family: "Cormorant Garamond", serif; font-size: 1.15rem; }

/* champs essentiels */
.fld.req > span::after { content: " ✻"; color: var(--gold); }

/* notre histoire — moments */
.moment-row {
  display: grid; grid-template-columns: 5.2rem 1fr 1.6fr auto;
  gap: 0.9rem; align-items: end; margin-bottom: 0.9rem;
}
.moment-row input {
  width: 100%; background: transparent; color: var(--ink);
  border: none; border-bottom: 1px solid var(--hairline);
  font-family: "Jost", sans-serif; font-weight: 300; font-size: 0.95rem;
  padding: 0.4rem 0.05rem; transition: border-color 0.3s;
}
.moment-row input:focus { outline: none; border-bottom-color: var(--gold); }
.moment-row input::placeholder { color: #c8bfc4; }
.m-del {
  background: none; border: 1px solid var(--hairline); border-radius: 50%;
  width: 26px; height: 26px; cursor: pointer; color: var(--muted);
  font-size: 0.95rem; line-height: 1; transition: border-color 0.25s, color 0.25s;
}
.m-del:hover:not(:disabled) { border-color: var(--rose-deep); color: var(--rose-deep); }
.m-del:disabled { opacity: 0.3; cursor: default; }
#addMoment { margin-top: 0.3rem; }

/* option en ligne (case à cocher fine) */
.opt-line {
  display: flex; align-items: center; gap: 0.7rem;
  margin-top: 1.1rem; cursor: pointer; font-size: 0.92rem;
}
.opt-line input { accent-color: var(--rose-deep); width: 15px; height: 15px; }

/* photo */
.filefld { display: inline-block; cursor: pointer; }
.filefld input { position: absolute; opacity: 0; width: 0; }
.filefld span {
  display: inline-block; border: 1px solid var(--hairline); border-radius: 100px;
  font-size: 0.85rem; padding: 0.55rem 1.4rem;
  transition: border-color 0.25s, color 0.25s;
}
.filefld:hover span { border-color: var(--rose-deep); color: var(--rose-deep); }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1rem; }
.pt { position: relative; }
.pt img {
  width: 86px; height: 86px; object-fit: cover; display: block;
  border-radius: 6px; border: 1px solid var(--hairline);
}
.pt button {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--cream); border: 1px solid var(--hairline);
  cursor: pointer; color: var(--muted); font-size: 0.85rem; line-height: 1;
}
.pt button:hover { color: var(--rose-deep); border-color: var(--rose-deep); }
.pt-star {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(251, 247, 241, 0.9);
  font-size: 0.52rem; text-transform: uppercase; letter-spacing: 0.18em;
  text-align: center; padding: 0.15rem 0; color: var(--gold);
  border-radius: 0 0 6px 6px;
}

/* actions */
.cr-actions { border-top: 1px solid var(--hairline); padding-top: 1.8rem; text-align: center; }
.cr-action-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.cr-action-buttons .btn {
  background: var(--rose-deep); color: #fff; border: none; cursor: pointer;
  text-decoration: none; font-family: "Jost", sans-serif; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.22em;
  padding: 1.05rem 2.6rem; border-radius: 2px; transition: background 0.3s, transform 0.3s;
}
.cr-action-buttons .btn:hover { background: #a94b64; transform: translateY(-1px); }
.cr-action-buttons .btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.cr-action-buttons .btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--hairline);
}
.cr-action-buttons .btn-ghost:hover { background: transparent; border-color: var(--gold); color: var(--gold); }
.cr-hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.9rem; max-width: 34em; margin-inline: auto; }
.cr-status { font-size: 0.85rem; color: var(--sage); margin-top: 0.6rem; min-height: 1.2em; }
.cr-reset {
  margin-top: 1.1rem; background: none; border: none; cursor: pointer;
  font-family: "Jost", sans-serif; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--muted);
  border-bottom: 1px solid var(--hairline); padding-bottom: 0.2rem;
}
.cr-reset:hover { color: var(--rose-deep); border-color: var(--rose-deep); }

@media (max-width: 720px) {
  .cr-top-note { display: none; }
  .row2, .row3 { flex-direction: column; grid-template-columns: 1fr; display: flex; gap: 1rem; }
}
