/* Jarvis Card, maquette : coquilles d'application (téléphone et bureau) + barre de démo. */

/* Barre de démonstration */
.demo-bar {
  position: sticky; top: 0; z-index: var(--z-demo);
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  padding: 6px 12px; height: 44px;
  background: #0E1A33; color: #E8EDF8; font-size: 13px;
}
.demo-bar-marque { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; margin-right: auto; color: #E8EDF8; }
.demo-bar-champ select {
  min-height: 32px; padding: 0 30px 0 10px; border-radius: var(--r-pill);
  border: 1px solid #33426A; background: #17223D; color: #E8EDF8; font-size: 13px; font-weight: 600;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #98A3BD 50%), linear-gradient(135deg, #98A3BD 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.demo-bar-champ { min-width: 0; }
.demo-bar-champ select { max-width: 100%; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .demo-bar { padding: 6px 8px; gap: 6px; }
  .demo-bar-marque span { display: none; }
  .demo-bar-champ select { font-size: 12px; padding-right: 26px; max-width: 44vw; }
}

/* ---------- Application téléphone ---------- */
.mapp-body { background: var(--paper); }
.mapp-scene { display: grid; justify-content: center; }
.mapp {
  position: relative; width: 100%; max-width: 480px; min-height: calc(100dvh - 44px);
  margin: 0 auto; display: flex; flex-direction: column; background: var(--paper);
}
.mapp-head {
  position: sticky; top: 44px; z-index: var(--z-nav);
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--ecole); color: var(--on-ecole);
}
.mapp-head img { width: 34px; height: 34px; border-radius: 9px; }
.mapp-head .titre { display: grid; line-height: 1.15; margin-right: auto; min-width: 0; }
.mapp-head .titre strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapp-head .titre span { font-size: 12px; opacity: .85; }
.mapp-head .btn-ghost { color: var(--on-ecole); }
.mapp-head .btn-ghost:hover { background: rgb(255 255 255 / .14); color: var(--on-ecole); }
.pastille-notif { position: relative; }
.pastille-notif[data-n]::after { content: attr(data-n); position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ecole-2); color: #1A1300; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.mapp-main { flex: 1; padding: 16px 16px 96px; display: grid; gap: 16px; align-content: start; }
.mapp-nav {
  position: sticky; bottom: 0; z-index: var(--z-nav);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.mapp-nav a {
  display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 12px;
}
.mapp-nav a .ic { width: 24px; height: 24px; }
.mapp-nav a[aria-current="page"] { color: var(--ecole-lite); }
.mapp-nav a[aria-current="page"] .ic { transform: translateY(-1px); }

/* Sur grand écran : le téléphone au centre, une colonne d'explication à gauche */
.demo-aide { display: none; }
@media (min-width: 1100px) {
  .mapp-scene { grid-template-columns: minmax(300px, 380px) 430px; gap: 56px; align-items: start; padding: 32px 24px 48px; }
  .mapp {
    max-width: 430px; min-height: 0; height: min(880px, calc(100dvh - 120px));
    border-radius: 44px; border: 10px solid #0E1A33; overflow: hidden auto;
    box-shadow: 0 30px 80px rgb(14 26 51 / .28);
    scrollbar-width: none;
  }
  .mapp::-webkit-scrollbar { display: none; }
  .mapp-head { top: 0; }
  .demo-aide { display: grid; gap: 18px; position: sticky; top: 76px; }
  .demo-aide h1 { font-size: 30px; }
  .demo-aide p { color: var(--ink-2); max-width: 46ch; }
  .demo-aide ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
  .demo-aide li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
  .demo-aide li a:hover { background: var(--surface-2); color: var(--ink); }
}

/* Blocs fréquents dans l'application téléphone */
.bloc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.bloc-titre { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.bloc-titre h2 { font-size: 17px; }
.bloc-titre a, .lien { font-size: 14px; font-weight: 600; color: var(--ecole-lite); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.ligne + .ligne { border-top: 1px solid var(--line); }
.ligne .corps { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ligne .corps strong { font-size: 15px; }
.ligne .corps > span { font-size: 13.5px; color: var(--muted); }
.ligne .fin { text-align: right; display: grid; justify-items: end; gap: 4px; }
.puce-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ecole-soft); color: var(--ecole-lite); flex: none; }
.raccourcis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.raccourcis a { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-align: center; line-height: 1.2; }
.raccourcis a:hover { border-color: var(--ecole-lite); }
.raccourcis .ic { width: 26px; height: 26px; color: var(--ecole-lite); }
.titre-vue { display: grid; gap: 4px; }
.titre-vue h1 { font-size: 24px; }
.titre-vue p { color: var(--muted); font-size: 14.5px; }
.puces { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.puces::-webkit-scrollbar { display: none; }
.puces button { flex: none; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.puces button[aria-pressed="true"] { background: var(--ecole); border-color: var(--ecole); color: var(--on-ecole); }
.alerte { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 500; }
.alerte-info { background: var(--ecole-soft); color: var(--ecole-lite); }
.alerte-ok { background: var(--ok-soft); color: var(--ok); }
.grand-chiffre { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }

/* Carte numérique dans l'application */
.carte-numerique { position: relative; perspective: 1200px; cursor: pointer; border: 0; padding: 0; background: none; width: 100%; border-radius: 16px; }
.carte-numerique .faces { position: relative; aspect-ratio: 1012 / 638; transform-style: preserve-3d; transition: transform 700ms var(--ease); }
.carte-numerique.retournee .faces { transform: rotateY(180deg); }
.carte-numerique canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 16px; backface-visibility: hidden; box-shadow: 0 10px 30px rgb(14 26 51 / .22); }
.carte-numerique canvas.verso { transform: rotateY(180deg); }
.carte-numerique.desactivee canvas { filter: grayscale(1) opacity(.55); }

/* Étapes d'une demande */
.etapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.etapes span { height: 6px; border-radius: 4px; background: var(--surface-3); }
.etapes span.fait { background: var(--ecole-lite); }
.etapes-libelles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Choix du moyen de paiement */
.moyens { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.moyen { display: grid; justify-items: center; gap: 8px; padding: 14px 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; }
.moyen img { height: 34px; width: auto; border-radius: 6px; }
.moyen[aria-pressed="true"] { border-color: var(--ecole-lite); background: var(--ecole-soft); }

/* ---------- Application bureau ---------- */
.dapp { display: grid; grid-template-columns: 264px 1fr; min-height: calc(100dvh - 44px); }
.dapp-side {
  position: sticky; top: 44px; height: calc(100dvh - 44px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
  background: var(--surface); border-right: 1px solid var(--line);
}
.dapp-ecole { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.dapp-ecole img { width: 40px; height: 40px; border-radius: 10px; }
.dapp-ecole strong { display: block; font-size: 15px; line-height: 1.2; }
.dapp-ecole span { font-size: 12.5px; color: var(--muted); }
.dapp-groupe { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dapp-side a.nav {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--ink-2);
}
.dapp-side a.nav:hover { background: var(--surface-2); color: var(--ink); }
.dapp-side a.nav[aria-current="page"] { background: var(--ecole-soft); color: var(--ecole-lite); }
.dapp-side a.nav .compte { margin-left: auto; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); }
.dapp-moi { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line); }
.dapp-moi strong { display: block; font-size: 14px; }
.dapp-moi div > span { font-size: 12.5px; color: var(--muted); }
.dapp-main { min-width: 0; display: flex; flex-direction: column; }
.dapp-top {
  position: sticky; top: 44px; z-index: var(--z-nav);
  display: flex; align-items: center; gap: 12px; padding: 12px 28px; min-height: 64px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.dapp-top h1 { font-size: 20px; margin-right: auto; }
.dapp-top .recherche { position: relative; width: min(320px, 34vw); }
.dapp-top .recherche .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.dapp-top .recherche input { padding-left: 38px; min-height: 40px; border-radius: var(--r-pill); }
.dapp-burger { display: none; }
.dapp-content { padding: 24px 28px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tuile { padding: 16px 18px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; }
.tuile .lib { font-size: 13.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tuile .val { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tuile .det { font-size: 13px; color: var(--muted); }
.tuile-ecole { background: var(--ecole); border-color: var(--ecole); color: var(--on-ecole); }
.tuile-ecole .lib, .tuile-ecole .det { color: color-mix(in srgb, var(--on-ecole) 80%, transparent); }
.barre-outils { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.barre-outils .espace { flex: 1; }
.grille-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }

@media (max-width: 1100px) {
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dapp { grid-template-columns: 1fr; }
  .dapp-side { position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: 280px; z-index: var(--z-sheet); transform: translateX(-100%); transition: transform var(--t) var(--ease); box-shadow: var(--shadow-2); }
  .dapp-side.ouvert { transform: none; }
  .dapp-burger { display: inline-flex; }
  .dapp-top { padding: 10px 16px; }
  .dapp-top .recherche { display: none; }
  .dapp-content { padding: 16px 16px 40px; }
  .tbl-pile thead { display: none; }
  .tbl-pile tr { display: grid; gap: 4px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .tbl-pile td { border: 0; padding: 0; }
  .tbl-pile td[data-lib]::before { content: attr(data-lib) " : "; color: var(--muted); font-size: 13px; }
}
@media (max-width: 520px) {
  .tuiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tuile .val { font-size: clamp(18px, 6vw, 24px); }
}
.voile { position: fixed; inset: 0; background: rgb(8 14 30 / .45); z-index: calc(var(--z-sheet) - 1); }

/* Page affichée dans le téléphone de la présentation (?embed=1) */
.embed .mapp { min-height: 100dvh; }
.embed .mapp-head { top: 0; }
.embed .dapp { min-height: 100dvh; }
.embed .dapp-side, .embed .dapp-top { top: 0; }
.embed .dapp-side { height: 100dvh; }
