:root {
  --paper: #f7f2eb;
  --paper2: #fffdf9;
  --ink: #302b27;
  --muted: #82786f;
  --line: #e9dfd3;
  --terra: #b96e55;
  --terra-dark: #96523e;
  --sage: #87917a;
  --shadow: 0 18px 55px rgba(70, 48, 33, 0.08);
  --radius: 22px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
.app-shell {
  max-width: 1160px;
  margin: auto;
  padding: 0 34px;
}
.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-size: 19px;
}
.brand i {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  color: var(--terra);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ead8ca;
  color: var(--terra);
  font-size: 20px;
}
.top-actions {
  display: flex;
  gap: 22px;
  align-items: center;
}
.text-button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
}
.text-button:hover {
  color: var(--ink);
}
.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 21px;
  font-weight: 600;
  font-size: 13px;
  transition: 0.2s;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}
.button:hover {
  transform: translateY(-2px);
}
.button-dark {
  background: var(--ink);
  color: white;
}
.button-terra {
  background: var(--terra);
  color: white;
}
.button-outline {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}
.button-small {
  padding: 11px 16px;
  font-size: 12px;
}
main {
  min-height: calc(100vh - 150px);
}
.footer {
  padding: 28px 0 35px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  gap: 15px;
}
.footer-note {
  opacity: 0.75;
}
.hero {
  padding: 78px 0 64px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 54px;
  align-items: center;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -1.8px;
  font-weight: 500;
  margin: 18px 0;
}
h1 em {
  color: var(--terra);
  font-weight: 500;
}
.hero-copy {
  max-width: 500px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}
.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 27px;
}
.hero-art {
  min-height: 420px;
  position: relative;
  display: grid;
  place-items: center;
}
.memory-visual {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 390px;
}
.memory-photo {
  position: absolute;
  width: 190px;
  height: 225px;
  padding: 11px 11px 35px;
  background: #fffefa;
  box-shadow: 0 12px 35px rgba(70, 48, 33, 0.14);
  border-radius: 4px;
}
.memory-photo span {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-family: "Playfair Display", serif;
  font-size: 13px;
  color: #625347;
}
.memory-photo-one {
  left: 25px;
  top: 30px;
  transform: rotate(-8deg);
  z-index: 1;
}
.memory-photo-two {
  right: 20px;
  top: 45px;
  transform: rotate(7deg);
  z-index: 2;
}
.photo-scene {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.scene-one {
  background:
    radial-gradient(circle at 72% 25%, #f9e3ad 0 10%, transparent 10.5%),
    linear-gradient(165deg, transparent 57%, #829078 58% 72%, transparent 73%),
    linear-gradient(15deg, #b77f64 0 28%, transparent 29%),
    linear-gradient(145deg, #e9cbb2, #f4e7d6 55%, #c5aa8e);
}
.scene-two {
  background:
    radial-gradient(circle at 28% 28%, #f8dfb6 0 9%, transparent 9.5%),
    linear-gradient(155deg, transparent 55%, #a1a58a 56% 75%, transparent 76%),
    linear-gradient(25deg, #c28c70 0 30%, transparent 31%),
    linear-gradient(145deg, #d9bca5, #f2e2d1 58%, #b7a18d);
}
.memory-message {
  position: absolute;
  z-index: 3;
  left: 50px;
  bottom: 25px;
  width: 280px;
  padding: 20px 23px;
  background: #fffefa;
  box-shadow: 0 12px 35px rgba(70, 48, 33, 0.13);
  transform: rotate(-3deg);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.memory-message small {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--terra);
  font-weight: 700;
}
.memory-message strong {
  font:
    500 19px/1.35 "Playfair Display",
    serif;
  color: var(--ink);
}
.memory-message span {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}
.memory-heart {
  position: absolute;
  z-index: 4;
  right: 5px;
  bottom: 75px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #89917b;
  color: white;
  display: grid;
  place-items: center;
  font-size: 29px;
  transform: rotate(10deg);
  box-shadow: 0 6px 18px rgba(70, 48, 33, 0.12);
}
.section {
  padding: 38px 0 70px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 22px;
}
.section-heading h2 {
  font:
    500 32px "Playfair Display",
    serif;
  margin: 8px 0 0;
}
.section-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.feature {
  background: rgba(255, 253, 249, 0.65);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 23px;
}
.feature-icon {
  font-size: 24px;
  margin-bottom: 20px;
}
.feature h3 {
  font-size: 14px;
  margin-bottom: 8px;
}
.feature p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}
.page {
  padding: 48px 0 70px;
  max-width: 850px;
  margin: auto;
}
.page-narrow {
  max-width: 650px;
}
.back-link {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  padding: 0;
  margin-bottom: 25px;
}
.page-title {
  font:
    500 clamp(34px, 5vw, 48px) "Playfair Display",
    serif;
  line-height: 1.12;
  margin: 10px 0;
}
.lead {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}
.panel {
  background: var(--paper2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 27px;
  box-shadow: 0 8px 30px rgba(70, 48, 33, 0.035);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field.full {
  grid-column: 1/-1;
}
.field label,
.field-label {
  font-size: 11px;
  font-weight: 700;
  color: #655c54;
}
.field input,
.field textarea,
.field select {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefa;
  padding: 13px 14px;
  outline: none;
  color: var(--ink);
  font-size: 13px;
  width: 100%;
}
.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(185, 110, 85, 0.1);
}
.hint {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.choice {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px;
  background: #fffefa;
  text-align: left;
  color: var(--ink);
}
.choice.active {
  border: 1.5px solid var(--terra);
  background: #fbf1eb;
}
.choice strong {
  display: block;
  font-size: 13px;
  margin: 8px 0 4px;
}
.choice span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.choice .choice-icon {
  font-size: 22px;
}
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 22px;
  gap: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 100px;
  background: #e9eee5;
  color: #64705c;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 700;
}
.event-list {
  display: grid;
  gap: 12px;
}
.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: var(--paper2);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.event-row h3 {
  font:
    500 21px "Playfair Display",
    serif;
  margin: 0 0 5px;
}
.event-meta {
  font-size: 11px;
  color: var(--muted);
}
.event-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.icon-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 12px;
}
.event-cover {
  background: linear-gradient(135deg, #e7d6c6, #f4e9dc);
  border-radius: 18px;
  padding: 32px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  position: relative;
  overflow: hidden;
}
.event-cover:after {
  content: "✳";
  position: absolute;
  right: 35px;
  top: 20px;
  font-size: 110px;
  color: rgba(255, 255, 255, 0.45);
}
.event-cover h2 {
  font:
    500 38px "Playfair Display",
    serif;
  margin: 9px 0 4px;
  position: relative;
  z-index: 1;
}
.event-cover p {
  font-size: 12px;
  color: #78685b;
  margin: 0;
  position: relative;
  z-index: 1;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 17px 0;
}
.stat {
  background: #f7f2eb;
  border-radius: 13px;
  padding: 15px;
}
.stat strong {
  display: block;
  font:
    500 24px "Playfair Display",
    serif;
}
.stat span {
  font-size: 10px;
  color: var(--muted);
}
.link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  background: #f7f2eb;
  border-radius: 12px;
  margin-top: 9px;
}
.link-box code {
  font-size: 10px;
  color: #6f6257;
  overflow-wrap: anywhere;
}
.contrib-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 16px;
  display: flex;
  gap: 14px;
  background: #fffefa;
  margin-top: 10px;
  flex-wrap: wrap;
}
.contrib-thumb {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border-radius: 10px;
  background: #eee3d8;
  object-fit: cover;
}
.contrib-card h4 {
  margin: 0 0 5px;
  font-size: 13px;
}
.contrib-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.contribution-wall {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.memory-card {
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  break-inside: avoid;
}
.memory-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 13px;
}
.memory-card blockquote {
  font:
    italic 17px/1.55 "Playfair Display",
    serif;
  margin: 0 0 13px;
}
.memory-card .byline {
  font-size: 10px;
  color: var(--terra);
  font-weight: 700;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-top: 24px;
}
.day-tile {
  aspect-ratio: 1/1;
  border: 1px solid #e5d6c8;
  border-radius: 14px;
  background: #f1e5d9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #8d6b59;
}
.day-tile strong {
  font:
    500 28px "Playfair Display",
    serif;
}
.day-tile span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.day-tile.open {
  background: #fffefa;
  color: var(--terra);
  box-shadow: 0 5px 18px rgba(70, 48, 33, 0.06);
}
.day-tile.locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.day-tile.selected {
  outline: 2px solid var(--terra);
  outline-offset: 2px;
}
.empty {
  text-align: center;
  padding: 45px 20px;
  background: rgba(255, 253, 249, 0.5);
  border: 1px dashed #d9cabb;
  border-radius: 18px;
}
.empty .emoji {
  font-size: 34px;
  margin-bottom: 12px;
}
.empty h3 {
  font:
    500 23px "Playfair Display",
    serif;
  margin-bottom: 7px;
}
.empty p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.notice {
  padding: 13px 15px;
  background: #f2eee5;
  border-radius: 12px;
  color: #786e61;
  font-size: 11px;
  line-height: 1.6;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: #302b27;
  color: white;
  padding: 12px 18px;
  border-radius: 100px;
  font-size: 12px;
  transition: 0.25s;
  pointer-events: none;
  z-index: 20;
  max-width: 90%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.file-drop {
  border: 1px dashed #d8c7b8;
  border-radius: 13px;
  padding: 18px;
  text-align: center;
  background: #faf6f0;
}
.file-drop button {
  border: 0;
  background: none;
  color: var(--terra);
  font-size: 12px;
  font-weight: 700;
}
.preview-image {
  display: block;
  max-width: 100%;
  max-height: 180px;
  border-radius: 12px;
  margin: 10px auto 0;
}
.center {
  text-align: center;
}
.muted {
  color: var(--muted);
}
.spacer {
  height: 12px;
}
.hidden {
  display: none !important;
}
@media (max-width: 700px) {
  .app-shell {
    padding: 0 18px;
  }
  .topbar {
    height: 72px;
  }
  .top-actions {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .top-actions .text-button {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    font-size: 11px;
    padding: 8px 0;
  }
  .hero {
    padding: 48px 0 35px;
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .hero-art {
    min-height: 330px;
  }
  .memory-visual {
    height: 320px;
    transform: scale(0.88);
    transform-origin: center top;
  }
  .memory-photo-one {
    left: 10px;
  }
  .memory-photo-two {
    right: 5px;
  }
  .memory-message {
    left: 25px;
    bottom: 10px;
  }
  .memory-heart {
    right: 0;
    bottom: 60px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .section {
    padding: 25px 0 45px;
  }
  .section-heading {
    display: block;
  }
  .section-heading p {
    margin-top: 8px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field.full {
    grid-column: auto;
  }
  .panel {
    padding: 19px;
  }
  .page {
    padding: 35px 0 50px;
  }
  .event-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .event-actions {
    width: 100%;
  }
  .event-actions button {
    flex: 1;
  }
  .contribution-wall {
    grid-template-columns: 1fr;
  }
  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer {
    flex-direction: column;
  }
  .stats {
    gap: 6px;
  }
  .stat {
    padding: 11px;
  }
}
@media print {
  body {
    background: white;
  }
  .topbar,
  .footer,
  .no-print,
  .toast {
    display: none !important;
  }
  .app-shell {
    max-width: none;
    padding: 0;
  }
  .page {
    padding: 0;
    max-width: none;
  }
  .event-cover {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .memory-card {
    break-inside: avoid;
    border: 1px solid #ddd;
  }
  .contribution-wall {
    grid-template-columns: 1fr 1fr;
  }
}

/* Formulaire de modification d'un souvenir */
.edit-contribution-form {
  flex: 1 1 100%;
  min-width: 0;
  padding-top: 16px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.edit-contribution-form .field {
  margin-bottom: 14px;
}

.edit-contribution-form .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 700px) {
  .edit-contribution-form .actions button {
    flex: 1;
  }
}

.memory-card blockquote,
.contrib-card p {
  white-space: pre-wrap;
}

/* ==================================
   LIVRE SOUVENIR — VERSION PDF
================================== */

@page {
  size: A4;
  margin: 16mm 15mm;
}

@media print {
  body {
    background: #fff !important;
    color: #39332e !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .topbar,
  .footer,
  .no-print,
  button {
    display: none !important;
  }

  .app-shell {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  main#app,
  .page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  /* Couverture du livre */

  .event-cover {
    break-inside: avoid;
    page-break-inside: avoid;
    text-align: center;
    margin-bottom: 12mm;
    padding: 12mm 8mm !important;
  }

  .center {
    text-align: center;
  }

  /* Présentation des souvenirs en deux colonnes */

  .contribution-wall {
    display: block !important;
    columns: 2;
    column-gap: 8mm;
    column-fill: auto;
  }

  .memory-card {
    display: inline-block !important;
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 0 7mm;
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #e8ded2;
    background: #fffdf9 !important;
  }

  .memory-card img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    break-inside: avoid;
  }

  .memory-card blockquote {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 10.5pt;
    line-height: 1.55;
  }

  /* Éviter les coupures disgracieuses */

  h1,
  h2,
  h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }

  .contribution-wall {
    position: relative;
  }

  .contribution-wall::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px solid #e8ded2;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .memory-card .byline {
    display: none !important;
  }
}
.account-menu {
  position: relative;
}

.account-trigger {
  white-space: nowrap;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 100;
  min-width: 220px;
  padding: 14px;
  background: white;
  border: 1px solid #e8e4df;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-dropdown[hidden] {
  display: none;
}

.account-email {
  font-size: 13px;
  color: #777;
  overflow-wrap: anywhere;
}

.account-dropdown button {
  text-align: left;
}

/* Menu hamburger mobile */

.mobile-menu {
  display: none;
  position: relative;
}

.mobile-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 25px;
  color: var(--ink);
  padding: 5px 8px;
}

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

.mobile-menu-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 200;
  min-width: 210px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-dropdown button {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}

.mobile-menu-dropdown button:hover {
  background: var(--paper);
}

.mobile-menu-dropdown .account-email {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

/* Affichage sur petits écrans */

@media (max-width: 520px) {
  .top-actions > .text-button,
  .top-actions > .button,
  .top-actions > .account-menu {
    display: none !important;
  }

  .mobile-menu {
    display: block;
  }

  .top-actions {
    flex-wrap: nowrap;
    gap: 0;
  }
}
@media (max-width: 700px) {
  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }
}
.mobile-menu-dropdown button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}