/* Thème Bills : charte du 27/09/2026 (context/marque/identite/bills-2026-09-27.md).
   Une seule source de vérité : les couleurs sont des variables, redéfinies en sombre. */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/manrope-latin-wght.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/manrope-latin-ext-wght.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Couleurs ---------- */
body {
  --fond: #F5F1EA;          /* crème */
  --surface: #FFFFFF;
  --texte: #141414;         /* encre, 16,4:1 */
  --texte-2: #6B645B;       /* taupe foncé, 5,2:1 */
  --decor: #A39A8E;         /* taupe : séparateurs, jamais du texte sur crème */
  --ligne: #E4DDD2;
  --action-fond: #141414;
  --action-texte: #F5F1EA;
  --valide: #3E7B57;        /* sauge, 4,5:1 */
  --a-verifier: #935412;    /* ambre corrigé, 5,3:1 */
  --erreur: #A3352B;        /* brique, 6,0:1 */

  /* NiceGUI pose ses propres couleurs Quasar : on les remplace par la charte. */
  --q-primary: var(--action-fond) !important;
  --q-positive: var(--valide) !important;
  --q-warning: var(--a-verifier) !important;
  --q-negative: var(--erreur) !important;
}
body.body--dark {
  --fond: #141414;
  --surface: #1E1D1B;
  --texte: #EDE7DD;         /* 13,7:1 */
  --texte-2: #A39A8E;       /* 6,1:1 */
  --decor: #3A3733;
  --ligne: #2A2826;
  --action-fond: #F5F1EA;
  --action-texte: #141414;
  --valide: #7FB894;
  --a-verifier: #E0A868;
  --erreur: #E8877D;

  --q-dark-page: #141414 !important;
  --q-dark: #1E1D1B !important;
}

/* ---------- Base ---------- */
html, body { overflow-x: hidden; max-width: 100vw; }
/* iPhone : pas de zoom au double appui sur les boutons et onglets (le zoom à deux
   doigts reste possible, pour l'accessibilité), pas de halo gris au toucher. */
html, body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body, body .q-field, body .q-btn, body .q-item, body .q-notification, body .q-menu {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body {
  background: var(--fond);
  color: var(--texte);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
/* Fondu uniquement au clic sur soleil / lune (classe posée par theme.basculer). */
body.bills-anime, .bills-anime .q-header, .bills-anime .q-footer, .bills-anime .q-card,
.bills-anime .q-field__control, .bills-anime .q-btn {
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.nicegui-content { padding: 0 !important; width: 100% !important; gap: 0 !important; }
.q-card, .q-field { max-width: 100% !important; }

/* ---------- Typographie ---------- */
.bills-chiffre { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.bills-titre { font-size: 18px; font-weight: 700; }
.bills-texte-2 { color: var(--texte-2); }
.bills-mention { font-size: 12px; color: var(--texte-2); }
.montant, .bills-chiffre { font-variant-numeric: tabular-nums; }
.montant { text-align: right; white-space: nowrap; }

/* ---------- Cartes, boutons, champs ---------- */
.q-card {
  background: var(--surface) !important;
  color: var(--texte);
  border-radius: 14px !important;
  box-shadow: none !important;
}
.q-btn { border-radius: 14px; min-height: 44px; text-transform: none; font-weight: 600; }
.q-btn::before { box-shadow: none !important; }  /* pas d'ombre (charte) */
.q-btn.bills-action { background: var(--action-fond) !important; }
/* Couleurs de texte des boutons pleins : passées par text-color=..., car les règles
   prioritaires de Quasar (couche CSS de NiceGUI 3) battent toute surcharge classique. */
.text-bills-contraste { color: var(--action-texte); }
.text-sur-erreur { color: #FFFFFF; }
.body--dark .text-sur-erreur { color: #141414; }
.q-btn.bills-secondaire { color: var(--texte) !important; border: 1px solid var(--decor); }
.q-btn.bills-secondaire::before { border: none !important; }
.q-btn.bills-bouton-icone { min-height: 44px; min-width: 44px; border-radius: 50%; color: var(--texte); }
.q-field--outlined .q-field__control { border-radius: 10px; }
.q-field__label, .q-field__native, .q-field__input { color: var(--texte); }
.q-field--outlined .q-field__control::before { border-color: var(--decor); }

/* ---------- Pastilles de statut (texte toujours écrit) ---------- */
.pastille {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid currentColor;
}
.pastille--valide { color: var(--valide); }
.pastille--a-verifier { color: var(--a-verifier); }
.pastille--erreur { color: var(--erreur); }
.texte-valide { color: var(--valide); }
.texte-a-verifier { color: var(--a-verifier); }
.texte-erreur { color: var(--erreur); }

/* ---------- Icônes ---------- */
.bills-icone { display: inline-flex; line-height: 0; color: currentColor; }
.bills-icone svg { stroke-width: 1.5; }
.seulement-clair { display: inline-flex; }
.seulement-sombre { display: none !important; }
.body--dark .seulement-clair { display: none !important; }
.body--dark .seulement-sombre { display: inline-flex !important; }

/* ---------- Cadre : en-tête et onglets ---------- */
.q-header.bills-entete {
  background: var(--fond); color: var(--texte);
  padding: 8px 12px 8px 20px;
  padding-top: max(8px, env(safe-area-inset-top));
}
.bills-marque { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.q-footer.bills-onglets {
  background: var(--surface); color: var(--texte-2);
  border-top: 1px solid var(--ligne);
  /* iPhone récents : on remonte les onglets au-dessus de la barre d'accueil d'iOS,
     avec un cran de marge en plus (retour d'Anousone sur iPhone 17). */
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
}
.bills-onglet {
  position: relative; flex: 1; min-height: 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--texte-2); text-decoration: none; font-size: 12px; font-weight: 500;
}
/* Onglet actif (comme la barre LinkedIn) : trait en haut, icône pleine, libellé fort. */
.bills-onglet--actif { color: var(--texte); font-weight: 700; }
.bills-onglet--actif::before {
  content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 56px; height: 3px; border-radius: 0 0 3px 3px; background: var(--texte);
}
.bills-onglet:active { opacity: 0.6; }
.bills-contenu {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 8px 20px 24px; gap: 8px; overflow-x: hidden;
}
.bills-section { margin-top: 16px; }

/* Lien présenté comme un bouton secondaire (bandeau de crédit). */
.bills-lien-bouton {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 44px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--decor);
  color: var(--texte) !important; font-weight: 600; font-size: 14px; text-decoration: none;
}
