:root {
  --ink: #15160f;
  --olive: #2b2f1c;
  --moss: #556036;
  --sage: #a3a98a;
  --ivory: #f4f1e8;
  --cream: #e8e3d3;
  --ivory-70: rgba(244, 241, 232, 0.72);
  --ivory-45: rgba(244, 241, 232, 0.45);
  --line: rgba(244, 241, 232, 0.28);
  --error: #e9a08a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--olive); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ivory);
  background: var(--olive);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sage); color: var(--ink); }

/* ---------- Backdrop: the NIYA photo, blurred into an olive atmosphere ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.backdrop__img {
  position: absolute;
  inset: -12%;
  background: url("/.netlify/images?url=/img/fond-mariee.png&w=1600&fm=webp&q=75") center / cover no-repeat;
  filter: blur(2px);
  transform: scale(1.1);
  animation: drift 22s var(--ease) infinite alternate;
}
.backdrop__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(43, 47, 28, 0.45), transparent 70%),
    linear-gradient(180deg, rgba(43, 47, 28, 0.5), rgba(21, 22, 15, 0.68));
}
.backdrop__grain {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.7;
}
@keyframes drift {
  from { transform: scale(1.1) translate3d(0, 0, 0); }
  to { transform: scale(1.18) translate3d(-2%, -1.5%, 0); }
}

/* ---------- Column ---------- */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 0 clamp(1.25rem, 5vw, 2rem);
}
.panel {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 4vh, 2.75rem) 0 clamp(1.25rem, 3vh, 2rem);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  display: block;
  width: 96px;
  aspect-ratio: 3.4 / 1;
  background: url("/.netlify/images?url=/img/logo-niya-blanc.png&w=400&fm=webp") center / 128.2% auto no-repeat;
}
.panel__tag {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-70);
}
.panel__tag em {
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ivory);
}

.progress { margin-top: clamp(1.5rem, 3.5vh, 2.25rem); }
.progress__bar {
  height: 2px;
  border-radius: 2px;
  background: rgba(244, 241, 232, 0.16);
  overflow: hidden;
}
.progress__bar span {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--ivory);
  border-radius: inherit;
  transition: width 0.7s var(--ease);
}
.progress__count {
  margin-top: 0.85rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ivory-70);
}
.progress__count b { font-weight: 400; color: var(--ivory); }

form {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: clamp(2.25rem, 7vh, 4.5rem) 0 clamp(1.5rem, 4vh, 2.5rem);
}

.step { display: none; }
.step.is-active {
  display: block;
  animation: rise 0.7s var(--ease) both;
}
.step.is-back { animation-name: rise-back; }
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes rise-back {
  from { opacity: 0; transform: translateY(-22px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.1rem;
}
.title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(2.5rem, 6.4vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--ivory);
}
.title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--sage);
}
.lead {
  margin: 1.1rem 0 clamp(2rem, 5vh, 3rem);
  max-width: 44ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ivory-70);
}

/* ---------- Fields ---------- */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
}
.field {
  margin-bottom: 1.9rem;
  border: 0;
  padding: 0;
  min-width: 0;
}
.field label,
.field legend {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--ivory);
  margin-bottom: 0.2rem;
  padding: 0;
}
.field small {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ivory-45);
}
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1.15rem;
  color: var(--ivory);
  caret-color: var(--sage);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.7rem 0 0.8rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.field textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 9rem;
}
.field input::placeholder,
.field textarea::placeholder {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ivory-45);
  opacity: 1;
}
.field input:focus,
.field textarea:focus { border-bottom-color: var(--ivory); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ivory);
  -webkit-box-shadow: 0 0 0 100px var(--olive) inset;
  caret-color: var(--ivory);
}
.field.is-invalid input,
.field.is-invalid textarea { border-bottom-color: var(--error); }
.field.is-invalid .chip span { border-color: var(--error); }

.hint {
  margin-top: 0.75rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ivory-70);
}
.hint span { color: var(--sage); margin-right: 0.3rem; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.chip { cursor: pointer; }
.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.chip span {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--ivory);
  background: rgba(244, 241, 232, 0.04);
  backdrop-filter: blur(6px);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.chip:hover span { border-color: var(--ivory); }
.chip input:checked + span {
  background: var(--ivory);
  border-color: var(--ivory);
  color: var(--olive);
}
.chip input:focus-visible + span { outline: 2px solid var(--sage); outline-offset: 3px; }

/* ---------- Recap ---------- */
.recap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  margin-bottom: 2.25rem;
}
.recap > div {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.recap > div:nth-child(odd) { padding-right: 1.25rem; }
.recap dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 0.35rem;
}
.recap dd {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.2;
  color: var(--ivory);
  overflow-wrap: anywhere;
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.75rem;
}
.actions .btn--primary { margin-left: auto; }
.btn {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  padding: 1.05rem 1.9rem;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
.btn span { display: inline-block; transition: transform 0.25s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn--ghost:hover span { transform: none; }
.btn--primary { background: var(--ivory); color: var(--olive); }
.btn--primary:hover { background: var(--cream); }
.btn--primary:active { transform: scale(0.98); }
.btn--primary:disabled { opacity: 0.6; cursor: wait; }
.btn:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }
.btn--ghost {
  background: transparent;
  color: var(--ivory-70);
  padding-left: 0;
  padding-right: 0;
}
.btn--ghost:hover { color: var(--ivory); }
.btn--wide { width: 100%; padding: 1.3rem 1.9rem; font-size: 0.88rem; }

.note {
  margin-top: 1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ivory-70);
  text-align: center;
}
.error {
  min-height: 1.3em;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--error);
}
.hp { position: absolute; left: -9999px; }

.panel__foot {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ivory-45);
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .panel__tag { font-size: 0.62rem; letter-spacing: 0.14em; text-align: right; }
  .panel__tag em { font-size: 0.95rem; }
  .logo { width: 84px; }
}
@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .recap dd { font-size: 1.2rem; }
  .panel__tag { display: none; }
  .field label, .field legend { font-size: 1.2rem; }
}

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