/*
 * Planning-asso — planning commun des associations.
 * SPDX-License-Identifier: GPL-3.0-or-later
 * Mobile d'abord. Gros boutons, texte lisible, couleurs en jetons.
 */
:root {
  --fond: #fff8ec;
  --surface: #ffffff;
  --encre: #2b2620;
  --encre-douce: #6b6258;
  --ligne: #e6dccb;
  --marque: #2f6f9f;
  --marque-fonce: #24577d;
  --ok: #2e7d4f;
  --ok-fond: #e3f3e9;
  --alerte: #a33b2e;
  --alerte-fond: #fbe7e4;
  --brouillon: #7a6a2e;
  --brouillon-fond: #f5efd6;
  --r: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #1d1b18;
    --surface: #27241f;
    --encre: #f1ebe0;
    --encre-douce: #b5aa98;
    --ligne: #3d382f;
    --marque: #8dbfe6;
    --marque-fonce: #6fa6d2;
    --ok: #7fd09c;
    --ok-fond: #1f3327;
    --alerte: #f2a091;
    --alerte-fond: #3a2220;
    --brouillon: #e0cf82;
    --brouillon-fond: #36321f;
  }
}

:root[data-theme="dark"] {
  --fond: #1d1b18;
  --surface: #27241f;
  --encre: #f1ebe0;
  --encre-douce: #b5aa98;
  --ligne: #3d382f;
  --marque: #8dbfe6;
  --marque-fonce: #6fa6d2;
  --ok: #7fd09c;
  --ok-fond: #1f3327;
  --alerte: #f2a091;
  --alerte-fond: #3a2220;
  --brouillon: #e0cf82;
  --brouillon-fond: #36321f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.haut {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--ligne);
}
.marque { font-weight: 700; color: var(--encre); text-decoration: none; font-size: 1.1em; }
.haut nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.haut nav a { color: var(--marque); text-decoration: none; padding: 4px 0; }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6em; margin: 12px 0 8px; }
h2 { font-size: 1.2em; margin: 24px 0 8px; }
.aide, .meta, small { color: var(--encre-douce); }
footer { text-align: center; color: var(--encre-douce); font-size: 0.85em; padding: 24px 16px; }

.carte {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--r);
  padding: 16px; margin: 12px 0;
}
.vide { color: var(--encre-douce); }

label { display: block; margin: 12px 0; font-weight: 600; }
label small { display: block; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit;
  color: var(--encre); background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px;
}
textarea { resize: vertical; }

button, .bouton {
  display: inline-block; margin-top: 12px; padding: 12px 20px; font: inherit; font-weight: 600;
  color: #fff; background: var(--marque-fonce); border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
}
button.secondaire, .bouton.secondaire { background: transparent; color: var(--marque); border: 1px solid var(--marque); }
button.danger { background: var(--alerte); }
form.ligne { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
form.ligne label { flex: 1 1 180px; }
form.ligne button { margin-bottom: 12px; }

.alerte, .avis {
  padding: 12px 14px; border-radius: 8px; margin: 12px 0;
}
.alerte { background: var(--alerte-fond); color: var(--alerte); }
.avis { background: var(--ok-fond); color: var(--ok); }

.secret { background: var(--brouillon-fond); padding: 12px; border-radius: 8px; margin: 12px 0; }
.secret code { font-size: 1.1em; word-break: break-all; }
code { background: var(--brouillon-fond); padding: 2px 6px; border-radius: 4px; }

.qr { width: 220px; max-width: 100%; margin: 12px auto; background: #fff; padding: 8px; border-radius: 8px; }
.qr svg { display: block; width: 100%; height: auto; }

.badge {
  display: inline-block; font-size: 0.8em; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-right: 6px;
}
.badge.ok { background: var(--ok-fond); color: var(--ok); }
.badge.brouillon { background: var(--brouillon-fond); color: var(--brouillon); }

.jour h2 { text-transform: capitalize; border-bottom: 2px solid var(--ligne); padding-bottom: 4px; }
.evt { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--ligne); }
.evt.carte { border-bottom: 1px solid var(--ligne); }
.horaire { min-width: 84px; font-weight: 700; }
.horaire small { display: block; font-weight: 400; }
.detail { flex: 1; }
.detail .meta { display: block; }
.detail p { margin: 6px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.actions form { margin: 0; }
.actions button, .actions .bouton { margin-top: 0; }

.ligne-liste {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--ligne);
}
.ligne-liste form { margin: 0; }
.ligne-liste button { margin-top: 0; padding: 6px 12px; }
.journal .ligne-liste { display: block; font-size: 0.92em; }

@media (max-width: 480px) {
  .evt { flex-direction: column; gap: 4px; }
}
