/* App PremDrive : charte graphique v2.0 (octobre 2026).
   Crème et blanc dominent, l'encre écrit, le bronze souligne (jamais de texte bronze sur fond clair, jamais d'aplat).
   Ladies Days : mêmes formes, ses propres couleurs ; on ne mélange jamais les deux palettes. */

@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/playfair-display-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 600; font-display: swap; src: url("/static/fonts/playfair-display-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/poppins-latin-600-normal.woff2") format("woff2"); }

:root {
  --creme: #FAF6F0;
  --sable: #F3EBDF;
  --blanc: #FFFFFF;
  --encre: #1E1915;
  --texte: #5A5048;
  --accent: #BB9065;        /* bronze : pastilles, puces, route, soulignements (jamais de texte sur fond clair) */
  --accent-texte: #A47648;  /* bronze italique : sur-titres et mots d'accent, 20 px et plus */
  --lisere: #E6D9C7;
  --taupe: #8C8077;
  --brun: #7A5C3E;
  --bronze-clair: #E2D8C7;
  --noir-tuiles: #0F1017;
  --ok: #3F6B4A;
  --alerte: #9A4B2E;
  --ombre: 0 10px 30px rgba(30, 25, 21, 0.06);
  --r-carte: 24px;
  --r-photo: 28px;
  --r-faq: 20px;
  --r-champ: 14px;
}

[data-brand="ladies"] {
  --creme: #FBF6F2;
  --sable: #F4E1E6;
  --encre: #6F2940;
  --accent: #C9798E;
  --accent-texte: #C9798E;
  --lisere: #EFD7DE;
  --taupe: #9C7F88;
  --bronze-clair: #F4E1E6;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--texte);
  font: 400 16px/1.7 "Poppins", system-ui, sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--encre); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }
a:hover { text-decoration-color: var(--encre); }
p { margin: 0 0 1em; max-width: 70ch; }

h1, h2, h3, .serif {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  color: var(--encre);
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h1 em, h2 em, h3 em { color: var(--accent-texte); font-style: italic; }
.surtitre {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  color: var(--accent-texte);
  margin: 0 0 0.3em;
  letter-spacing: -0.01em;
}
.chapo { font-size: 1.08rem; max-width: 62ch; }
.muted { color: var(--taupe); }
.small { font-size: 0.875rem; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--creme) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--lisere);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--encre); }
.brand img { height: 48px; width: auto; }
.brand .brand-text { font-family: "Playfair Display", Georgia, serif; font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.nav a {
  text-decoration: none; color: var(--encre); font-weight: 600; font-size: 0.93rem;
  padding: 8px 14px; border-radius: 999px; transition: background 0.2s;
}
.nav a:hover { background: var(--sable); }
.nav a.active { background: var(--blanc); box-shadow: inset 0 0 0 1px var(--lisere); }
.who { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.who form { margin: 0; }
.menu-toggle { display: none; }

.switch-brand { display: inline-flex; border: 1px solid var(--lisere); border-radius: 999px; padding: 3px; background: var(--blanc); }
.switch-brand button { border: 0; background: transparent; font: 600 0.8rem "Poppins", sans-serif; color: var(--texte); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.switch-brand button[aria-pressed="true"] { background: var(--encre); color: #fff; }

/* ---------- Mise en page ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 64px; }
main.narrow { max-width: 560px; }
.section { padding: clamp(32px, 5vw, 56px) 0; }
.band { margin: 0 calc(-1 * clamp(16px, 4vw, 48px)); padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 48px); }
.band-sable { background: var(--sable); }
.band-creme { background: var(--creme); }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.page-head { padding: clamp(28px, 4vw, 48px) 0 12px; }

/* ---------- Ouverture et route ondulée ---------- */
.ouverture { text-align: center; padding: clamp(36px, 6vw, 72px) 0 0; position: relative; }
.ouverture .chapo { margin: 0 auto 1.4em; }
.route { display: block; width: calc(100% + 2 * clamp(16px, 4vw, 48px)); margin: 24px calc(-1 * clamp(16px, 4vw, 48px)) 0; height: 64px; }
.route .trait { fill: none; stroke: var(--encre); stroke-width: 7; stroke-linecap: round; }
.route .bande { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; }
.route-fond { background: var(--bronze-clair); height: 18px; margin: -4px calc(-1 * clamp(16px, 4vw, 48px)) 0; }

/* ---------- Cartes ---------- */
.card {
  background: var(--blanc);
  border: 1px solid var(--lisere);
  border-radius: var(--r-carte);
  box-shadow: var(--ombre);
  padding: clamp(20px, 3vw, 32px);
}
.card h2, .card h3 { margin-top: 0; }
.card-photo { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-photo .photo { position: relative; aspect-ratio: 3 / 2; background: var(--sable); }
.card-photo .photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .photo .tag { position: absolute; top: 14px; left: 14px; }
.card-photo .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-photo .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.85rem; }
.card-mini { padding: 18px 20px; }
.stat { font-family: "Playfair Display", Georgia, serif; font-size: 2.2rem; color: var(--encre); line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--taupe); margin-top: 6px; }

/* Ligne d'agenda */
.agenda { display: flex; align-items: center; gap: 20px; padding: 18px 22px; background: rgba(255, 255, 255, 0.75); border: 1px solid var(--lisere); border-radius: var(--r-photo); }
.agenda + .agenda { margin-top: 12px; }
.agenda .date { font-family: "Playfair Display", Georgia, serif; color: var(--taupe); font-size: 1.5rem; min-width: 128px; line-height: 1.1; }
.agenda .date small { display: block; font-family: "Poppins", sans-serif; font-size: 0.75rem; letter-spacing: 0; }
.agenda .what { flex: 1; min-width: 0; }
.agenda .what strong { display: block; font-family: "Playfair Display", Georgia, serif; font-weight: 600; color: var(--encre); font-size: 1.15rem; }
.agenda .what span { font-size: 0.85rem; }
.agenda:hover .btn-secondary { background: var(--encre); color: #fff; box-shadow: none; }

/* Repère */
.repere { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.repere::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- Boutons, étiquettes ---------- */
.btn, .btn-secondary, button.btn, button.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 0.94rem/1 "Poppins", sans-serif;
  padding: 13px 24px; border-radius: 999px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.btn { background: var(--encre); color: #fff; }
.btn-secondary { background: var(--blanc); color: var(--encre); box-shadow: inset 0 0 0 1px var(--lisere); }
.btn:hover, .btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(30, 25, 21, 0.12); }
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--lisere), 0 8px 18px rgba(30, 25, 21, 0.08); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn-link { background: none; border: 0; padding: 0; font: 600 0.9rem "Poppins", sans-serif; color: var(--encre); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; cursor: pointer; }
.btn-danger { background: var(--blanc); color: var(--alerte); box-shadow: inset 0 0 0 1px #E8C9BC; }

.tag { display: inline-flex; align-items: center; font: 600 0.72rem/1 "Poppins", sans-serif; padding: 6px 11px; border-radius: 999px; white-space: nowrap; }
.tag-supercars { background: var(--encre); color: #fff; }
.tag-collection { background: #BB9065; color: #1E1915; }
.tag-offroad { background: var(--brun); color: #fff; }
.tag-ladies { background: #6F2940; color: #fff; }
.tag-neutre { background: var(--sable); color: var(--encre); }
.tag-ok { background: #E3EEE5; color: var(--ok); }
.tag-alerte { background: #F6E3DA; color: var(--alerte); }
.tag-attente { background: var(--blanc); color: var(--encre); box-shadow: inset 0 0 0 1px var(--lisere); }

/* ---------- Badges (macarons de séjours) ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 20px; }
.badge { text-align: center; }
.badge .medaille {
  width: 112px; height: 112px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 38%, #fff 0 54%, var(--creme) 55% 100%);
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 8px var(--blanc), inset 0 0 0 9px var(--lisere), var(--ombre);
}
.badge .medaille .annee { font-family: "Playfair Display", Georgia, serif; font-size: 1.5rem; color: var(--encre); line-height: 1; }
.badge .medaille .lieu { font-size: 0.66rem; font-weight: 600; color: var(--texte); margin-top: 4px; padding: 0 12px; line-height: 1.2; }
.badge .titre { font-size: 0.8rem; font-weight: 600; color: var(--encre); line-height: 1.3; }
.badge.a-venir .medaille { background: var(--blanc); box-shadow: inset 0 0 0 2px var(--lisere), var(--ombre); opacity: 0.85; }
.badge.a-venir .medaille .annee { color: var(--taupe); }

/* ---------- Avancement ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 0 0 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 24px; bottom: 0; width: 2px; background: var(--lisere); }
.timeline li:last-child::before { display: none; }
.timeline .pt { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--lisere); background: var(--blanc); display: grid; place-items: center; font-size: 0.8rem; color: var(--encre); }
.timeline li.done .pt { background: var(--encre); border-color: var(--encre); color: #fff; }
.timeline li.done .pt::after { content: "✓"; }
.timeline strong { display: block; color: var(--encre); font-weight: 600; }
.timeline span { font-size: 0.85rem; color: var(--taupe); }

/* ---------- Personnes ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--sable); color: var(--encre); display: grid; place-items: center; font: 600 0.85rem "Poppins", sans-serif; flex: none; border: 1px solid var(--lisere); }
.person { display: flex; align-items: center; gap: 12px; }
.person .who-meta { font-size: 0.82rem; color: var(--taupe); }
.lien-tag { font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--sable); color: var(--encre); }
.lien-tag.ami { background: var(--encre); color: #fff; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--lisere); border-radius: 18px; background: var(--blanc); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-weight: 600; color: var(--encre); background: var(--creme); padding: 12px 14px; border-bottom: 1px solid var(--lisere); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--lisere); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 600; color: var(--encre); background: var(--creme); }

/* ---------- Formulaires ---------- */
form.stack label, label.field { display: block; }
label > span:first-child, .field-label { display: block; font-weight: 600; font-size: 0.88rem; color: var(--encre); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], input[type="number"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; font: 400 0.95rem "Poppins", sans-serif; color: var(--encre);
  background: var(--blanc); border: 1px solid var(--lisere); border-radius: var(--r-champ);
  padding: 11px 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.help { display: block; font-size: 0.8rem; color: var(--taupe); margin-top: 5px; }
.error { display: block; font-size: 0.82rem; color: var(--alerte); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--encre); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--blanc); box-shadow: inset 0 0 0 1px var(--lisere); font-weight: 600; font-size: 0.88rem; color: var(--encre); cursor: pointer; }
.chip input:checked + span { background: var(--encre); color: #fff; box-shadow: none; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-family: "Playfair Display", Georgia, serif; font-weight: 600; color: var(--encre); font-size: 1.25rem; margin-bottom: 12px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Messages ---------- */
.flash { padding: 14px 18px; border-radius: 16px; margin: 20px 0 0; font-size: 0.92rem; border: 1px solid var(--lisere); background: var(--blanc); color: var(--encre); }
.flash-success { border-color: #CFE0D3; background: #F2F8F3; }
.flash-error { border-color: #EBCFC3; background: #FBF1EC; color: var(--alerte); }
.empty { text-align: center; padding: 36px 20px; color: var(--taupe); }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 24px; padding: 4px; background: var(--blanc); border: 1px solid var(--lisere); border-radius: 999px; width: fit-content; max-width: 100%; }
.tabs a { text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 0.88rem; color: var(--encre); }
.tabs a.active { background: var(--encre); color: #fff; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: 100%; max-width: 460px; }
.auth .brand { justify-content: center; margin-bottom: 18px; }
.auth h1 { font-size: 2rem; text-align: center; }
.auth .surtitre { text-align: center; }

/* ---------- Pied de page ---------- */
.footer { background: var(--noir-tuiles); color: #CFC6BC; padding: 28px clamp(16px, 4vw, 48px); font-size: 0.85rem; }
.footer a { color: #fff; }
.footer .inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.devise { font-family: "Playfair Display", Georgia, serif; font-style: italic; color: #BB9065; font-size: 1.15rem; }
[data-brand="ladies"] .devise { color: #C9798E; }

/* ---------- Divers ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 0.92rem; }
.kv dt { color: var(--taupe); }
.kv dd { margin: 0; color: var(--encre); }
.vehicle-photo { aspect-ratio: 3 / 2; border-radius: var(--r-photo); overflow: hidden; background: var(--sable); }
.vehicle-photo img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-car { width: 100%; height: 100%; display: grid; place-items: center; color: var(--taupe); }
.pre { white-space: pre-line; }
.divider { height: 1px; background: var(--lisere); margin: 24px 0; border: 0; }
.right { text-align: right; }
details summary { cursor: pointer; font-weight: 600; color: var(--encre); }
.faq { background: var(--blanc); border: 1px solid var(--lisere); border-radius: var(--r-faq); padding: 16px 20px; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .who .who-name { display: none; }
  .agenda { flex-wrap: wrap; }
  .agenda .date { min-width: 0; width: 100%; }
}

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

/* Utilitaires (aucun style en ligne : politique de sécurité stricte) */
.mt { margin-top: 20px; }
.mt-sm { margin-top: 10px; }
.mb-0 { margin-bottom: 0; }
.qr { max-width: 220px; }
.qr svg { width: 100%; height: auto; }
.w-auto { width: auto; }
.hidden { display: none; }
code { font-size: 0.85em; background: var(--sable); padding: 2px 6px; border-radius: 6px; color: var(--encre); }
.push-right { margin-left: auto; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.plain li { font-size: 0.9rem; }
.badge-link { text-decoration: none; color: inherit; }
.badge-link:hover .medaille { transform: translateY(-3px); }
.badge .medaille { transition: transform 0.2s; }
.ok-mark { color: var(--ok); font-weight: 600; white-space: nowrap; }
.ok-mark small { color: var(--taupe); font-weight: 400; }
a.plain-link { text-decoration: none; color: inherit; display: block; transition: transform 0.18s; }
a.plain-link:hover { transform: translateY(-2px); }
.cover-preview { max-width: 480px; }
td select { padding: 6px 10px; font-size: 0.82rem; width: auto; }
td form.row { flex-wrap: nowrap; }
.secret-once { font-family: ui-monospace, monospace; font-size: 0.9rem; word-break: break-all; background: var(--sable); padding: 12px 14px; border-radius: 12px; color: var(--encre); }
.logo-preview { max-height: 80px; width: auto; }

/* Navigation : une seule ligne ; nom de l'utilisateur masqué quand la place manque. */
.nav a { white-space: nowrap; }
@media (min-width: 861px) { .nav { flex-wrap: nowrap; } }
@media (max-width: 1360px) { .who .who-name { display: none; } .nav a { padding: 8px 11px; } }
@media (max-width: 860px) { .nav { gap: 2px; } .nav a { padding: 7px 12px; font-size: 0.88rem; } .brand img { height: 40px; } }
.empty p { margin-left: auto; margin-right: auto; }
.switch-brand button { white-space: nowrap; }
button:disabled, button[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.brand .brand-text { white-space: nowrap; }
/* Journal : chiffres des connexions sur deux colonnes sur téléphone. */
@media (max-width: 640px) { .grid-stats { grid-template-columns: 1fr 1fr; } .grid-stats .stat { font-size: 1.8rem; } }
/* Réseaux sociaux : pastilles sable, texte encre (jamais de texte bronze sur fond clair). */
.socials { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; }
.social-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--sable); color: var(--encre); font: 600 0.82rem/1.2 "Poppins", sans-serif; text-decoration: none; box-shadow: inset 0 0 0 1px var(--lisere); }
.social-link span { font-weight: 400; }
.social-link:hover { background: var(--encre); color: #fff; }
.socials-compact { margin-top: 6px; gap: 6px; }
.socials-compact .social-link { padding: 4px 10px; font-size: 0.74rem; }
