/* Tournez la Page — souscription de parts sociales
   Palette de la librairie : bleu marine, bleu acier, fond crème. */

:root {
  --navy: #1E3A5F;
  --navy-dark: #142a46;
  --steel: #4A7FA5;
  --steel-soft: #e4edf4;
  --cream: #F5F3EF;
  --paper: #ffffff;
  --ink: #1f2a37;
  --muted: #5d6b7a;
  --line: #d8d3c8;
  --line-soft: #ece8df;
  --danger: #8f2a2a;
  --danger-soft: #f9e6e4;
  --ok: #1d6b4a;
  --ok-soft: #e1f1e9;
  --warn: #7a5200;
  --warn-soft: #fbefd2;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --w: 720px;
  color-scheme: light;
}

body.admin { --w: 1200px; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--navy); }

:focus-visible { outline: 3px solid var(--steel); outline-offset: 2px; }

/* ── En-tête et pied de page ── */

.site-header { background: #fffffd; color: var(--navy); border-bottom: 3px solid var(--navy); }
.site-header__inner {
  max-width: var(--w);
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 14px; }
.brand__logo { display: block; height: 64px; width: auto; }
.brand__tag { font-family: var(--serif); font-style: italic; color: var(--steel); }

/* Bandeau illustré de la page de souscription */
.hero { background: #eef4f7; line-height: 0; }
.hero__img { display: block; width: 100%; height: clamp(150px, 30vw, 340px); object-fit: cover; object-position: 50% 80%; }

.site-footer { color: var(--muted); font-size: 0.85rem; text-align: center; }
.site-footer__inner { max-width: var(--w); margin: 0 auto; padding: 20px 16px 32px; border-top: 1px solid var(--line); }
.site-footer strong { color: var(--navy); font-family: var(--serif); }

.container { width: 100%; max-width: var(--w); margin: 0 auto; padding: 28px 16px 40px; flex: 1; }

/* ── Titres et textes ── */

h1 {
  font-family: var(--serif);
  color: var(--navy);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
h2 { font-family: var(--serif); color: var(--navy); font-size: 1.25rem; margin: 0 0 0.9rem; }
.lead { color: var(--muted); max-width: 62ch; margin: 0 0 1.5rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }
.note { margin: 0 0 1.25rem; }
.muted { color: var(--muted); font-size: 0.82rem; }
.optional { font-weight: 400; color: var(--muted); }
.mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* ── Présentation (page de souscription) ── */

body.landing { --w: 780px; }
.intro { margin-bottom: 8px; }
.intro p { max-width: 65ch; }
.intro h1, .intro .eyebrow, .intro .lead--center, .intro .intro__cta { text-align: center; max-width: none; }
.intro h1 { margin-bottom: 0.4rem; }
.intro h2 { margin-top: 2rem; }
.eyebrow { margin: 0 0 0.4rem; color: var(--steel); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.82rem; }
.lead--center { font-family: var(--serif); font-style: italic; font-size: 1.15rem; max-width: none; margin-bottom: 1.1rem; }
.intro__cta { margin: 0 0 2rem; }
.form-title { margin-top: 2.2rem; scroll-margin-top: 16px; }

/* Chapitres : texte à gauche, illustration d'un livre qui tourne ses pages à droite */
.chapter { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 8px 28px; align-items: center; margin: 0 0 2rem; }
.chapter h2 { margin: 0 0 0.6rem; }
.chapter p { margin: 0; }
.chapter__label { margin: 0 0 4px !important; color: var(--steel); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.78rem; }
.chapter__art { width: 210px; height: auto; display: block; }
.goal { color: var(--navy); background: var(--steel-soft); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }

.benefits { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.benefit { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--steel); border-radius: 6px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.benefit strong { color: var(--navy); font-family: var(--serif); font-size: 1.05rem; line-height: 1.3; }
.benefit span:last-child { color: var(--muted); font-size: 0.92rem; }
.benefit__icon { width: 38px; height: 38px; border-radius: 50%; background: var(--steel-soft); color: var(--navy); font-family: var(--serif); font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }

.quote { max-width: none; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--navy); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 8px; margin: 1.5rem 0 0; }

/* ── Panneaux et formulaire ── */

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.form { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* évite le zoom automatique sur iPhone */
  padding: 10px 12px;
  border: 1px solid #b4aea2;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 100px; }
.field.has-error input { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 0.85rem; margin: 4px 0 0; }

/* Champ piège anti-robots : hors écran, jamais visible. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--steel-soft);
  border-radius: 4px;
  padding: 14px 16px;
  font-weight: 600;
}
.total output { font-family: var(--serif); font-size: 1.7rem; color: var(--navy); font-variant-numeric: tabular-nums; }

/* ── Boutons ── */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  padding: 11px 20px;
  border: 1px solid var(--navy);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--navy-dark); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn--block { display: block; width: 100%; padding: 13px 20px; font-size: 1.05rem; }
.btn--ghost { background: transparent; color: var(--navy); }
.btn--ghost:hover { background: var(--steel-soft); }
.btn--small { padding: 6px 12px; font-size: 0.88rem; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.inline-form { margin: 0; }

/* ── Messages ── */

.alert { border-radius: 4px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert--error { background: var(--danger-soft); color: #6b1f1f; border-color: #e3b9b5; }
.alert--ok { background: var(--ok-soft); color: #14513a; border-color: #b9dccb; }
.alert--warn { background: var(--warn-soft); color: var(--warn); border-color: #ecd9a4; }

/* ── Récapitulatif et coordonnées bancaires ── */

.summary { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }

.bank { border: 1px dashed var(--steel); border-radius: 4px; padding: 4px 16px; }
.bank__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.bank__row:last-child { border-bottom: 0; }
.bank__label { flex: 0 0 150px; color: var(--muted); font-size: 0.9rem; }
.bank__value { flex: 1 1 200px; font-weight: 600; overflow-wrap: anywhere; }

/* ── Administration ── */

.login { max-width: 380px; margin: 24px auto; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.stat__label { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat__value { font-family: var(--serif); font-size: 1.9rem; color: var(--navy); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat__sub { color: var(--muted); font-size: 0.82rem; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.pill:hover { background: var(--steel-soft); }
.pill[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; min-width: 940px; font-size: 0.92rem; }
th {
  text-align: left;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #faf9f6;
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tfoot td { font-weight: 600; background: #faf9f6; border-bottom: 0; }
th.num, td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
td.empty { text-align: center; color: var(--muted); padding: 28px 12px; }

.message summary { cursor: pointer; color: var(--steel); font-size: 0.85rem; margin-top: 4px; }
.message p { margin: 6px 0 0; max-width: 40ch; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge--en_attente { background: var(--warn-soft); color: var(--warn); }
.badge--virement_recu { background: var(--steel-soft); color: #24557a; }
.badge--valide { background: var(--ok-soft); color: var(--ok); }

.status-form { display: flex; gap: 6px; margin: 8px 0 0; }
.status-form select { font: inherit; font-size: 0.88rem; padding: 5px 6px; border: 1px solid #b4aea2; border-radius: 4px; background: var(--paper); color: var(--ink); }

/* ── Mobile ── */

@media (max-width: 560px) {
  .grid--2 { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .brand__logo { height: 52px; }
  .brand__tag { font-size: 0.85rem; }
  .benefits { grid-template-columns: 1fr; }
  .chapter { grid-template-columns: 1fr; }
  .chapter__art { width: 170px; margin: 4px auto 0; }
  .bank__label { flex-basis: 100%; }
  .total output { font-size: 1.5rem; }
}
