@font-face {
  font-family: "Mountains of Christmas";
  src: url("/fonts/mountains-of-christmas-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #fbf6ec;
  --paper: #fffdf8;
  --red: #b3261e;
  --red-dark: #8c1d17;
  --green: #1f4d3a;
  --green-soft: #e4eee8;
  --text: #2b2420;
  --muted: #6f655d;
  --border: #e8dfd0;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(60, 40, 20, 0.08);
  --title-font: "Mountains of Christmas", "Georgia", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

main,
.site-header {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

main {
  padding-bottom: 48px;
}

/* En-tête */
.site-title {
  display: block;
  text-decoration: none;
}

.site-title h1 {
  margin: 0;
  padding: 24px 0 8px;
  color: var(--red);
  font-family: var(--title-font);
  font-size: 2.4rem;
  line-height: 1.1;
  text-align: center;
}

h2 {
  margin: 8px 0 16px;
  color: var(--green);
  font-family: var(--title-font);
  font-size: 2rem;
  line-height: 1.15;
}

.intro {
  margin: 0 0 20px;
  color: var(--muted);
  text-align: center;
}

a {
  color: var(--green);
}

/* Accueil : cartes des personnes */
.people {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--red);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.people li:nth-child(even) .person-card {
  border-left-color: var(--green);
}

.person-card:hover {
  transform: translateY(-2px);
}

.person-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.person-text {
  display: flex;
  flex-direction: column;
}

.person-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.person-count {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Page d'une liste */
.back-link {
  display: inline-block;
  margin: 8px 0 0;
  padding: 8px 0;
  font-weight: 600;
  text-decoration: none;
}

.wishes {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.wish {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}

.wish h3 {
  margin: 0;
  font-size: 1.1rem;
}

.wish h3::before {
  content: "🎁 ";
}

.wish-description {
  margin: 6px 0 0;
  color: var(--muted);
  white-space: pre-line;
}

.wish-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
}

.wish-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.empty {
  padding: 28px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 20px;
}

/* Boutons */
.btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--green);
  border-radius: 999px;
  background: var(--paper);
  color: var(--green);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--red-dark);
}

.btn-small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.9rem;
}

.btn-danger {
  border-color: var(--red);
  color: var(--red);
}

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

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #e0a526;
  outline-offset: 2px;
}

/* Formulaire */
.wish-form {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  padding: 18px;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-soft);
}

.wish-form label {
  display: grid;
  gap: 4px;
  font-weight: 600;
}

.wish-form .optional {
  color: var(--muted);
  font-weight: 400;
}

.wish-form input,
.wish-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* évite le zoom automatique sur iPhone */
}

.wish-form textarea {
  resize: vertical;
}

.form-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-error:empty {
  display: none;
}

/* Messages */
.status {
  margin: 32px 0;
  color: var(--muted);
  text-align: center;
}

.status-error,
.form-error,
.notice-error {
  color: var(--red-dark);
}

.status-error p {
  margin: 0 0 12px;
}

.form-error,
.notice-error {
  margin: 0;
  font-weight: 600;
}

.notice-error {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fbe9e7;
}

.notice-error:empty {
  display: none;
}

a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* Neige */
.snow {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.snow span {
  position: absolute;
  top: -24px;
  color: #a9bccb;
  animation: snow-fall linear infinite;
}

@keyframes snow-fall {
  to {
    transform: translate(20px, 105vh);
  }
}

@media (prefers-reduced-motion: reduce) {
  .snow {
    display: none;
  }

  .person-card {
    transition: none;
  }
}
