/* Même identité que theopequignot.fr : bleu, texte blanc, Ostrich en capitales, Sporting pour le texte. */
@font-face { font-family: 'Ostrich'; src: url('/fonts/ostrich-heavy.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Sporting'; src: url('/fonts/sporting-regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Sporting'; src: url('/fonts/sporting-bold.otf') format('opentype'); font-weight: 700; font-display: swap; }

:root {
  --bleu: #123b8a; --bleu-fonce: #0c2a66; --bleu-clair: #1d4ba3;
  --blanc: #fff; --voile: #c9d6f0; --trait: rgba(255,255,255,.16);
  --urssaf: #ff9f7a; --impot: #ffd166; --dette: #ff6b81; --matelas: #c9d6f0; --epargne: #8fd3ff; --libre: #ffffff;
  --vert: #7dffb3; --rouge: #ff8c9a;
  --titre: 'Ostrich', 'Arial Narrow', sans-serif;
  --texte: 'Sporting', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bleu); color: var(--blanc); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--texte); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: radial-gradient(120% 60% at 80% -10%, var(--bleu-clair), transparent 60%), var(--bleu); min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--blanc); color: var(--bleu); }
:focus-visible { outline: 2px solid var(--blanc); outline-offset: 3px; }

#app { max-width: 560px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
.capitales { font-family: var(--titre); text-transform: uppercase; font-weight: normal; letter-spacing: .02em; }
.etiquette { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--voile); margin: 0; }
.voile { color: var(--voile); }
.petit { font-size: 13px; }
.montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--vert); }
.moins { color: var(--blanc); }

/* En-tête */
.entete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.entete h1 { font-size: 30px; margin: 0; line-height: 1; }
.sync { background: none; border: 1px solid var(--trait); border-radius: 99px; padding: 6px 12px; font-size: 12px; color: var(--voile); cursor: pointer; }
.sync.erreur { border-color: var(--rouge); color: var(--rouge); }

/* Héros */
.heros { padding: 22px 0 8px; }
.heros .chiffre { font-family: var(--titre); font-size: clamp(64px, 22vw, 104px); line-height: .9; margin: 6px 0 10px; }
.heros .chiffre.negatif { color: var(--rouge); }
.heros p { margin: 0; font-size: 16px; }

/* Barre de répartition */
.barre { display: flex; height: 18px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.08); margin: 22px 0 6px; }
.barre span { display: block; height: 100%; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.barre span + span { border-left: 2px solid var(--bleu); }
.lignes { list-style: none; margin: 8px 0 0; padding: 0; }
.lignes li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--trait); }
.lignes li .nom { flex: 1; }
.lignes li .nom small { display: block; color: var(--voile); font-size: 12px; }
.pastille { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lignes li.total { border-bottom: 0; font-weight: 700; }

/* Cartes */
.carte { background: rgba(8, 28, 72, .38); border: 1px solid var(--trait); border-radius: 16px; padding: 18px; margin-top: 16px; }
.carte h2 { font-family: var(--titre); text-transform: uppercase; font-weight: normal; font-size: 26px; margin: 0 0 8px; line-height: 1; }
.alerte { background: rgba(255, 107, 129, .16); border-color: var(--rouge); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.duo div b { display: block; font-family: var(--titre); font-size: 34px; font-weight: normal; line-height: 1.05; }
.jauge { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; margin: 14px 0 6px; }
.jauge i { display: block; height: 100%; background: var(--vert); width: 0; transition: width .9s ease; }
.jauge i.chaud { background: var(--impot); }
.jauge i.rouge { background: var(--rouge); }

/* Boutons */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 2px solid var(--blanc); border-radius: 10px; background: transparent; color: var(--blanc);
  font-family: var(--titre); text-transform: uppercase; font-size: 22px; line-height: 1; cursor: pointer; transition: background-color .15s, color .15s, transform .1s; }
.bouton:active { transform: scale(.98); }
.bouton.plein, .bouton:hover { background: var(--blanc); color: var(--bleu); }
.bouton.large { width: 100%; }
.bouton.discret { border-color: var(--trait); font-size: 18px; min-height: 38px; }
.bouton.danger { border-color: var(--rouge); color: var(--rouge); }
.bouton.danger:hover { background: var(--rouge); color: var(--bleu-fonce); }
.rangee { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Formulaires */
label.champ { display: block; margin-top: 12px; }
label.champ > span { display: block; font-size: 12px; color: var(--voile); margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], input[type=date], select {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--trait);
  background: rgba(255,255,255,.08); font-size: 16px; }
select option { color: #111; }
input:focus, select:focus { outline: none; border-color: var(--blanc); }
.coche { display: flex; align-items: center; gap: 10px; margin-top: 12px; cursor: pointer; }
.coche input { width: 20px; height: 20px; accent-color: var(--blanc); }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Puces de filtre */
.puces { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.puces button { flex: none; border: 1px solid var(--trait); background: none; border-radius: 99px; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.puces button.actif { background: var(--blanc); color: var(--bleu); border-color: var(--blanc); }

/* Mouvements */
.mois-titre { font-family: var(--titre); text-transform: uppercase; font-size: 22px; margin: 20px 0 4px; display: flex; justify-content: space-between; }
.mois-titre small { font-family: var(--texte); text-transform: none; font-size: 13px; color: var(--voile); align-self: end; }
.mvt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--trait); padding: 12px 0; cursor: pointer; }
.mvt .ic { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: none; font-size: 17px; }
.mvt .txt { flex: 1; min-width: 0; }
.mvt .txt b { display: block; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvt .txt small { color: var(--voile); font-size: 12px; }
.mvt .attente { opacity: .6; }

/* Dettes */
.dette { padding: 14px 0; border-bottom: 1px solid var(--trait); }
.dette .haut { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.dette .haut b { font-weight: 700; }
.dette .haut .montant { font-family: var(--titre); font-size: 28px; }
.dette.payee { opacity: .5; }

/* Navigation basse */
#onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(12, 42, 102, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--trait); padding-bottom: env(safe-area-inset-bottom); }
#onglets[hidden] { display: none; }
#onglets button { background: none; border: 0; padding: 10px 0 9px; font-size: 11px; letter-spacing: .06em; color: var(--voile); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#onglets button .ico { font-size: 19px; line-height: 1; }
#onglets button.actif { color: var(--blanc); }

/* Feuille du bas */
#feuille { position: fixed; inset: 0; z-index: 20; background: rgba(4, 14, 40, .6); display: flex; align-items: flex-end; justify-content: center; animation: fondu .2s; }
#feuille[hidden] { display: none; }
#feuille .panneau { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--bleu-fonce); border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--trait); animation: monte .28s cubic-bezier(.2,.8,.2,1); }
#feuille h3 { font-family: var(--titre); text-transform: uppercase; font-weight: normal; font-size: 28px; margin: 0 0 4px; }
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.choix button { border: 1px solid var(--trait); background: rgba(255,255,255,.05); border-radius: 10px; padding: 11px 10px; text-align: left; cursor: pointer; font-size: 14px; }
.choix button.actif { background: var(--blanc); color: var(--bleu); }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
@keyframes fondu { from { opacity: 0; } }

#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--blanc); color: var(--bleu); padding: 10px 18px; border-radius: 99px; font-size: 14px; transition: .25s; z-index: 30; max-width: 90vw; text-align: center; }
#toast.vu { opacity: 1; transform: translate(-50%, 0); }

/* Connexion */
.connexion { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.connexion h1 { font-size: clamp(64px, 20vw, 110px); line-height: .85; margin: 0 0 18px; }
.connexion form { margin-top: 18px; }
.erreur-txt { color: var(--rouge); min-height: 22px; margin: 8px 0 0; font-size: 14px; }

.gros-montant { font-size: 40px; margin: 6px 0; }
.code {font-family: var(--titre); font-size: 44px; letter-spacing: .08em; user-select: all; }
.vide { color: var(--voile); text-align: center; padding: 40px 0; }
.entree-anim { animation: monte .45s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
