/* ==========================================================================
   Cadeau Secret • Papeterie des fêtes
   Neutres crème, un seul accent bordeaux, la ligne de pliage comme signature
   ========================================================================== */

:root {
  /* Typographie */
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Rampe neutre chaude (papier crème) */
  --bg-page: #f7f4ee;
  --bg-card: #fffdf9;
  --bg-raised: #f1ece3;
  --bg-input: #fffdf9;
  --hairline: rgba(31, 27, 22, 0.09);
  --hairline-strong: rgba(31, 27, 22, 0.16);

  --text-main: #1f1b16;
  --text-muted: #5e554a;
  --text-light: #7b7266;

  /* Accent unique : bordeaux de cire */
  --accent: #72212c;
  --accent-hover: #5c1a23;
  --accent-soft: #f6eced;

  /* Sémantique, discrète */
  --positive: #2f6b4f;
  --negative: #a3262f;

  /* Alias historiques (styles inline encore présents) */
  --wine-base: var(--accent);
  --wine-hover: var(--accent-hover);
  --wine-light: var(--accent-soft);
  --wine-border: var(--hairline-strong);
  --pine-base: var(--positive);
  --pine-border: var(--hairline-strong);
  --gold-base: var(--text-light);
  --gold-border: var(--hairline-strong);
  --gold-darker: var(--text-main);
  --bg-subtle: var(--bg-raised);
  --bg-card-subtle: var(--bg-page);
  --border-subtle: var(--hairline);
  --border-card: var(--hairline-strong);
  --border-hover: rgba(31, 27, 22, 0.24);

  /* Profondeur, neutre */
  --shadow-soft: 0 1px 2px rgba(31, 27, 22, 0.05);
  --shadow-card: 0 1px 2px rgba(31, 27, 22, 0.04), 0 8px 24px rgba(31, 27, 22, 0.05);
  --shadow-paper: 0 1px 1px rgba(31, 27, 22, 0.06), 0 12px 32px -8px rgba(31, 27, 22, 0.18);

  /* Rayons */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 16px;

  /* Mouvement : une seule courbe */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-enter: 360ms;
  --transition-fast: var(--dur-fast) var(--ease);
  --transition-normal: 220ms var(--ease);
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: var(--accent-soft);
  color: var(--accent);
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.fa-solid, .fa-regular, .fa-brands {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px 48px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

main {
  flex: 1;
}

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.brand-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: block;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 19px;
  line-height: 1;
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Onglets
   -------------------------------------------------------------------------- */
.nav-tabs-wrapper {
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 48px;
}

.nav-tabs {
  display: flex;
  gap: 24px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tab-btn {
  position: relative;
  height: 44px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  color: var(--text-main);
}

.nav-tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.tab-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 40px;
}

@media (min-width: 900px) {
  .hero-section {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
    min-height: 440px;
  }
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 20px;
  max-width: 16ch;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 36rem;
}

.hero-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 32px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-steps li {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hero-steps .step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-light);
  width: 16px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Le moment : carte pliée « Tu offres à… »
   -------------------------------------------------------------------------- */

.paper-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #fffdf8;
  border-radius: 6px;
  box-shadow: var(--shadow-paper);
  color: var(--text-main);
}



.paper-front {
  padding: 24px 28px 28px;
  position: relative;
}

.paper-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-light);
}

.paper-event-title {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text-muted);
}

.paper-to {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-light);
}

.paper-to-name {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
}

/* Signature : la ligne de pliage */
.fold-line {
  position: relative;
  height: 0;
  border-top: 1.5px dashed rgba(31, 27, 22, 0.24);
  margin: 0;
}

.fold-line-label {
  position: absolute;
  left: 20px;
  top: -9px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--text-light);
  background-color: #fffdf8;
}

.paper-inside {
  padding: 28px;
  background: #fbf8f2;
  border-radius: 0 0 6px 6px;
}

.paper-target-intro {
  font-size: 13px;
  color: var(--text-light);
}

.paper-target-name {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.paper-details {
  margin-top: 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 16px;
  row-gap: 8px;
  font-size: 13px;
}

.paper-details dt {
  color: var(--text-light);
}

.paper-details dd {
  color: var(--text-main);
}

.paper-wishes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   Le moment : paquet emballé et étiquette suspendue
   -------------------------------------------------------------------------- */
.gift-stage {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  aspect-ratio: 440 / 400;
  container-type: inline-size;
}

.gift-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gift-tag {
  position: absolute;
  left: 2%;
  top: 8%;
  width: 49%;
  height: 34%;
  padding: 0;
  perspective: 900px;
  transform: rotate(-6deg);
  transform-origin: calc(100% - 4.4cqw) 50%;
  cursor: pointer;
  text-align: left;
  filter: drop-shadow(0 1px 1px rgba(31, 27, 22, 0.14)) drop-shadow(0 10px 16px rgba(31, 27, 22, 0.14));
  -webkit-tap-highlight-color: transparent;
}

.gift-tag:focus-visible {
  outline: none;
}

.gift-tag:focus-visible .gift-tag-face {
  box-shadow: 0 0 0 2px var(--accent);
}

.gift-tag-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 640ms var(--ease);
}

.gift-tag.is-flipped .gift-tag-inner {
  transform: rotateX(180deg);
}

.gift-tag-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6cqw;
  padding: 0 11cqw 0 5.4cqw;
  background: #fffaf0;
  color: var(--text-main);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  clip-path: polygon(0 0, calc(100% - 7cqw) 0, 100% 7cqw, 100% calc(100% - 7cqw), calc(100% - 7cqw) 100%, 0 100%);
  -webkit-mask: radial-gradient(circle at calc(100% - 4.4cqw) 50%, transparent 1.3cqw, #000 1.4cqw);
  mask: radial-gradient(circle at calc(100% - 4.4cqw) 50%, transparent 1.3cqw, #000 1.4cqw);
}

.gift-tag-face::after {
  content: "";
  position: absolute;
  right: calc(4.4cqw - 2.1cqw);
  top: calc(50% - 2.1cqw);
  width: 4.2cqw;
  height: 4.2cqw;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.7cqw #c9a96a;
}

.gift-tag-back {
  transform: rotateX(180deg);
}

.gift-tag-small {
  font-size: max(11px, 2.9cqw);
  color: var(--text-light);
}

.gift-tag-name {
  font-family: var(--font-serif);
  font-size: 7.4cqw;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.gift-tag-name-accent {
  color: var(--accent);
}

.gift-tag-meta {
  margin-top: 1.4cqw;
  font-size: max(11px, 2.8cqw);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Signature : le ruban */
.ribbon-divider {
  position: relative;
  height: 32px;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ribbon-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 1px;
  background: linear-gradient(#86303c, #6a1d28);
}

.ribbon-bow {
  position: relative;
  width: 64px;
  height: 32px;
  filter: drop-shadow(0 1px 1px rgba(60, 15, 20, 0.2));
}

.card-wrapped {
  position: relative;
  overflow: hidden;
}

.card-wrapped::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 6px;
  background: linear-gradient(#86303c, #6a1d28);
}

/* Cachet de cire */
.wax-seal {
  position: absolute;
  width: 64px;
  height: 64px;
  right: 24px;
  top: -32px;
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(60, 15, 20, 0.25));
}

.paper-front .wax-seal {
  top: auto;
  bottom: -32px;
}

/* --------------------------------------------------------------------------
   Grille d'actions & cartes
   -------------------------------------------------------------------------- */
.action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 32px;
  align-items: stretch;
}

@media (min-width: 860px) {
  .action-grid {
    grid-template-columns: 5fr 7fr;
  }
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.card-dashboard {
  padding: 32px;
}

.card-subtle {
  background-color: var(--bg-raised);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.card-header-row {
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.25;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-light);
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 15px;
  background-color: var(--bg-input);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
  color: #a39a8d;
}

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

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(114, 33, 44, 0.1);
}

.form-input[aria-invalid="true"] {
  border-color: var(--negative);
  box-shadow: 0 0 0 3px rgba(163, 38, 47, 0.12);
}

.form-input-pin {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.form-input-pin::placeholder {
  font-family: var(--font-sans);
  letter-spacing: 0;
}

.card-foot {
  margin-top: auto;
  padding-top: 24px;
}

.join-tip {
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.join-tip-title {
  display: block;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 2px;
}

.form-input-code {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  height: 52px;
}

.form-input-code::placeholder {
  letter-spacing: 0.04em;
  text-transform: none;
  font-family: var(--font-sans);
  font-size: 15px;
}

.form-helper {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

.form-helper.is-error {
  color: var(--negative);
}

.form-helper.is-ok {
  color: var(--positive);
}

/* Interrupteur ligne (réciprocité) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  margin-bottom: 12px;
  cursor: pointer;
}

.toggle-row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  display: block;
}

.toggle-row-desc {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
}

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

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  font-size: 15px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  white-space: nowrap;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-primary {
  background-color: var(--accent);
  color: #fffdf9;
}

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

.btn-secondary,
.btn-pine {
  background-color: var(--text-main);
  color: #fffdf9;
}

.btn-secondary:hover,
.btn-pine:hover {
  background-color: #000;
}

.btn-subtle,
.btn-outline {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-color: var(--hairline-strong);
}

.btn-subtle:hover,
.btn-outline:hover {
  background-color: var(--bg-raised);
}

.btn-ghost {
  background: none;
  color: var(--text-muted);
  padding: 0 8px;
}

.btn-ghost:hover {
  color: var(--text-main);
  background: var(--bg-raised);
}

.btn-sm {
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-raised);
  color: var(--text-main);
}

.btn-icon[aria-pressed="true"] {
  color: var(--accent);
}

.btn-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hairline-strong);
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

.btn-link:hover {
  color: var(--text-main);
  text-decoration-color: currentColor;
}

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

.btn-link-danger {
  color: var(--negative);
}

.btn-whatsapp .fa-whatsapp {
  color: #25d366;
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   Badges : texte discret, pas de pilules
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--text-light);
}

.badge .fa-solid, .badge .fa-regular {
  font-size: 12px;
  width: 12px;
}

.badge-wine,
.badge-gold,
.badge-neutral {
  color: var(--text-light);
}

.badge-pine {
  color: var(--positive);
}

.badge-accent {
  color: var(--accent);
}

.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.meta-sep {
  color: var(--hairline-strong);
}

/* --------------------------------------------------------------------------
   Tableau de bord
   -------------------------------------------------------------------------- */
.dash-header {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

.dash-header-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 640px) {
  .dash-header-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.dash-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--text-main);
}

.dash-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.dash-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-meta-item strong {
  font-weight: 500;
  color: var(--text-main);
}

.dash-progress {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.dash-progress strong {
  font-weight: 500;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.dash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-light);
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--hairline-strong);
}

.dash-banner strong {
  font-weight: 500;
  color: var(--text-muted);
}

.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-main);
}

.section-title .count {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
}

.section-hint {
  font-size: 13px;
  color: var(--text-light);
}

/* Liste des convives */
.participants-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
  container: participants / inline-size;
}

.participant-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 2px;
  border-bottom: 1px solid var(--hairline);
}

.participant-row-me {
  background: linear-gradient(90deg, var(--bg-raised), rgba(241, 236, 227, 0));
  border-radius: var(--radius-sm);
  padding: 16px 12px;
}

.participant-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 8px;
  width: 100%;
  min-width: 0;
}

.participant-identity {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.participant-badges {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 6px 8px;
  flex-wrap: wrap;
  padding-left: 18px;
}

.participant-badges .badge {
  padding: 2px 10px;
  border-radius: 999px;
  background-color: var(--bg-raised);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.participant-badges .badge-pine {
  background-color: rgba(47, 107, 79, 0.1);
  color: var(--positive);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot-active {
  background-color: var(--positive);
}

.status-dot-inactive {
  background-color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--hairline-strong);
}

.participant-name {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-main);
  overflow-wrap: break-word;
  min-width: 0;
}

.participant-me {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.participant-delete-btn {
  grid-column: 2;
  grid-row: 1;
  flex-shrink: 0;
}

.participant-delete-btn:hover {
  color: var(--negative);
}

.participant-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.participant-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.participant-tool-btn {
  flex: 1 0 auto;
  min-block-size: 38px;
  height: auto;
  padding: 6px 12px;
  background-color: var(--bg-raised);
  color: var(--text-main);
  border: 1px solid var(--hairline);
  font-size: 13px;
}

.participant-tool-btn:hover {
  background-color: #e9e2d6;
  border-color: var(--hairline-strong);
}

.participant-tool-btn i {
  font-size: 12px;
  color: var(--text-muted);
}

.participant-target-btn {
  width: 100%;
}

@media (pointer: coarse) {
  .participant-tool-btn,
  .participant-target-btn,
  .participant-delete-btn {
    min-block-size: 44px;
    min-inline-size: 44px;
  }
}

@container participants (inline-size >= 640px) {
  .participant-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    padding: 12px 4px;
  }

  .participant-row-me {
    padding: 12px 12px;
  }

  .participant-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    width: auto;
    flex: 1;
  }

  .participant-name {
    font-size: 15px;
    font-weight: 500;
  }

  .participant-badges {
    padding-left: 0;
    gap: 4px 14px;
  }

  .participant-badges .badge {
    padding: 0;
    border-radius: 0;
    background-color: transparent;
    color: var(--text-light);
    font-size: 13px;
  }

  .participant-badges .badge-pine {
    background-color: transparent;
    color: var(--positive);
  }

  .participant-delete-btn {
    margin-left: auto;
  }

  .participant-actions {
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .participant-tools {
    width: auto;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .participant-tool-btn {
    flex: initial;
    min-block-size: 36px;
    padding: 0 8px;
    background-color: transparent;
    border-color: transparent;
    color: var(--text-muted);
    font-size: 14px;
  }

  .participant-tool-btn:hover {
    background-color: var(--bg-raised);
    border-color: transparent;
    color: var(--text-main);
  }

  .participant-tool-btn i {
    display: none;
  }

  .participant-target-btn {
    width: auto;
  }
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.btn-label-mobile {
  display: none;
}

.add-participant-bar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Zone organisateur */
.organizer-zone {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.organizer-zone-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.retention-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-raised);
}

.retention-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-main);
  display: block;
}

.retention-detail {
  font-size: 13px;
  color: var(--text-muted);
}

.danger-row {
  display: flex;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Historique
   -------------------------------------------------------------------------- */
.history-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--hairline);
}

.history-card {
  padding: 16px 4px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background-color var(--transition-fast);
}

@media (min-width: 640px) {
  .history-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.history-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-main);
}

.history-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--text-light);
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.unauth-box {
  max-width: 440px;
  padding: 32px 0 16px;
}

.unauth-box h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}

.unauth-box p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-row > .btn {
  flex: 1;
}

/* --------------------------------------------------------------------------
   Modales
   -------------------------------------------------------------------------- */
dialog:not([open]) {
  display: none !important;
}

dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100dvh;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

dialog::backdrop {
  background: rgba(31, 27, 22, 0.4);
}

dialog[open] .modal-dialog-box {
  animation: modal-in var(--dur-enter) var(--ease);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.modal-dialog-box {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 2px rgba(31, 27, 22, 0.06), 0 24px 48px -12px rgba(31, 27, 22, 0.25);
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 32px;
  margin: auto;
}

.modal-dialog-box-lg {
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-dialog-box-xl {
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-head {
  margin-bottom: 20px;
  padding-right: 32px;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-main);
}

.modal-title .accent {
  color: var(--accent);
}

.modal-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.modal-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-text strong {
  font-weight: 500;
  color: var(--text-main);
}

.modal-field {
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-actions > .btn {
  flex: 1;
}

.modal-actions-end {
  justify-content: flex-end;
}

.modal-actions-end > .btn {
  flex: initial;
}

.modal-alt {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--hairline-strong);
  font-size: 14px;
  color: var(--text-muted);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: var(--bg-raised);
  color: var(--text-main);
}

.notice-warn {
  background-color: var(--accent-soft);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Onglets connexion / inscription */
.auth-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 24px;
}

.auth-tab-btn {
  position: relative;
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  transition: color var(--transition-fast);
}

.auth-tab-btn.active {
  color: var(--text-main);
}

.auth-tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

/* Cases d'exclusion */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 224px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  transition: background-color var(--transition-fast);
}

.checkbox-item:hover {
  background-color: var(--bg-raised);
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Liste d'envies */
.wish-add {
  background: var(--bg-raised);
  padding: 16px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wish-add-row {
  display: flex;
  gap: 8px;
}

.wish-add-row .form-input {
  flex: 1;
}

.wish-list {
  display: flex;
  flex-direction: column;
  max-height: 192px;
  overflow-y: auto;
  border-top: 1px solid var(--hairline);
}

.wish-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}

.wish-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.wish-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wish-empty {
  font-size: 14px;
  color: var(--text-light);
  padding: 12px 0;
}

/* --------------------------------------------------------------------------
   Révélation : la même carte pliée
   -------------------------------------------------------------------------- */
.reveal-box {
  padding: 0;
  overflow: hidden;
  max-width: 420px;
  background: #fffdf8;
}

.reveal-closed {
  text-align: center;
  padding: 48px 32px 40px;
  cursor: pointer;
  user-select: none;
}

.reveal-gift {
  display: block;
  width: 176px;
  height: auto;
  margin: 0 auto 20px;
  overflow: visible;
}

.reveal-gift .rv-lid,
.reveal-gift .rv-body,
.reveal-gift .rv-bow,
.reveal-gift .rv-ribbon {
  transform-box: fill-box;
  transition: transform 360ms var(--ease), opacity 300ms var(--ease);
}

.reveal-gift .rv-lid {
  transform-origin: 10% 100%;
}

.reveal-gift .rv-bow {
  transform-origin: 50% 80%;
}

.reveal-closed:hover .rv-lid {
  transform: translateY(-3px);
}

/* Déballage : le nœud se défait, le ruban tombe, le couvercle se soulève */
.reveal-closed.is-opening .rv-bow {
  opacity: 0;
  transform: scale(0.6);
  transition-duration: 220ms;
}

.reveal-closed.is-opening .rv-ribbon {
  opacity: 0;
  transition-delay: 80ms;
}

.reveal-closed.is-opening .rv-lid {
  opacity: 0;
  transform: translate(-14px, -44px) rotate(-14deg);
  transition-delay: 160ms;
  transition-duration: 420ms;
}

.reveal-closed.is-opening .rv-body {
  opacity: 0;
  transform: translateY(6px);
  transition-delay: 380ms;
}

.reveal-closed-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
}

.reveal-closed-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

.reveal-closed-hint {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reveal-opened .paper-inside {
  padding: 32px;
  border-radius: 0;
}

.reveal-opened .paper-details {
  margin-top: 24px;
}

.reveal-opened .paper-details dd p {
  margin: 0;
}

.target-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reveal-footer {
  padding: 16px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reveal-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.reveal-timer strong {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.reveal-card-entrance {
  animation: reveal-in 420ms var(--ease) both;
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.reveal-closed.is-opening .reveal-closed-title,
.reveal-closed.is-opening .reveal-closed-sub,
.reveal-closed.is-opening .reveal-closed-hint {
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100% - 40px);
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background-color: var(--text-main);
  color: #f7f4ee;
  box-shadow: 0 8px 24px rgba(31, 27, 22, 0.18);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.toast .fa-solid {
  color: #b5aca0;
}

.toast.toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-success .fa-solid {
  color: #8fc3a6;
}

.toast-error .fa-solid {
  color: #e8949a;
}

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 20px;
}

.footer-link {
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-main);
}

/* Bandeau confidentialité */
.privacy-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
  padding: 16px 0;
  border-top: 1px dashed var(--hairline-strong);
}

.privacy-line .fa-solid {
  color: var(--text-light);
  margin-right: 8px;
}

/* Utilitaires */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --------------------------------------------------------------------------
   Titre éditable
   -------------------------------------------------------------------------- */
.title-edit-container {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-edit-title {
  color: var(--text-light);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.btn-edit-title:hover {
  background: var(--bg-raised);
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   Publicité : masquée tant qu'aucune annonce réelle n'est insérée
   -------------------------------------------------------------------------- */
.ad-slot-wrapper {
  margin: 32px auto;
  max-width: 728px;
  width: 100%;
  text-align: center;
}

.ad-slot-wrapper:has(.ad-slot-placeholder) {
  display: none;
}

.ad-slot-label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.ad-slot-container {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Coupons pliables (aperçu & impression A4)
   -------------------------------------------------------------------------- */
.printable-coupons-sheet {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .printable-coupons-sheet {
    grid-template-columns: repeat(2, 1fr);
  }
}

.secret-coupon-card {
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  background: #fffdf8;
  overflow: hidden;
  page-break-inside: avoid;
  break-inside: avoid;
  display: flex;
  flex-direction: column;
}

.secret-coupon-card .paper-front {
  padding: 20px 20px 24px;
}

.secret-coupon-card .paper-inside {
  padding: 24px 20px 20px;
  flex: 1;
}

.secret-coupon-card .paper-to {
  margin-top: 16px;
}

.secret-coupon-card .paper-target-name {
  font-size: 30px;
}

.secret-coupon-card .wax-seal {
  width: 44px;
  height: 44px;
  right: 16px;
  top: 16px;
  bottom: auto;
  filter: none;
}

.coupon-confidential-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-light);
}

.coupon-inside-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline-strong);
  font-size: 12px;
  color: var(--text-light);
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

@media screen and (max-width: 640px) {
  .app-container {
    padding: 0 16px 40px;
  }

  .site-header {
    height: 56px;
  }

  .nav-tabs-wrapper {
    margin-bottom: 32px;
  }

  .nav-tabs {
    gap: 20px;
  }

  .hero-section {
    gap: 32px;
    margin-bottom: 40px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-desc {
    font-size: 16px;
  }

  .hero-steps {
    margin-top: 24px;
  }

  .paper-front {
    padding: 20px 20px 24px;
  }

  .paper-inside {
    padding: 24px 20px;
  }

  .paper-target-name {
    font-size: 32px;
  }

  .card,
  .card-dashboard {
    padding: 20px 16px;
  }

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

  dialog[open] {
    padding: 12px;
  }

  .modal-dialog-box {
    padding: 24px 20px;
    max-width: 100%;
  }

  .reveal-box {
    padding: 0;
  }

  .reveal-opened .paper-inside {
    padding: 24px 20px;
  }

  .reveal-footer {
    padding: 16px 20px 20px;
  }

  #toast-container {
    top: auto;
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
  }

  .toast {
    transform: translateY(8px);
  }

  .dash-title {
    font-size: 26px;
  }

  .dash-header-actions {
    width: 100%;
    flex-wrap: nowrap;
  }

  .btn-label-desktop {
    display: none;
  }

  .btn-label-mobile {
    display: inline;
  }

  #btn-open-print-coupons,
  #btn-share-link {
    flex: 1;
  }

  .add-participant-bar {
    flex-direction: column;
  }

  .add-participant-bar .btn {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

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

  header, footer, nav, #snow-canvas, #view-home, #view-dashboard, #view-history,
  .ad-slot-wrapper, .modal-close-btn, .btn, dialog:not(#modal-print-coupons) {
    display: none !important;
  }

  dialog#modal-print-coupons {
    position: static !important;
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .modal-dialog-box {
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    padding: 0 !important;
    animation: none !important;
  }

  .no-print {
    display: none !important;
  }

  .printable-coupons-sheet {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
  }

  .secret-coupon-card {
    border: 1px dashed #333 !important;
    box-shadow: none !important;
  }
}
