/* Charte The Elsassisch (code d'Elsass Dico, comme l'app marketing) : or #EFC631 pour l'action,
   rouge du logo #a7070d pour la signature, Archivo pour le texte.
   Public : commerçant de 50-60 ans, sur téléphone. Gros textes, un seul bouton important par écran. */

@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin-400-normal.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin-700-normal.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Archivo'; src: url('/fonts/archivo-latin-800-normal.woff') format('woff'); font-weight: 800; font-display: swap; }

:root {
  --fond: hsl(30 20% 97%);
  --surface: #ffffff;
  --surface-2: hsl(30 18% 94%);
  --texte: hsl(210 11% 15%);
  --texte-2: hsl(20 6% 36%);
  --trait: hsl(30 12% 86%);
  --or: #EFC631;
  --or-survol: hsl(44 84% 50%);
  --sur-or: hsl(210 11% 13%);
  --rouge: #a7070d;
  --anneau: hsl(47 86% 38%);
  --succes: hsl(145 45% 31%);
  --erreur: #c2410c;
  --erreur-pale: #fbe6dc;
  --ombre: 0 1px 2px hsl(20 20% 20% / 0.05), 0 6px 18px hsl(20 20% 20% / 0.07);
  --r: 10px;
  --barre-h: 88px;
  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 Archivo, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.entete {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--trait);
}
.marque { color: var(--rouge); font-weight: 800; font-size: 17px; }
.entete-titre { color: var(--texte-2); font-size: 15px; }

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-size: 30px; line-height: 1.15; margin: 4px 0 8px; font-weight: 800; }
h2 { font-size: 20px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
h2 em, .sous-champ 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: -4px 0 12px; font-size: 16px; }
.sous-titre { margin: 14px 0 8px; font-weight: 700; font-size: 16px; }

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

/* Champs */
.champ { display: block; margin: 0 0 16px; }
.champ span, .sous-champ span { display: block; font-weight: 700; margin-bottom: 6px; font-size: 17px; }
.sous-champ { display: block; margin-top: 16px; }
.sous-champ.premier { margin-top: 0; }
input[type=email], 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, .bouton-trait:focus-within {
  outline: 3px solid var(--anneau); outline-offset: 2px;
}

/* Boutons */
.bouton-or {
  display: block; width: 100%; min-height: 58px; border: 0; border-radius: var(--r);
  background: var(--or); color: var(--sur-or); font: 800 20px/1 Archivo, Arial, sans-serif; cursor: pointer;
}
.bouton-or:active { background: var(--or-survol); }
.bouton-or[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(--texte); border-radius: var(--r); background: var(--surface);
  font: inherit; font-weight: 700; 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: 700; margin: 0 0 16px; }

/* Aperçu */
.apercu { margin: 0 0 28px; }
.apercu canvas { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: var(--ombre); background: var(--surface-2); }
.apercu figcaption { color: var(--texte-2); font-size: 15px; margin-top: 8px; text-align: center; }

.etape { background: var(--surface); border-radius: var(--r); box-shadow: var(--ombre); padding: 20px 16px; margin: 0 0 16px; }

/* Logo */
.logo-zone { display: flex; align-items: center; gap: 16px; }
.logo-cadre {
  width: 96px; height: 96px; flex: none; border-radius: var(--r); border: 1.5px dashed var(--trait);
  display: grid; place-items: center; background: var(--surface-2); overflow: hidden;
  color: var(--texte-2); font-size: 14px; text-align: center;
}
.logo-cadre img { max-width: 84px; max-height: 84px; }
.logo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* Couleurs */
.nuancier { display: flex; flex-wrap: wrap; gap: 10px; }
.pastille {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(0,0,0,.12); cursor: pointer; padding: 0;
  position: relative;
}
.pastille[aria-checked=true] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--texte); }
.pastille-autre {
  background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935);
  overflow: hidden;
}
.pastille-autre input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
/* Styles */
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choix-style {
  border: 2px solid var(--trait); border-radius: var(--r); background: var(--surface); padding: 6px 6px 10px;
  cursor: pointer; font: inherit; color: inherit; text-align: center;
}
.choix-style canvas { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 4px; }
.choix-style span { display: block; font-weight: 700; font-size: 16px; margin-top: 8px; }
.choix-style[aria-checked=true] { border-color: var(--texte); box-shadow: 0 0 0 2px var(--texte); }

/* Tons */
.tons { display: grid; gap: 10px; }
.choix-ton {
  display: block; width: 100%; text-align: left; border: 2px solid var(--trait); border-radius: var(--r);
  background: var(--surface); padding: 14px 16px; cursor: pointer; font: inherit; color: inherit;
}
.choix-ton strong { display: block; font-size: 18px; }
.choix-ton span { display: block; color: var(--texte-2); font-size: 16px; font-style: italic; margin-top: 2px; }
.choix-ton[aria-checked=true] { border-color: var(--texte); box-shadow: 0 0 0 2px var(--texte); }

.deconnexion { text-align: center; margin-top: 24px; }

/* 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 hsl(20 20% 15% / 0.08);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
.barre .bouton-or { max-width: 488px; margin: 0 auto; }
.barre-message { max-width: 488px; margin: 0 auto 8px; min-height: 0; font-weight: 700; text-align: center; font-size: 16px; }
.barre-message:empty { display: none; }
.barre-message.ok { color: var(--succes); }
.barre-message.ko { color: var(--erreur); }

.connexion form { margin-top: 8px; }

/* --- Accueil, nouveau post, post (J3) --- */
.bouton-lien { display: grid; place-items: center; text-decoration: none; }
.retour { margin: 0 0 8px; }
.retour a { color: var(--texte-2); font-weight: 700; text-decoration: none; display: inline-block; padding: 6px 0; }
.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(--attention, #8a5a12); font-weight: 700; }
.vide { color: var(--texte-2); }
.lien-commerce { margin-top: 28px; text-align: center; }
.lien-commerce a { color: var(--texte-2); }

.photo-cadre { margin: 0 0 14px; }
.photo-cadre img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.photo-boutons { display: grid; gap: 10px; }
.photo-boutons .bouton-trait { width: 100%; }
.zone { min-height: 110px; resize: vertical; line-height: 1.4; }
.etape .aide { margin: 8px 0 0; }

.attente { text-align: center; padding: 40px 0; }
.attente .bouton-or { 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(--or); 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: 7px; background: transparent; font: 700 17px Archivo, Arial, sans-serif;
  color: var(--texte-2); cursor: pointer;
}
.onglets button[aria-selected=true] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
.post .apercu canvas { max-height: 70vh; width: auto; max-width: 100%; margin: 0 auto; }
.titre-legende { font-size: 18px; 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: 700; }
.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); }
.rappel { max-width: 488px; margin: 0 auto 8px; color: var(--texte-2); font-size: 15px; text-align: center; line-height: 1.35; }

/* 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: 700; color: var(--texte); }
.encart-notif .encart-message.ko { color: var(--erreur); }

/* Posts du mois (J4) */
.compteur { margin: 12px 0 0; text-align: center; color: var(--texte-2); }
.encart-fin { margin: 0; padding: 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--ombre); }
.encart-fin p { margin: 0 0 14px; color: var(--texte-2); }
.encart-fin p strong { color: var(--texte); }
[hidden] { display: none !important; }
