:root {
  --navy: #0c2a66;
  --navy-deep: #071a44;
  --blue: #0769b2;
  --sky: #0ea4d9;
  --gold: #ffca29;
  --orange: #f7941d;
  --red: #c70600;
  --ink: #0c2a66;
  --muted: #5b6b8c;
  --line: #d7e0f0;
  --card: #ffffff;
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: #fff;
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 50%, #0a4c8f 100%) fixed;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 85% -5%, rgba(255, 202, 41, .22), transparent 70%),
    radial-gradient(500px 420px at -10% 100%, rgba(14, 164, 217, .28), transparent 70%);
}
img { max-width: 100%; }

/* En-tête */
.top { position: relative; z-index: 1; padding: 18px 20px; display: flex; justify-content: center; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-badge {
  width: 46px; height: 46px; border-radius: 50%; background: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.brand-badge img { height: 34px; }
.brand-text { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 20px; letter-spacing: 2px; line-height: 1; }
.brand-text small { display: block; font-size: 11px; letter-spacing: 5px; color: var(--gold); margin-top: 4px; }

.wrap { position: relative; z-index: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 40px; flex: 1; }

/* Hero */
.hero { text-align: center; padding: 18px 0 26px; }
.hero-sm { padding-bottom: 18px; }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 202, 41, .14); border: 1px solid rgba(255, 202, 41, .45);
  color: var(--gold); font-family: 'Oswald', sans-serif; font-weight: 600; letter-spacing: 3px; font-size: 13px; text-transform: uppercase;
}
.hero h1 {
  font-family: 'Oswald', sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: clamp(32px, 8.5vw, 46px); line-height: 1.08; margin: 0 0 14px; letter-spacing: .5px;
}
.hero h1 span { color: var(--gold); }
.lead { margin: 0 auto; max-width: 440px; color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.6; }

/* Cartes */
.card {
  background: var(--card); color: var(--ink); border-radius: var(--radius);
  padding: 26px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.card h2 { font-family: 'Oswald', sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 18px; font-size: 24px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .form .row { grid-template-columns: 1fr; gap: 0; } }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #f7f9fd;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(7, 105, 178, .14); }
.themes { border: 0; padding: 0; margin: 4px 0 16px; min-width: 0; }
.themes legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip-wide { grid-column: 1 / -1; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px;
  padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: #f7f9fd;
  font-size: 13px; font-weight: 600; line-height: 1.25; transition: all .15s;
}
.chip:hover span { border-color: var(--sky); }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(12, 42, 102, .25); }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px rgba(7, 105, 178, .25); }
.theme-pill { display: inline-block; margin: 0 0 12px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 202, 41, .2); color: #8a5a00; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.err { display: block; color: var(--red); font-size: 12.5px; margin-top: 5px; font-weight: 500; }
.alert { background: #fff1f0; color: var(--red); border: 1px solid #ffd2cf; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fine { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; text-align: center; line-height: 1.5; }
.page-verset .fine, .center { text-align: center; }
.stage .fine { color: rgba(255,255,255,.7); }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer;
  border: 0; border-radius: 999px; padding: 15px 26px; transition: transform .12s, box-shadow .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn-gold { background: linear-gradient(180deg, #ffd650, var(--gold)); color: var(--navy); box-shadow: 0 10px 24px rgba(255, 202, 41, .35); }
.btn-gold:hover { box-shadow: 0 14px 30px rgba(255, 202, 41, .5); }
.btn-light { background: #fff; color: var(--navy); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.btn-block { width: 100%; margin-top: 6px; }
.link { color: var(--blue); font-weight: 600; text-decoration: none; font-size: 14px; }

/* Succès */
.success { text-align: center; }
.success p { line-height: 1.6; }
.success .btn { margin: 6px 0 12px; }
.hint { background: #fff8e1; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.icon-mail {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--navy); font-size: 30px;
}

.field .opt { font-style: normal; font-weight: 500; color: var(--muted); }
.field .help { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.icon-info { background: #e3f0fb; color: var(--blue); font-weight: 700; }

/* Étapes */
.steps { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.steps li { text-align: center; font-size: 12.5px; color: rgba(255,255,255,.8); line-height: 1.35; }
.steps b {
  display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%;
  border: 1.5px solid var(--gold); color: var(--gold); font-family: 'Oswald', sans-serif;
}

/* Carte verset (retournement) */
.stage { perspective: 1400px; }
.verse-card { position: relative; width: 100%; min-height: 440px; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.verse-card.flipped { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
}
.front {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,202,41,.25), transparent 60%),
    linear-gradient(160deg, #123a85, var(--navy));
  border: 2px solid rgba(255, 202, 41, .55);
}
.front .seal { width: 110px; height: 110px; object-fit: contain; background: #fff; border-radius: 50%; padding: 14px; margin-bottom: 18px; animation: pulse 2.4s ease-in-out infinite; }
.front-title { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 4px; color: var(--gold); margin: 0 0 22px; font-size: 18px; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,202,41,.5); } 50% { box-shadow: 0 0 0 16px rgba(255,202,41,0); } }
.back {
  transform: rotateY(180deg); color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f3f7ff);
  border: 2px solid var(--gold);
}
.back-for { margin: 0 0 14px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.back blockquote { margin: 0; font-style: italic; font-weight: 500; font-size: clamp(18px, 4.8vw, 22px); line-height: 1.55; color: var(--navy); }
.ref { margin: 20px 0 0; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 22px; letter-spacing: 2px; color: var(--orange); text-transform: uppercase; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.actions .btn { flex: 1 1 140px; white-space: nowrap; padding: 14px 16px; }
.actions .btn-wa { flex-basis: 100%; font-size: 16.5px; padding: 16px; }
.btn-wa { background: #25d366; color: #fff; box-shadow: 0 10px 24px rgba(37, 211, 102, .35); }
.btn-wa:hover { background: #1ebe5b; }
.wa-help { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: #fff; margin: 14px 0 0; }
.actions.in { animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Fenêtre d’aperçu */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(4, 12, 32, .85); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: 100%; max-width: 420px; }
.modal-box img { display: block; width: 100%; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5); margin-bottom: 14px; max-height: 75vh; object-fit: contain; }
.modal-close {
  position: absolute; top: -14px; right: -6px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: #fff; color: var(--navy); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

.foot { position: relative; z-index: 1; text-align: center; padding: 18px 16px 26px; font-size: 12.5px; color: rgba(255,255,255,.6); }

/* Admin */
.admin .wrap { max-width: 1100px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 12px 16px; min-width: 140px; }
.stat b { display: block; font-family: 'Oswald', sans-serif; font-size: 28px; color: var(--gold); }
.stat span { font-size: 12.5px; color: rgba(255,255,255,.8); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input { flex: 1 1 220px; font: inherit; padding: 11px 14px; border-radius: 999px; border: 0; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 16px; }
table { width: 100%; border-collapse: collapse; color: var(--ink); font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { background: #f3f6fc; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
td.wrap-cell { white-space: normal; min-width: 160px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.tag-ok { background: #e3f7ec; color: #11734b; }
.tag-no { background: #fff1f0; color: var(--red); }
.tag-wait { background: #eef3fb; color: var(--muted); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.notice { background: rgba(255,202,41,.15); border: 1px solid rgba(255,202,41,.5); padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
