/* Couleurs de la Koehling Racing Team : noir #111111, rouge #D7141A, Barlow / Barlow Condensed.
   Sur téléphone, en plein air au bord de la piste : fond clair, gros textes, un seul bouton important par écran. */

@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-400-normal.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-latin-600-normal.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-700-normal.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-latin-800-italic.woff') format('woff'); font-weight: 800; font-style: italic; font-display: swap; }

:root {
  --fond: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #e9e9e9;
  --noir: #111111;
  --texte: #111111;
  --texte-2: #555555;
  --trait: #d6d6d6;
  --rouge: #D7141A;
  --rouge-appui: #b01015;
  --anneau: #111111;
  --succes: #1d7a3e;
  --erreur: #b01015;
  --erreur-pale: #fbe3e4;
  --ombre: 0 1px 2px rgb(0 0 0 / 0.05), 0 6px 18px rgb(0 0 0 / 0.07);
  --r: 8px;
  --barre-h: 88px;
  --titre: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 400 18px/1.45 Barlow, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.entete { background: var(--noir); padding: 10px 16px; border-bottom: 4px solid var(--rouge); }
.marque {
  display: flex; align-items: center; gap: 10px; max-width: 520px; margin: 0 auto;
  color: #fff; text-decoration: none; font: 700 19px/1 var(--titre); letter-spacing: 0.08em; text-transform: uppercase;
}
.marque img { display: block; }

main { max-width: 520px; margin: 0 auto; padding: 20px 16px calc(var(--barre-h) + 90px); }
.chargement { color: var(--texte-2); text-align: center; margin-top: 40px; }

h1 { font: italic 800 36px/1.05 var(--titre); text-transform: uppercase; margin: 4px 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
h2 em { font-style: normal; font-weight: 400; color: var(--texte-2); font-size: 16px; }
.intro { color: var(--texte-2); margin: 0 0 20px; }
.aide { color: var(--texte-2); margin: 8px 0 0; font-size: 16px; }

.num {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--noir); color: #fff; font-size: 16px; font-weight: 600; flex: none;
}

/* Champs */
.champ { display: block; margin: 0 0 16px; }
.champ span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 17px; }
input[type=password], .saisie {
  width: 100%; min-height: 54px; padding: 12px 14px; font: inherit; color: inherit;
  background: var(--surface); border: 1.5px solid var(--trait); border-radius: var(--r);
}
input:focus-visible, button:focus-visible, a:focus-visible, .bouton-trait:focus-within {
  outline: 3px solid var(--anneau); outline-offset: 2px;
}

/* Boutons */
.bouton-rouge {
  display: block; width: 100%; min-height: 58px; border: 0; border-radius: var(--r);
  background: var(--rouge); color: #fff; font: 700 24px/1 var(--titre); letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer;
}
.bouton-rouge:active { background: var(--rouge-appui); }
.bouton-rouge[disabled] { opacity: .6; cursor: default; }
.bouton-trait {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 20px;
  border: 1.5px solid var(--noir); border-radius: var(--r); background: var(--surface);
  font: inherit; font-weight: 600; color: var(--texte); cursor: pointer;
}
.lien { background: none; border: 0; padding: 8px 0; font: inherit; color: var(--texte-2); text-decoration: underline; cursor: pointer; }
.erreur { background: var(--erreur-pale); color: var(--erreur); padding: 12px 14px; border-radius: var(--r); font-weight: 600; margin: 0 0 16px; }
.connexion form { margin-top: 8px; }

/* Accueil : un bouton par outil */
.outils { display: grid; gap: 10px; }
.outil {
  display: block; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--ombre);
  color: inherit; text-decoration: none; border-left: 6px solid var(--rouge);
}
.outil strong { display: block; font: 700 24px/1.1 var(--titre); text-transform: uppercase; letter-spacing: 0.02em; }
.outil span { display: block; color: var(--texte-2); font-size: 16px; margin-top: 4px; }
.outil:active { background: var(--surface-2); }
.outil.bientot { box-shadow: none; background: transparent; border: 1px dashed var(--trait); border-left-width: 6px; border-left-style: solid; border-left-color: var(--trait); color: var(--texte-2); }
.outil.bientot strong { font-size: 20px; }

.titre-liste { margin: 32px 0 12px; }
.liste-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.liste-posts a {
  display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--ombre); padding: 10px;
}
.liste-posts img { width: 64px; height: 80px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); }
.liste-posts strong { display: block; font-size: 17px; line-height: 1.3; }
.liste-posts span { display: block; color: var(--texte-2); font-size: 15px; margin-top: 2px; }
.liste-posts .en-cours { color: var(--rouge); font-weight: 600; }
.vide { color: var(--texte-2); }

/* Encart des notifications (accueil), affiché tant qu'elles ne sont pas actives sur ce téléphone */
.encart-notif { margin: 16px 0 0; padding: 16px; border: 1px solid var(--trait); border-radius: var(--r); background: var(--surface); }
.encart-notif p { margin: 0 0 12px; color: var(--texte-2); }
.encart-notif p strong { color: var(--texte); }
.encart-notif .bouton-trait { width: 100%; }
.encart-notif .encart-message { margin: 12px 0 0; font-weight: 600; color: var(--texte); }
.encart-notif .encart-message.ko { color: var(--erreur); }

/* Nouveau post */
.retour { margin: 0 0 8px; }
.retour a { color: var(--texte-2); font-weight: 600; text-decoration: none; display: inline-block; padding: 6px 0; }
.etape { background: var(--surface); border-radius: var(--r); box-shadow: var(--ombre); padding: 20px 16px; margin: 0 0 16px; }
.etape .bouton-trait { width: 100%; }
.photo-cadre { margin: 0 0 14px; }
.photo-cadre img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 6px; background: var(--surface-2); }
.zone { min-height: 110px; resize: vertical; line-height: 1.4; }

/* Post */
.attente { text-align: center; padding: 40px 0; }
.attente .bouton-rouge { margin-top: 20px; }
.roue {
  width: 56px; height: 56px; margin: 0 auto 24px; border-radius: 50%;
  border: 6px solid var(--surface-2); border-top-color: var(--rouge); animation: tourne 1s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation-duration: 3s; } }

.onglets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: var(--r); margin: 0 0 14px; }
.onglets button {
  min-height: 46px; border: 0; border-radius: 6px; background: transparent; font: 600 17px Barlow, Arial, sans-serif;
  color: var(--texte-2); cursor: pointer;
}
.onglets button[aria-selected=true] { background: var(--noir); color: #fff; }
.apercu { margin: 0 0 28px; }
.apercu canvas { display: block; max-height: 70vh; width: auto; max-width: 100%; height: auto; margin: 0 auto; border-radius: 4px; box-shadow: var(--ombre); background: var(--surface-2); }
.titre-legende { display: block; font-size: 18px; font-weight: 600; margin: 4px 0 8px; }
.legende { white-space: pre-line; background: var(--surface); border-radius: var(--r); box-shadow: var(--ombre); padding: 14px 16px; margin: 0 0 16px; }
.note-erreur { background: var(--erreur-pale); color: var(--erreur); padding: 12px 14px; border-radius: var(--r); font-weight: 600; }
.bouton-large { width: 100%; margin: 0 0 16px; }
#post-modifier .zone { margin: 4px 0 16px; }
#post-modifier .note-erreur { margin: 0 0 16px; }
.annuler { text-align: center; margin: 12px 0 0; }
.enregistrer-image { text-align: center; }
.enregistrer-image a { color: var(--texte-2); }

/* Barre du bas : le seul bouton important de l'écran */
.barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--surface); box-shadow: 0 -8px 24px rgb(0 0 0 / 0.08);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
.barre .bouton-rouge { max-width: 488px; margin: 0 auto; }
.barre-message { max-width: 488px; margin: 0 auto 8px; font-weight: 600; text-align: center; font-size: 16px; }
.barre-message:empty { display: none; }
.barre-message.ok { color: var(--succes); }
.barre-message.ko { color: var(--erreur); }
.rappel { max-width: 488px; margin: 0 auto 8px; color: var(--texte-2); font-size: 15px; text-align: center; line-height: 1.35; }

[hidden] { display: none !important; }
