:root {
  --palm: #12352c;
  --palm-2: #1c4a3d;
  --sand: #f5efe3;
  --sand-2: #e9dfca;
  --date: #8a4b22;
  --gold: #e0a458;
  --ink: #1f2a26;
  --muted: #5d6a64;
  --line: #d8ccb4;
  --red: #a4301f;
  --ok: #1d6b4f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sand); color: var(--ink); font: 16px/1.55 var(--sans); }
h1, h2 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; }
a { color: var(--date); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.kicker { margin: 0 0 .75rem; font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--gold); }

/* Accueil */
.home::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url("logo-snapo.png") no-repeat center / min(70vw, 620px); opacity: .07; }
.hero { position: relative; overflow: hidden; background: var(--palm); color: var(--sand); padding: 3.5rem 1.25rem 0; }
.hero::before { content: ""; position: absolute; top: 50%; right: max(-4rem, calc(50% - 620px)); width: min(46vw, 560px); aspect-ratio: 889 / 900; transform: translateY(-50%); background: url("logo-snapo.png") no-repeat center / contain; opacity: .16; }
.hero-inner { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; }
.hero-text { max-width: 620px; padding: 1.5rem 0 2.5rem; }
.arches { position: relative; }
.hero h1 { font-size: clamp(1.5rem, 7.4vw, 4rem); font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.hero h1 em { display: block; color: var(--gold); font-style: italic; }
.lead { font-size: 1.1875rem; max-width: 30em; margin: 0 0 .75rem; color: #dfe3d6; }
.patronage { margin: 0 0 2.25rem; font-size: .9375rem; font-style: italic; color: var(--gold); }
.facts { margin: 0; border-top: 1px solid rgb(245 239 227 / .25); }
.facts div { display: flex; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid rgb(245 239 227 / .25); }
.facts dt { flex: 0 0 5.5rem; color: var(--gold); font-size: .875rem; font-weight: 600; padding-top: .1rem; }
.facts dd { margin: 0; font-size: 1.0625rem; }
.arches { height: 72px; margin: 0 -1.25rem; background: url("arches.svg") repeat-x left bottom; }

.card { background: #fff; color: var(--ink); border-radius: 14px; padding: 2rem; box-shadow: 0 18px 50px rgb(18 53 44 / .22); }
dialog.form-card { position: fixed; width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); margin: auto; overflow-y: auto; border: 0; }
dialog.form-card::backdrop { background: rgb(10 30 25 / .72); }
html:not(.js) dialog.form-card:target { display: block; position: static; margin: 2rem auto 0; }
.dialog-close { position: absolute; top: .6rem; right: .6rem; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.75rem; line-height: 1; cursor: pointer; }
.dialog-close:hover { background: var(--sand-2); color: var(--ink); }
.dialog-close:focus-visible { outline: 3px solid var(--gold); }
.btn-cta { min-height: 56px; margin-top: 1.75rem; padding: .6rem 2.25rem; font-size: 1.125rem; }
.form-card h2 { font-size: 1.875rem; margin-bottom: .25rem; color: var(--palm); }
.form-card > .muted { margin: 0 0 1.25rem; font-size: .9375rem; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .875rem; }
.field { margin-bottom: 1rem; min-width: 0; }
label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .3rem; }
.hint { font-weight: 400; color: var(--muted); }
input, select { width: 100%; min-height: 46px; padding: .6rem .75rem; font: inherit; color: inherit; background: #fff; border: 1px solid #b9ad96; border-radius: 8px; }
input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); }
.field-error { margin: .3rem 0 0; color: var(--red); font-size: .875rem; }
.form-alert { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 8px; background: #fbeae6; color: var(--red); font-size: .9375rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; font-size: .875rem; color: var(--muted); margin: 0; }
.check input { flex: 0 0 auto; width: 20px; height: 20px; min-height: 0; margin: .1rem 0 0; accent-color: var(--palm); }
.honeypot { position: absolute; inset-inline-start: -9999px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .55rem 1.1rem; border: 1px solid transparent; border-radius: 8px; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--palm); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--palm-2); }
.btn-ghost { background: transparent; color: var(--palm); border-color: var(--palm); }
.btn-ghost:hover { background: var(--sand-2); }
.btn-ghost-light { background: transparent; color: var(--sand); border-color: rgb(245 239 227 / .6); }
.btn-danger { background: transparent; color: var(--red); border-color: transparent; }
.btn-danger:hover { background: #fbeae6; }
.btn-gold { background: var(--gold); color: var(--palm); }
.btn-gold:hover { background: #ebb573; }
.btn-wide { width: 100%; }
.btn-big { min-height: 60px; font-size: 1.125rem; margin-top: 1rem; }
.btn-small { min-height: 36px; padding: .25rem .65rem; font-size: .875rem; }

.content { max-width: 1080px; margin: 0 auto; padding: 3.5rem 1.25rem 3rem; display: grid; grid-template-columns: 1.05fr 1fr; gap: 3.5rem; }
.content h2 { font-size: 1.75rem; color: var(--palm); }
.content .program, .content .partners { grid-column: 1 / -1; }
.program-cta { margin: 0; text-align: center; }
.partner-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.partner-grid li { display: grid; place-items: center; height: 112px; padding: .875rem 1rem; background: #fff; border: 1px solid var(--sand-2); border-radius: 10px; text-align: center; }
.partner-grid img { display: block; max-width: 100%; max-height: 76px; width: auto; height: auto; }
.partner-grid span { font: 500 1.125rem/1.2 var(--serif); color: var(--palm); }
.themes { list-style: none; margin: 0; padding: 0; }
.themes li { padding: 1rem 0; border-top: 1px solid var(--line); }
.themes h3 { margin: 0 0 .35rem; font: 500 1.3125rem/1.25 var(--serif); color: var(--palm); }
.themes p { margin: 0 0 .35rem; }
.themes .theme-num { margin: 0 0 .15rem; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--date); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 1.25rem 3.25rem; min-height: 3rem; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--date); color: #fff; font-family: var(--serif); font-size: 1.125rem; }
.steps strong, .steps span { display: block; }
.steps span { color: var(--muted); }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .8rem .875rem; border-bottom: 1px solid var(--line); }
.agenda li.is-theme { background: var(--sand-2); }
.agenda p { margin: .1rem 0 0; color: var(--muted); }
.agenda-time { font-weight: 600; color: var(--date); font-variant-numeric: tabular-nums; }
.footer { padding: 1.5rem 1.25rem; text-align: center; font-size: .875rem; color: var(--muted); border-top: 1px solid var(--line); }
.footer p { margin: .25rem 0; }

/* Pages centrées */
.page-center { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: var(--palm); }
.narrow { width: 100%; max-width: 440px; }
.center { text-align: center; }
.narrow h1 { font-size: 1.75rem; color: var(--palm); }
.otp-resend { margin-top: .625rem; }
.tick { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; font-size: 2.25rem; font-weight: 700; color: #fff; }
.tick-ok { background: var(--ok); }
.tick-warn { background: #b86e12; }
.verify-name { font-family: var(--serif); font-size: 1.5rem; margin: .25rem 0; }

/* Badge */
.badge { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; overflow: hidden; text-align: center; box-shadow: 0 18px 50px rgb(0 0 0 / .3); }
.badge-head { padding: 1.5rem; background: var(--date); color: #fff; }
.badge-head .kicker { color: #f6dcb8; margin-bottom: .4rem; }
.badge-head h1 { font-size: 1.375rem; margin: 0; }
.badge-body { padding: 1.25rem 1.5rem .5rem; }
.badge-body img { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; }
.badge-name { font-family: var(--serif); font-size: 1.625rem; margin: .5rem 0 0; }
.badge-body .muted { margin: .1rem 0; }
.badge-place { margin: .5rem 0 0; font-weight: 600; }
.badge-note { margin: 0; padding: .5rem 1.5rem 1rem; font-size: .875rem; color: var(--muted); }
.badge-actions { padding: 0 1.5rem 1.5rem; }
@media print {
  .page-center { background: #fff; display: block; }
  .badge { box-shadow: none; border: 1px solid #999; margin: 0 auto; }
  .badge-head { background: #fff; color: #000; }
  .badge-head .kicker { color: #000; }
  .no-print { display: none; }
}

/* Espace organisateur */
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem; background: var(--palm); color: var(--sand); }
.admin-bar h1 { font-size: 1.5rem; margin: 0; }
.admin-bar .kicker { margin-bottom: .1rem; }
.admin-main { max-width: 1240px; margin: 0 auto; padding: 1.25rem; }
.notice { margin: 0 0 .75rem; padding: .7rem .9rem; border-radius: 8px; font-size: .9375rem; }
.notice-warn { background: #fbf0d9; color: #6e4a0c; }
.notice-ok { background: #e1f1e9; color: var(--ok); }
.notice-err { background: #fbeae6; color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1rem 0; }
.stats div { background: #fff; border-radius: 10px; padding: .875rem 1rem; }
.stats dt { font-size: .875rem; color: var(--muted); }
.stats dd { margin: 0; font: 500 2rem/1.2 var(--serif); color: var(--palm); }
.toolbar { display: flex; flex-wrap: wrap; gap: .625rem; margin-bottom: 1rem; }
.toolbar input { flex: 1 1 240px; width: auto; }
.table-wrap { background: #fff; border-radius: 10px; overflow-x: auto; }
.people { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.people th { text-align: left; font-size: .8125rem; color: var(--muted); font-weight: 600; padding: .7rem .875rem; border-bottom: 1px solid var(--line); }
.people td { padding: .7rem .875rem; border-bottom: 1px solid var(--sand-2); vertical-align: top; overflow-wrap: anywhere; }
.people tr:last-child td { border-bottom: 0; }
.actions { min-width: 280px; }
.actions, .actions form { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.tag-wait { background: #fbf0d9; color: #6e4a0c; }
.tag-sent { background: #e6ecf5; color: #27476f; }
.tag-present { background: #e1f1e9; color: var(--ok); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); background: #fff; border-radius: 10px; }

/* Choix de langue */
.lang-switch a { display: inline-flex; align-items: center; min-height: 44px; padding: .25rem .9rem; border-radius: 99px; font-weight: 600; text-decoration: none; }
.lang-switch a[lang="ar"] { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; font-size: 1.0625rem; }
.lang-switch-hero { position: absolute; top: .75rem; inset-inline-end: 1rem; z-index: 2; }
.lang-switch-hero a { color: var(--sand); border: 1px solid rgb(245 239 227 / .45); }
.lang-switch-hero a:hover { background: rgb(245 239 227 / .12); }
.footer .lang-switch, .narrow .lang-switch, .badge-actions .lang-switch { margin-top: .5rem; }
.footer .lang-switch a, .narrow .lang-switch a, .badge-actions .lang-switch a { color: var(--date); }

/* Arabe : lecture de droite à gauche */
html[lang="ar"] {
  --serif: "Sakkal Majalla", "Traditional Arabic", "Noto Naskh Arabic", "Amiri", "Times New Roman", serif;
  --sans: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}
html[lang="ar"] body { font-size: 17px; line-height: 1.7; }
html[lang="ar"] .kicker, html[lang="ar"] .themes .theme-num { letter-spacing: 0; text-transform: none; font-size: .9375rem; }
html[lang="ar"] .hero h1 { font-size: clamp(1.6rem, 7.4vw, 4.25rem); font-weight: 700; }
html[lang="ar"] .hero h1 em, html[lang="ar"] .patronage { font-style: normal; }
html[lang="ar"] .content h2, html[lang="ar"] .form-card h2, html[lang="ar"] .themes h3 { font-weight: 700; }
[dir="rtl"] .hero::before { right: auto; left: max(-4rem, calc(50% - 620px)); }
[dir="rtl"] .dialog-close { right: auto; left: .6rem; }
[dir="rtl"] .steps li { padding: 0 3.25rem 1.25rem 0; }
[dir="rtl"] .steps li::before { left: auto; right: 0; }
[dir="rtl"] input[dir="ltr"] { text-align: right; }

@media (max-width: 860px) {
  [dir="rtl"] .hero::before { left: -30vw; right: auto; }
  .hero { padding-top: 2rem; }
  .content { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.5rem; }
  .hero-text { padding-top: 0; }
  .hero::before { width: 88vw; right: -30vw; }
  .btn-cta { width: 100%; }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .people thead { display: none; }
  .people, .people tbody, .people tr, .people td { display: block; }
  .people tr { padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .people td { border: 0; padding: .25rem .875rem; }
  .actions { min-width: 0; padding-top: .25rem; }
}
@media (max-width: 420px) {
  .row { grid-template-columns: 1fr; }
  .agenda li { grid-template-columns: 1fr; gap: .1rem; }
  .card { padding: 1.5rem 1.25rem; }
}
