/* assets/index.css — style "invitation ancienne" + responsive + vidéo dans la photo */

:root{
  --paper:#f3e6c8;
  --paper2:#ead9b6;
  --ink:#2a1c12;
  --muted:#6b5546;
  --line:rgba(42,28,18,.20);
  --shadow: 0 18px 60px rgba(0,0,0,.25);
  --r:20px;

  --accent:#7b2f1a;     /* ton "sceau" */
  --accent2:#a66a2a;    /* cuivre */
}

/* reset */
*{box-sizing:border-box}
html, body{height:100%}

body{
  margin:0;
  color:var(--ink);
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;

  /* fond papier enrichi */
  background:
    radial-gradient(1400px 900px at 8% -10%, rgba(255,255,255,.62), transparent 56%),
    radial-gradient(1000px 700px at 100% 0%, rgba(255,250,240,.42), transparent 58%),
    radial-gradient(1200px 840px at 50% 120%, rgba(120,72,36,.14), transparent 62%),
    linear-gradient(165deg, #f6ebd4 0%, #efdfbf 46%, #e2cda8 100%);

  min-height:100svh;
}

/* léger grain (sans image externe) */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.11;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0,0,0,.02) 0px,
      rgba(0,0,0,.02) 1px,
      transparent 2px,
      transparent 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(120,80,40,.018) 0px,
      rgba(120,80,40,.018) 1px,
      transparent 2px,
      transparent 5px
    );
}

/* halo et vignette douce pour donner de la profondeur */
body::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(620px 320px at 50% 8%, rgba(255,255,255,.34), transparent 72%),
    radial-gradient(1200px 760px at 50% 110%, rgba(62,34,16,.18), transparent 72%);
  mix-blend-mode:multiply;
  opacity:.72;
}

/* page */
.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 22px;
}

.hero{
  position:relative;
  border-radius: var(--r);
  background: rgba(255,255,255,.40);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow:hidden;
  padding: clamp(14px, 2.4vw, 22px);
}

/* cadre "carte" */
.hero::after{
  content:"";
  position:absolute;
  inset:10px;
  border-radius: calc(var(--r) - 10px);
  border: 1px solid rgba(42,28,18,.16);
  pointer-events:none;
}

/* typo */
h1{
  margin: 0;
  font-size: clamp(26px, 3.3vw, 40px);
  letter-spacing: -0.02em;
}
p{
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* image + zone vidéo */
.heroMedia{
  margin-top: 14px;
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid rgba(42,28,18,.22);
  background: rgba(0,0,0,.06);
  position:relative;
}

/* l'image garde la hauteur (la vidéo se superpose) */
.heroMedia picture{display:block}
.heroMedia img{
  width:100%;
  height:auto;
  display:block;
  filter: contrast(1.05) saturate(.95);
}

/* "tampon" (titre sur l'image) */
.heroStamp{
  position:absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: min(620px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 14px;
  color: #fff3e6;
  background: rgba(123,47,26,.78);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 12px 26px rgba(0,0,0,.25);
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  line-height: 1.25;
}

/* Bouton Play centré */
.heroPlay{
  position:absolute;
  inset:0;
  z-index: 3;
  border: 0;
  background: transparent;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  -webkit-tap-highlight-color: transparent;
}

.heroPlayCircle{
  width: 78px;
  height: 78px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  background: rgba(10,10,10,.45);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  transition: transform .12s ease, background .12s ease;
}

.heroPlay svg{
  width: 30px;
  height: 30px;
  fill: #fff;
  margin-left: 3px; /* petit décalage typique du play */
}

.heroPlay:hover .heroPlayCircle{
  transform: scale(1.03);
  background: rgba(10,10,10,.55);
}

.heroPlay:focus-visible .heroPlayCircle{
  outline: 3px solid rgba(255,255,255,.55);
  outline-offset: 4px;
}

@media (max-width: 420px){
  .heroPlayCircle{width:64px; height:64px}
  .heroPlay svg{width:26px; height:26px}
}

/* Vidéo superposée DANS la photo */
.heroVideo{
  position:absolute;
  inset:0;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  background: rgba(0,0,0,.92);
  transition: opacity .18s ease;
}

.heroVideoFrame{
  position:absolute;
  inset:0;
}

.heroVideoFrame iframe{
  width:100%;
  height:100%;
  border:0;
  display:block;
}

.heroVideoClose{
  position:absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.heroVideoClose:hover{background: rgba(0,0,0,.50)}
.heroVideoClose:focus-visible{
  outline: 3px solid rgba(255,255,255,.55);
  outline-offset: 3px;
}

/* état lecture */
.heroMedia.is-playing .heroVideo{
  opacity: 1;
  pointer-events: auto;
}

/* on garde l'espace de l'image mais on masque visuellement */
.heroMedia.is-playing picture{
  opacity: 0;
  pointer-events: none;
}
.heroMedia.is-playing .heroStamp,
.heroMedia.is-playing .heroPlay{
  opacity: 0;
  pointer-events: none;
}

/* layout formulaire */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 720px){
  .wrap{padding:14px}
  .hero{padding:14px}
  .grid{grid-template-columns:1fr}
}

.row{margin-top:12px}
#rsvp{
  margin-top: 12px;
  background: rgba(255,255,255,.36);
  border: 1px solid rgba(42,28,18,.12);
  border-radius: 16px;
  padding: 14px;
}

label{
  display:block;
  font-size: 13px;
  color: rgba(42,28,18,.75);
  margin: 2px 0 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* ✅ IMPORTANT: ne pas casser le layout des checkbox */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea{
  width:100%;
  border:1px solid rgba(42,28,18,.22);
  background: rgba(255,255,255,.55);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px;
  outline:none;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus{
  border-color: rgba(123,47,26,.55);
  box-shadow: 0 0 0 4px rgba(123,47,26,.18);
}

.small{
  color: rgba(42,28,18,.70);
  font-size: 12.5px;
  line-height: 1.45;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* cartes événements */
.days{display:flex; gap:10px; flex-wrap:wrap}

.pill{
  flex: 1 1 240px;
  min-width: 240px;
  cursor: pointer;
  border: 1px solid rgba(42,28,18,.22);
  border-radius: 16px;
  background: rgba(255,255,255,.45);
  padding: 12px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  min-height: 86px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.pill:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.55);
  border-color: rgba(42,28,18,.28);
}

/* ✅ checkbox taille fixe */
.pill input[type="checkbox"]{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 3px;
}

/* ✅ texte prend la place restante */
.pill > div{
  flex: 1 1 auto;
  min-width: 0;
}

.pill strong{
  display:block;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 16px;
}
.pill span{
  display:block;
  color: rgba(42,28,18,.70);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 2px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* bouton "sceau" */
.btn{
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 900;
  color: #fff3e6;
  background: linear-gradient(135deg, rgba(123,47,26,1), rgba(166,106,42,.95));
  box-shadow: 0 12px 26px rgba(123,47,26,.22);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
.btn:disabled{opacity:.65; cursor:not-allowed}

.btn.ghost{
  background: transparent;
  border: 1px solid rgba(42,28,18,.30);
  color: var(--ink);
  box-shadow:none;
}

/* status */
.status{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(42,28,18,.20);
  background: rgba(255,255,255,.50);
  color: rgba(42,28,18,.75);
  font-weight: 700;
  display:none;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
.status.ok{
  display:block;
  border-color: rgba(25,115,55,.30);
  background: rgba(235,250,238,.9);
  color: rgba(25,115,55,.95);
}
.status.err{
  display:block;
  border-color: rgba(160,30,30,.30);
  background: rgba(255,236,236,.9);
  color: rgba(160,30,30,.95);
}

/* modal famille */
.modalBackdrop{
  position:fixed;
  inset:0;
  background: rgba(20,10,6,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 50;
}

.modal{
  width: min(560px, 100%);
  background: rgba(243,230,200,.98);
  border: 1px solid rgba(42,28,18,.25);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  color: var(--ink);
}

.modal h3{
  margin:0 0 8px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
}
.modal p{
  margin:0 0 12px;
  color: rgba(42,28,18,.75);
}

.chk{
  display:flex;
  gap:10px;
  align-items:flex-start;
  border: 1px solid rgba(42,28,18,.22);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.55);
}
.chk input[type="checkbox"]{
  width:18px;
  height:18px;
  flex:0 0 18px;
  margin-top:3px;
}

.modalActions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
  margin-top: 12px;
}

.confirmBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(20,10,6,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 60;
}

.confirmModal{
  width: min(520px, 100%);
  background: rgba(243,230,200,.99);
  border: 1px solid rgba(42,28,18,.25);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.confirmModal h3{
  margin:0;
  font-size: clamp(22px, 3vw, 28px);
}

.confirmModal p{
  margin: 10px 0 0;
  color: rgba(42,28,18,.8);
  font: 600 15px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.confirmActions{
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px){
  .wrap{padding:16px}
  .days{flex-direction:column}
  .pill{
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 560px){
  #rsvp{padding: 10px}
  .btn{
    width: 100%;
    justify-content: center;
  }
  .modalActions .btn,
  .confirmActions .btn{
    width: 100%;
  }
}
