/* public/css/index.css
   ════════════════════════════════════════════════════════════
   App 1 — RSVP  (palette dorée + velours brun)
   ════════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #D4AF37;
  --gold-d: #B8860B;
  --gold-l: #E8C547;
  --cream: #FFF7E8;
  --bg-1: #2D1100;
  --bg-2: #3D1A00;
  --bg-3: #1A0900;
  --error: #C77D7D;
  --ff-script: 'Great Vibes', cursive;
  --ff-serif: 'Cinzel', serif;
  --ff-body: 'Cormorant Garamond', serif;
}

html, body {
  min-height: 100%;
  font-family: var(--ff-body);
  color: var(--cream);
  background:
    radial-gradient(ellipse at top, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding:
    clamp(24px, 5vw, 48px)
    clamp(16px, 4vw, 32px)
    calc(48px + env(safe-area-inset-bottom));
}

/* ─── HEADER ─── */
.header { text-align: center; margin-bottom: clamp(24px, 4vw, 36px); }

.ornament {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 8px;
  margin-bottom: 14px;
  opacity: .8;
}

.header h1 {
  font-family: var(--ff-script);
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.05;
  margin-bottom: 14px;
}

.subtitle {
  font-family: var(--ff-serif);
  font-size: clamp(13px, 2.5vw, 15px);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .85;
}

.divider {
  position: relative;
  height: 1px;
  margin: clamp(24px, 4vw, 36px) auto;
  max-width: 280px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .55;
}

.gem {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: translate(-50%, -50%) rotate(45deg);
}

.intro {
  text-align: center;
  font-family: var(--ff-body);
  font-style: italic;
  font-size: clamp(15px, 3vw, 18px);
  line-height: 1.55;
  color: var(--cream);
  opacity: .85;
  margin-bottom: clamp(28px, 5vw, 40px);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ════════════════════════════════════════════════════════════
   FORMULAIRE RSVP
   ════════════════════════════════════════════════════════════ */

.form-card {
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(212, 175, 55, .25);
  border-radius: 16px;
  padding: clamp(24px, 5vw, 40px) clamp(20px, 4vw, 32px);
  max-width: 560px;
  margin: 0 auto;
}

.field { margin-bottom: clamp(18px, 3vw, 24px); }

.field label {
  display: block;
  font-family: var(--ff-serif);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  opacity: .9;
}

.field input,
.field select {
  width: 100%;
  padding: clamp(12px, 2.5vw, 16px);
  font-family: var(--ff-body);
  font-size: clamp(15px, 3vw, 17px);
  color: var(--cream);
  background: rgba(0, 0, 0, .35);
  border: 1.5px solid rgba(212, 175, 55, .3);
  border-radius: 8px;
  outline: none;
  transition: border-color .18s, background .18s;
}

.field input:focus,
.field select:focus {
  border-color: var(--gold);
  background: rgba(0, 0, 0, .45);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23D4AF37' d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 22px;
  padding-right: 40px;
}

.field-hint {
  font-family: var(--ff-body);
  font-style: italic;
  font-size: 13px;
  color: var(--cream);
  opacity: .55;
  margin-top: 6px;
}

.field.invalid input,
.field.invalid select {
  border-color: var(--error);
}

.error-msg {
  display: none;
  margin-top: 6px;
  font-family: var(--ff-body);
  font-style: italic;
  font-size: 13px;
  color: var(--error);
}

.field.invalid .error-msg { display: block; }

/* Honeypot anti-bot caché */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ─── Question oui/non ─── */

.question-box {
  margin: clamp(24px, 4vw, 32px) 0;
  padding: clamp(18px, 3vw, 24px);
  background: rgba(212, 175, 55, .06);
  border: 1px dashed rgba(212, 175, 55, .35);
  border-radius: 12px;
  text-align: center;
}

.question-box p {
  font-family: var(--ff-script);
  font-size: clamp(24px, 5vw, 32px);
  color: var(--gold);
  margin-bottom: 18px;
}

.radio-group {
  display: flex;
  gap: 14px;
  justify-content: center;
}

.radio-group label {
  flex: 0 0 auto;
  min-width: 110px;
  padding: 12px 28px;
  font-family: var(--ff-serif);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 1.5px solid rgba(212, 175, 55, .35);
  border-radius: 30px;
  cursor: pointer;
  transition: all .18s;
}

.radio-group label:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, .08);
}

/* Bouton OUI sélectionné = vert */
#lblOui.selected {
  background: #2e7d32;          /* vert foncé */
  color: #fff;
  border-color: #2e7d32;
  box-shadow: 0 4px 14px rgba(46, 125, 50, .35);
}

/* Bouton NON sélectionné = rouge */
#lblNon.selected {
  background: #c62828;          /* rouge foncé */
  color: #fff;
  border-color: #c62828;
  box-shadow: 0 4px 14px rgba(198, 40, 40, .35);
}

.radio-group input { display: none; }

/* ─── Submit button ─── */

.submit-btn {
  width: 100%;
  padding: clamp(14px, 3vw, 18px);
  font-family: var(--ff-serif);
  font-size: clamp(13px, 2.6vw, 15px);
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-d) 100%);
  color: var(--bg-3);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(212, 175, 55, .25);
  transition: transform .18s, box-shadow .18s;
  margin-top: 12px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, .35);
}

.submit-btn:active { transform: translateY(0); }

.submit-btn:disabled { opacity: .55; cursor: wait; transform: none; }

/* ════════════════════════════════════════════════════════════
   ÉCRAN DE SUCCÈS — IMPORTANT : visible par défaut UNIQUEMENT
   quand on lui ajoute display:block via JS
   ════════════════════════════════════════════════════════════ */

.success-screen {
  display: none;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  animation: fadeUp .6s ease-out both;
}

.success-screen.visible { display: block; }

.check {
  width: clamp(70px, 14vw, 92px);
  height: clamp(70px, 14vw, 92px);
  margin: 0 auto clamp(20px, 4vw, 28px);
  background: var(--gold);
  color: var(--bg-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(38px, 7vw, 52px);
  font-weight: 600;
  box-shadow: 0 0 40px rgba(212, 175, 55, .4);
}

.success-screen h2 {
  font-family: var(--ff-script);
  font-size: clamp(40px, 8vw, 60px);
  color: var(--cream);
  font-weight: 400;
  margin-bottom: 12px;
  line-height: 1;
}

.success-msg {
  font-family: var(--ff-body);
  font-style: italic;
  font-size: clamp(15px, 3vw, 18px);
  color: var(--cream);
  opacity: .8;
  margin-bottom: clamp(24px, 4vw, 32px);
}

/* ─── Bloc CODE (réponse "oui") ─── */

.code-block {
  display: none;
  margin-top: clamp(20px, 4vw, 32px);
  padding: clamp(20px, 4vw, 32px) clamp(18px, 4vw, 28px);
  background: linear-gradient(180deg,
              rgba(212, 175, 55, .10) 0%,
              rgba(212, 175, 55, .04) 100%);
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 16px;
  text-align: center;
}

.code-label {
  font-family: var(--ff-body);
  font-size: clamp(13px, 2.5vw, 15px);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  opacity: .9;
}

.code-display {
  display: inline-block;
  padding: clamp(14px, 3vw, 22px) clamp(20px, 5vw, 36px);
  margin: 6px auto 18px;
  font-family: var(--ff-serif);
  font-weight: 600;
  font-size: clamp(28px, 7vw, 42px);
  letter-spacing: clamp(6px, 1.6vw, 12px);
  color: var(--cream);
  background: rgba(0, 0, 0, .35);
  border: 1.5px dashed var(--gold);
  border-radius: 10px;
  user-select: all;
  -webkit-user-select: all;
}

.code-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.code-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  font-family: var(--ff-body);
  font-size: 14px;
  letter-spacing: 1.5px;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  transition: all .18s;
}

.code-btn:hover {
  background: rgba(212, 175, 55, .12);
  transform: translateY(-1px);
}

.code-btn:active { transform: translateY(0); }

.code-btn--wa {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}

.code-btn--wa:hover {
  background: #1ebe5a;
  border-color: #1ebe5a;
}

.btn-icon { font-size: 16px; line-height: 1; }

.code-warning {
  margin-top: 10px;
  font-family: var(--ff-body);
  font-size: clamp(13px, 2.6vw, 15px);
  font-style: italic;
  line-height: 1.55;
  color: var(--cream);
  opacity: .82;
}

.code-warning strong {
  font-style: normal;
  color: var(--gold);
  font-weight: 500;
}

/* ─── Bloc CTA "non" (réponse "non") ─── */

.cta-block {
  display: none;
  margin-top: clamp(20px, 4vw, 32px);
  padding: clamp(20px, 4vw, 32px) clamp(20px, 4vw, 28px);
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(212, 175, 55, .25);
  border-radius: 16px;
  text-align: center;
}

.cta-desc {
  font-family: var(--ff-body);
  font-style: italic;
  font-size: clamp(15px, 3vw, 17px);
  line-height: 1.6;
  color: var(--cream);
  opacity: .85;
}

/* ════════════════════════════════════════════════════════════
   ÉCRAN "RSVP FERMÉ"
   ════════════════════════════════════════════════════════════ */

.closed-card {
  margin-top: clamp(20px, 4vw, 32px);
  padding: clamp(28px, 5vw, 44px) clamp(20px, 4vw, 32px);
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(212, 175, 55, .25);
  border-radius: 16px;
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeUp .6s ease-out both;
}

.closed-icon {
  font-size: clamp(42px, 8vw, 56px);
  color: var(--gold);
  margin-bottom: 10px;
  opacity: .85;
}

.closed-card h2 {
  font-family: var(--ff-script);
  font-size: clamp(28px, 6vw, 38px);
  color: var(--gold);
  margin-bottom: 14px;
  font-weight: 400;
}

.closed-msg {
  font-family: var(--ff-body);
  font-size: clamp(14px, 2.8vw, 16px);
  line-height: 1.6;
  color: var(--cream);
  opacity: .85;
}

/* ════════════════════════════════════════════════════════════
   ÉCRAN "DÉJÀ ENREGISTRÉ"
   ════════════════════════════════════════════════════════════ */

.already-card {
  margin-top: clamp(20px, 4vw, 32px);
  padding: clamp(28px, 5vw, 44px) clamp(20px, 4vw, 32px);
  background: rgba(0, 0, 0, .25);
  border: 2px solid var(--error);
  border-radius: 16px;
  text-align: center;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeUp .6s ease-out both;
}

.already-icon {
  font-size: clamp(48px, 9vw, 64px);
  color: var(--error);
  margin-bottom: 12px;
  line-height: 1;
}

.already-card h2 {
  font-family: var(--ff-script);
  font-size: clamp(32px, 6vw, 42px);
  color: var(--error);
  margin-bottom: 8px;
  font-weight: 400;
}

.already-name {
  font-family: var(--ff-serif);
  font-size: clamp(16px, 3vw, 18px);
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 18px;
  font-weight: 500;
}

.already-msg {
  font-family: var(--ff-body);
  font-size: clamp(14px, 2.8vw, 16px);
  line-height: 1.6;
  color: var(--cream);
  opacity: .9;
  margin-bottom: clamp(20px, 4vw, 28px);
}

.already-msg strong {
  color: var(--gold);
  font-weight: 600;
}

.already-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--ff-serif);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 10px;
  background: #25D366;
  color: #fff;
  transition: all .18s;
}

.already-btn:hover {
  background: #1ebe5a;
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 22px;
  background: rgba(40, 30, 20, .95);
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 30px;
  font-family: var(--ff-body);
  font-size: 14px;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 1000;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════════════════════
   FOOTER + ANIMATIONS
   ════════════════════════════════════════════════════════════ */

.footer {
  text-align: center;
  margin-top: clamp(36px, 6vw, 60px);
  font-family: var(--ff-script);
  font-size: clamp(18px, 3.4vw, 22px);
  color: var(--gold);
  opacity: .55;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .code-actions { flex-direction: column; }
  .code-btn { width: 100%; justify-content: center; }
  .radio-group label { padding: 12px 20px; min-width: 100px; }
}
