/* Kokomi Pro — bleu nuit. Règle typo de l'app Swift (DesignSystem/Typo.swift) :
   Montserrat, tracking -0,071em, titres 800 à interligne 0,9. */
@font-face { font-family: Montserrat; src: url(fonts/Montserrat.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --encre: #161F27; --carte: #1F2B36; --trait: #2F3A44; --bord: #4A545D;
  --creme: #F1F0E4; --doux: #A9AEA8; --sauge: #8FA78B; --sauge-fond: #97AE93;
  --peche: #EEB095; --peche-eteinte: #8C6F66;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--encre); color-scheme: dark; }
body { background: var(--encre); color: var(--creme); font-family: Montserrat, system-ui, sans-serif; letter-spacing: -0.071em; line-height: 1.35; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--peche); outline-offset: 2px; }
[hidden] { display: none !important; }

h1, h2 { font-weight: 800; line-height: 0.9; }
h1 { font-size: 36px; }
h2 { font-size: 22px; margin-bottom: 14px; }
.peche { color: var(--peche); }
.note { font-size: 13px; color: var(--doux); }
.centre { text-align: center; padding: 80px 20px; }
a { color: inherit; text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo img { height: 32px; width: auto; }
.logo b { padding: 4px 9px; border-radius: 999px; background: var(--sauge-fond); color: var(--encre); font-size: 11.5px; font-weight: 800; line-height: 1; }

/* ---------- charpente : barre, page, pied ---------- */
#app, .ecran { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.barre { position: sticky; top: 0; z-index: 5; background: var(--encre); border-bottom: 1px solid var(--trait); padding: env(safe-area-inset-top) 18px 0; }
.barre > div { max-width: 1044px; margin: 0 auto; min-height: 68px; display: flex; align-items: center; gap: 12px; }
.barre .logo img { filter: brightness(0) invert(0.94); }     /* le logo encre devient crème sur le bleu nuit */
.pousse { flex: 1; }
.essai { white-space: nowrap; font-size: 11px; font-weight: 800; color: var(--peche); border: 1px dashed var(--peche-eteinte); border-radius: 999px; padding: 4px 9px; }
.page { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 18px 40px; display: flex; flex-direction: column; gap: 22px; }
.page.etroite { max-width: 560px; }
.salut h1 span, .porte h1 span { display: block; color: var(--peche); }
.salut p { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--doux); }
.pied { border-top: 1px solid var(--trait); padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); text-align: center; font-size: 12px; font-weight: 600; color: var(--doux); }
.pied nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; }
.pied a { display: inline-flex; align-items: center; min-height: 32px; }
.pied a:hover { color: var(--creme); text-decoration: underline; }
.grille { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "total" "ventes" "produits"; }
.zone-total { grid-area: total; } .zone-ventes { grid-area: ventes; } .zone-produits { grid-area: produits; }
@media (min-width: 900px) {
  h1 { font-size: 42px; }
  .salut h1 span { display: inline; }
  .grille { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); grid-template-areas: "total ventes" "produits ventes"; grid-template-rows: auto 1fr; align-items: start; }
}

/* ---------- connexion : une carte crème, Koko posé dessus ---------- */
.entree { flex: 1; display: grid; place-items: center; padding: 120px 18px 40px; }
.porte { position: relative; width: min(400px, 100%); }
.koko { position: absolute; z-index: 1; pointer-events: none; right: 18px; top: -108px; width: 76px; height: auto; }
.feuille { background: var(--creme); color: var(--encre); border-radius: 28px; padding: 30px 26px 24px; box-shadow: 0 30px 70px -30px rgba(0,0,0,.7); display: flex; flex-direction: column; }
.feuille .logo { align-self: flex-start; margin-bottom: 26px; }
.feuille .logo img { height: 36px; }
.porte h1 { font-size: 34px; }
.porte h1 span { color: #A85525; }
.intro { margin: 12px 0 22px; font-size: 13.5px; color: rgba(22,31,39,.72); }
.feuille form { display: flex; flex-direction: column; gap: 14px; }
.feuille .champ, .feuille .champ label { color: rgba(22,31,39,.72); }
.feuille .champ input { display: block; width: 100%; height: 50px; margin-top: 6px; border-radius: 14px; border: 1.5px solid rgba(22,31,39,.14); background: #FBFAF4; color: var(--encre); padding: 0 14px; font-size: 16px; font-weight: 600; }
.feuille .champ input:focus { border-color: var(--encre); outline: none; }
.secret { position: relative; display: block; }
.feuille .champ .secret input { padding-right: 92px; }
.secret button { position: absolute; right: 4px; bottom: 0; height: 50px; display: flex; align-items: center; padding: 0 12px; font-size: 12px; font-weight: 800; color: rgba(22,31,39,.6); }
.feuille .erreur { color: #A85525; min-height: 1em; margin: -4px 0; }
.feuille .cta { background: var(--encre); color: var(--creme); }
.sur { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(22,31,39,.1); font-size: 12px; font-weight: 700; color: #55704F; }
.sur svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.aide { margin-top: 10px; text-align: center; font-size: 12px; color: rgba(22,31,39,.65); }
.aide a { font-weight: 800; text-decoration: underline; }

.carte { border-radius: 22px; background: var(--carte); border: 1px solid rgba(241,240,228,.06); padding: 6px 16px; }
.total { border-radius: 24px; padding: 22px; background: var(--sauge-fond); color: var(--encre); }
.total .k { font-size: 13px; font-weight: 800; }
.total .v { margin-top: 8px; font-size: 46px; font-weight: 800; line-height: 0.9; }
.total .l { margin-top: 10px; font-size: 13px; font-weight: 600; }
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.tuiles > div { border-radius: 20px; background: var(--carte); border: 1px solid rgba(241,240,228,.06); padding: 14px 16px; }
.tuiles .k { font-size: 12px; font-weight: 700; color: var(--doux); }
.tuiles .v { margin-top: 8px; font-size: 22px; font-weight: 800; line-height: 0.9; }
.tuiles .l { margin-top: 7px; font-size: 11.5px; color: var(--doux); }

.choix { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.choix button { flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--bord); font-size: 13px; font-weight: 800; }
.choix button.on { background: var(--creme); border-color: var(--creme); color: var(--encre); }

.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--carte); margin-bottom: 12px; }
.seg button { min-height: 40px; padding: 0 20px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--doux); }
.seg button.on { background: var(--creme); color: var(--encre); }

.graphe { border-radius: 22px; background: var(--carte); padding: 16px 14px 12px; }
.barres { display: flex; gap: 8px; align-items: stretch; height: 170px; }
.barres button { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; }
.barres i { display: block; width: 100%; max-width: 46px; border-radius: 8px; background: var(--peche-eteinte); }
.barres .on i { background: var(--peche); }
.barres span { font-weight: 700; color: var(--doux); margin-top: 4px; white-space: nowrap; }
.barres .on span { color: var(--creme); }
.titre-detail { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin: 18px 2px 10px; font-size: 15px; font-weight: 800; }
.titre-detail::first-letter { text-transform: uppercase; }

.ligne { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 8px 0; font-size: 14px; font-weight: 800; }
.ligne + .ligne, .produit + .produit { border-top: 1px solid var(--trait); }
.photo { flex: none; width: 46px; height: 46px; object-fit: contain; }
.nom { flex: 1; min-width: 0; }
.nom small { display: block; font-size: 12px; font-weight: 600; color: var(--doux); }
.nom small.alerte { color: var(--peche); }
.qte { color: var(--peche); font-size: 18px; }

.petit { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--bord); font-size: 12px; font-weight: 800; flex: none; }
.petit.plein { background: var(--peche); border-color: var(--peche); color: var(--encre); }
.petit.danger { color: var(--peche); border-color: var(--peche-eteinte); }
.edition { padding: 4px 0 14px; display: flex; flex-direction: column; gap: 12px; }
.prix { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--doux); }
.prix input { width: 96px; height: 44px; border-radius: 12px; border: 0; background: var(--creme); color: var(--encre); padding: 0 10px; font-size: 16px; font-weight: 800; text-align: right; }
.prix .affiche { margin-left: auto; text-align: right; }
.prix .affiche b { display: block; font-size: 15px; color: var(--peche); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.ajouter { margin-top: 12px; width: 100%; min-height: 50px; border-radius: 999px; border: 1.5px dashed var(--bord); font-size: 14px; font-weight: 800; }
.cta { width: 100%; min-height: 50px; border-radius: 999px; background: var(--peche); color: var(--encre); font-size: 15px; font-weight: 800; }
.lien { min-height: 44px; font-size: 13px; font-weight: 700; color: var(--doux); text-decoration: underline; }

.bloc { display: flex; flex-direction: column; gap: 14px; background: var(--carte); border: 1px solid rgba(241,240,228,.06); border-radius: 24px; padding: 22px 18px; }
.champ { display: block; font-size: 12px; font-weight: 700; color: var(--doux); }
.champ input, .champ textarea, .champ select { display: block; margin-top: 6px; width: 100%; height: 50px; border-radius: 14px; border: 0; background: var(--creme); color: var(--encre); padding: 0 14px; font-size: 16px; font-weight: 600; }
.champ textarea { height: 90px; padding: 12px 14px; resize: none; }
.erreur { font-size: 13px; font-weight: 700; color: var(--peche); }
.apercu-photo { display: block; margin-top: 8px; max-width: 160px; max-height: 160px; border-radius: 14px; }
.champ input[type=file] { height: auto; padding: 12px; }

a.ajouter { display: flex; align-items: center; justify-content: center; }
a.lien { display: inline-flex; align-items: center; align-self: flex-start; }
.espace { margin-top: 12px; }
.suite { margin-top: 24px; }
.bandeau { border-radius: 16px; border: 1px solid var(--peche-eteinte); color: var(--peche); padding: 12px 16px; font-size: 13px; font-weight: 700; }

/* ---------- champs clairs : jamais le gris du navigateur (remplissage automatique) ---------- */
.feuille, .champ input, .champ textarea, .champ select, .prix input { color-scheme: light; }
.champ input:-webkit-autofill, .champ input:-webkit-autofill:focus, .prix input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 60px #FBFAF4 inset; -webkit-text-fill-color: var(--encre); caret-color: var(--encre);
}

/* ---------- mouvements ---------- */
.petit, .cta, .ajouter, .seg button, .choix button { transition: transform .15s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
.petit:active, .cta:active, .ajouter:active, .seg button:active, .choix button:active { transform: scale(.96); }
.feuille .champ input { transition: border-color .2s ease, box-shadow .2s ease; }
.feuille .champ input:focus { box-shadow: 0 0 0 4px rgba(143,167,139,.28); }
.barres i { transition: background-color .2s ease; }
.cta.attend { position: relative; color: transparent; }
.cta.attend::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--creme); border-top-color: transparent; animation: tourne .7s linear infinite; }
@media (hover: hover) {
  .petit:hover, .ajouter:hover { border-color: var(--creme); }
  .cta:hover { transform: translateY(-1px); }
  .carte .ligne { transition: transform .18s ease; }
  .carte .ligne:hover { transform: translateX(3px); }
}

.arrive .porte .feuille { animation: monte .5s cubic-bezier(.2,.9,.3,1.15) both; }
.arrive .koko { animation: pose .6s .28s cubic-bezier(.3,1.5,.5,1) both; }
.arrive .page > * { animation: monte .45s ease both; }
.arrive .grille > :nth-child(1) { animation: monte .45s .05s ease both; }
.arrive .grille > :nth-child(2) { animation: monte .45s .12s ease both; }
.arrive .grille > :nth-child(3) { animation: monte .45s .19s ease both; }
.pousse-barres i { transform-origin: bottom; animation: pousse .55s cubic-bezier(.3,1.25,.5,1) both; }
.pousse-barres button:nth-child(2) i { animation-delay: .04s; }
.pousse-barres button:nth-child(3) i { animation-delay: .08s; }
.pousse-barres button:nth-child(4) i { animation-delay: .12s; }
.pousse-barres button:nth-child(5) i { animation-delay: .16s; }
.pousse-barres button:nth-child(6) i { animation-delay: .2s; }
.pousse-barres button:nth-child(7) i { animation-delay: .24s; }
.pousse-barres button:nth-child(8) i { animation-delay: .28s; }
.edition { animation: monte .25s ease both; }
.secoue { animation: secousse .4s ease !important; }

@keyframes monte { from { opacity: 0; transform: translateY(14px); } }
@keyframes pose { from { opacity: 0; transform: translateY(-18px) scale(.92); } }
@keyframes pousse { from { transform: scaleY(0); } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes secousse { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }
