/* Layout: a whitewashed page (Sidi Bou Said). The petition story sits on one side and
   the signature card on the other, with a blue counter panel.
   Colours come from the association's logo: Tunisian red and Luxembourg blue. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face {
  font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  --wall: #F5F8FB;        /* whitewashed page */
  --surface: #FFFFFF;
  --ink: #0F1E33;
  --muted: #55657C;
  --line: #DCE3EC;
  --line-strong: #B9C5D4;
  --logo-red: #E30613;    /* from the logo, used sparingly */
  --logo-blue: #139FDB;   /* from the logo: progress and highlights */
  --action: #0A6AA8;      /* buttons and links: logo blue, deep enough for white text */
  --action-hover: #08578A;
  --action-soft: #E6F2FA;
  --panel: #0B4F86;        /* Sidi Bou Said blue: counter panel */
  --on-panel: #FFFFFF;
  --success: #2E7D4F;     /* jasmine leaf */
  --success-fill: #2E7D4F; /* filled green button, white text in both themes */
  --success-soft: #E5F3EA;
  --danger: #B42318;
  --danger-soft: #FDEDEB;
  --ring: rgba(19, 159, 219, .35);

  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(15, 30, 51, .05), 0 12px 32px rgba(15, 30, 51, .07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --wall: #0A1220;
    --surface: #101B2B;
    --ink: #E8EEF6;
    --muted: #9CAAC0;
    --line: #22324A;
    --line-strong: #3A4D69;
    --action: #2F80C9;
    --action-hover: #4A93D6;
    --action-soft: #142A44;
    --panel: #12497C;
    --success: #5CBF85;
    --success-soft: #133325;
    --danger: #FF8A80;
    --danger-soft: #3A1715;
    --ring: rgba(19, 159, 219, .45);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wall);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
html[lang=ar] body { font-family: var(--font-ar); font-size: 1.0625rem; line-height: 1.8; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: var(--action); text-underline-offset: 3px; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 3px solid var(--logo-blue); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
main.wrap { flex: 1; }
@media (min-width: 640px) { .wrap { padding-inline: 24px; } }

/* Header: the red-and-blue rule echoes the two bars of the logo. */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; }
.site-header::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--logo-red) 0 50%, var(--logo-blue) 50% 100%);
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; min-height: 72px; padding-block: 12px 8px; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
/* "Revenir sur le site": back to the association's website. */
.back-site {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 14px; border-radius: 999px; background: var(--action-soft); color: var(--action);
  font-weight: 600; font-size: .9375rem; text-decoration: none;
}
.back-site:hover { background: var(--action); color: #FFFFFF; }
[dir=rtl] .icon-back { transform: scaleX(-1); }
@media (max-width: 420px) { .back-site, .lang-switch { padding: 5px 11px; font-size: .875rem; } }
.brand { display: flex; align-items: center; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; height: 40px; width: auto; max-width: 60vw; }
.lang-switch {
  flex: none; font-weight: 600; font-size: .9375rem; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 16px;
}
.lang-switch:hover { border-color: var(--action); color: var(--action); }
html[lang=fr] .lang-switch { font-family: var(--font-ar); }
html[lang=ar] .lang-switch { font-family: var(--font); }

/* Flags */
.flags { display: inline-flex; gap: 6px; flex: none; }
.flag { display: block; width: 24px; height: 16px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(15, 30, 51, .14); }

/* Home */
/* The association's banner: a light "postcard" with a thin frame, in both themes. */
.cover { padding-top: 20px; }
.cover-img, .card-banner {
  display: block; width: 100%; height: auto; border-radius: var(--radius-lg);
  background: #F2FAFC; box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
/* Cropped to a slim strip around the name and the landscape, so the petition stays above the fold. */
.cover-img, .card-banner { object-fit: cover; object-position: 50% 30%; }
.card-banner { aspect-ratio: 9 / 2; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
@media (min-width: 640px) { .cover-img { aspect-ratio: 6 / 1; } }
@media (min-width: 920px) { .cover { padding-top: 24px; } }

.home { display: grid; gap: 32px; padding-block: 32px 72px; }
.hero { display: grid; gap: 16px; justify-items: start; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px; padding-inline-start: 8px; border-radius: 18px; /* a pill on one line, rounded box if it wraps */
  background: var(--surface); border: 1px solid var(--line);
  font-size: .875rem; font-weight: 600;
}
.eyebrow .flag { width: 27px; height: 18px; }
h1 { font-size: clamp(2rem, 1.25rem + 3.2vw, 3.25rem); line-height: 1.1; letter-spacing: -0.022em; }
html[lang=ar] h1 { letter-spacing: 0; line-height: 1.35; }
.lead { font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem); color: var(--muted); max-width: 60ch; }
.story { display: grid; gap: 16px; max-width: 65ch; }
/* Honeypot: invisible to people and assistive technology, filled in by robots. */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.organizers { font-size: .9375rem; color: var(--muted); max-width: 60ch; }
.organizers a { color: var(--ink); font-weight: 600; }
.organizers a:hover { color: var(--action); }
.footer-org a { color: inherit; }
.story h2 { font-size: 1.375rem; }
.story h2:not(:first-child) { margin-top: 12px; }
/* "Our demands": the requests stand out in a blue-edged box. */
.demands {
  display: grid; gap: 10px; margin: 0; padding: 16px 20px; padding-inline-start: 40px;
  background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--logo-blue);
  border-radius: var(--radius); font-weight: 600;
}
.demands li::marker { color: var(--logo-blue); }
@media (min-width: 920px) {
  .home { grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "hero card" "story card"; column-gap: 56px; row-gap: 40px; padding-block: 48px 96px; }
  .hero { grid-area: hero; padding-top: 24px; }
  .story { grid-area: story; align-self: start; }
  .sign-card { grid-area: card; align-self: start; position: sticky; top: 24px; }
}

/* Signature card: a white card with the blue counter panel on top. */
.sign-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 12px; display: grid; gap: 4px;
}
.counter-panel {
  background: var(--panel); color: var(--on-panel); text-align: center;
  border-radius: 14px;
  padding: 28px 24px 26px;
}
.counter-panel .count { justify-content: center; }
.counter-panel .count strong { color: var(--on-panel); font-size: 3rem; }
.counter-panel .count-label, .counter-panel .count-goal, .counter-panel .recent { color: rgba(255, 255, 255, .82); }
.counter-panel .progress { background: rgba(255, 255, 255, .2); }
.counter-panel .progress-bar { background: #FFFFFF; }
.counter-panel .recent { font-weight: 600; color: #FFFFFF; }
.sign-form { display: grid; gap: 12px; padding: 20px 8px 8px; }
.trust {
  display: flex; gap: 8px; align-items: flex-start; font-size: .8125rem; color: var(--muted);
  padding: 4px 8px 8px;
}
.trust .icon { flex: none; margin-top: 3px; color: var(--success); }

/* Progress */
.progress-block { display: grid; gap: 12px; }
.count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.count strong { font-size: 2.25rem; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.count-label { font-weight: 600; }
.count-goal { flex-basis: 100%; color: var(--muted); font-size: .9375rem; }
.progress { height: 10px; background: var(--action-soft); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; min-width: 6px; background: var(--logo-blue); border-radius: 999px; }
.recent { font-size: .875rem; color: var(--success); }

/* Cards and pages */
.page-narrow { max-width: 640px; margin-inline: auto; padding-block: 32px 72px; }
@media (min-width: 640px) { .page-narrow { padding-block: 56px 96px; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: clamp(20px, 5vw, 40px); display: grid; gap: 20px;
}
.card h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); }
.intro { color: var(--muted); }
.prose { display: grid; gap: 14px; max-width: 65ch; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: .8125rem; color: var(--muted); }
.steps li { display: grid; gap: 8px; }
.steps li::before { content: ""; height: 4px; border-radius: 999px; background: var(--line); }
.steps li.done::before, .steps li.active::before { background: var(--logo-blue); }
.steps li.active { color: var(--ink); font-weight: 600; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 24px; border: 0; border-radius: var(--radius);
  background: var(--action); color: #FFFFFF; font: inherit; font-weight: 600; text-align: center;
  text-decoration: none; cursor: pointer; transition: background-color .15s ease, transform .1s ease;
}
.button:hover { background: var(--action-hover); color: #FFFFFF; }
.button:active { transform: translateY(1px); }
.button.secondary { background: transparent; color: var(--action); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.button.secondary:hover { box-shadow: inset 0 0 0 1.5px var(--action); }
form { display: grid; gap: 20px; }
form .button { width: 100%; }

/* Fields */
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .choice legend { font-weight: 600; font-size: .9375rem; }
.optional { font-weight: 400; color: var(--muted); font-size: .875rem; }
.hint { color: var(--muted); font-size: .875rem; }
.error { color: var(--danger); font-size: .875rem; font-weight: 600; }
.field input {
  width: 100%; min-height: 50px; padding: 10px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:hover { border-color: var(--muted); }
.field input:focus { outline: none; border-color: var(--logo-blue); box-shadow: 0 0 0 4px var(--ring); }
.field input[readonly] { background: var(--wall); }
.field.has-error input { border-color: var(--danger); }
[dir=rtl] .field input[dir=ltr] { text-align: right; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

/* ID card / passport choice */
.choice { border: 0; padding: 0; margin: 0; }
.choice legend { padding: 0; margin-bottom: 6px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-option { position: relative; display: block; cursor: pointer; }
.choice-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice-option span {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  font-weight: 600; transition: border-color .15s ease, background-color .15s ease;
}
.choice-option span::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface); transition: border .15s ease;
}
.choice-option:hover span { border-color: var(--muted); }
.choice-option input:checked + span { border-color: var(--action); background: var(--action-soft); box-shadow: inset 0 0 0 1px var(--action); }
.choice-option input:checked + span::before { border: 5px solid var(--action); }
.choice-option input:focus-visible + span { outline: 3px solid var(--logo-blue); outline-offset: 2px; }
.choice.has-error .choice-option span { border-color: var(--danger); }
@media (max-width: 400px) { .choices { grid-template-columns: 1fr; } }

/* Form sections */
.form-section { display: grid; gap: 16px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 24px; }
.section-title { font-size: 1.0625rem; }
.consent { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--wall); }
.consent label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.consent input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--action); }
.consent.has-error { border-color: var(--danger); background: var(--danger-soft); }
.alert { padding: 12px 16px; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* Thank-you page */
.success-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.share { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 24px; }
.share-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.share-buttons a {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 14px;
  border-radius: var(--radius); font-weight: 600; text-decoration: none; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: box-shadow .15s ease;
}
.share-buttons a:hover { box-shadow: inset 0 0 0 1.5px var(--action); color: var(--action); }
.share-buttons a.share-whatsapp { background: var(--success-fill); color: #FFFFFF; box-shadow: none; }
.share-buttons a.share-whatsapp:hover { filter: brightness(1.08); color: #FFFFFF; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .875rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 24px 32px; }
.footer-org { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; }
.footer-mark { flex: none; width: 40px; height: 40px; border-radius: 10px; background: #FFFFFF; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--action); }
/* Mentions required by art. 1 of the statutes: legal form, seat, R.C.S. number. */
.footer-legal { flex-basis: 100%; font-size: .8125rem; }

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