:root {
   --bleu: #00058a;
   --turquoise: #0ea1a1;
   --orange: #e67800;
   --fond: #eef3f9;
   --texte: #102a2d;
   --gris: #627579;
   --carte: #ffffff;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
   min-height: 100vh;
   display: grid;
   place-items: start center;
   padding: 24px 16px;
   background: var(--fond);
   color: var(--texte);
   font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.carte {
   width: min(460px, 100%);
   padding: 24px 20px 20px;
   border-radius: 20px;
   background: var(--carte);
   box-shadow: 0 10px 35px rgba(0, 0, 0, .12);
   text-align: center;
}

.logo { display: block; width: min(260px, 80%); height: auto; margin: 0 auto 14px; }

h1 { margin: 0 0 6px; color: var(--bleu); font-size: 1.6rem; }

.consigne { margin: 0 0 18px; color: var(--gris); }

/* -------- Code PIN -------- */
.pin { display: grid; gap: 14px; }

.pin-champ {
   width: 100%;
   min-height: 56px;
   border: 2px solid #b9c6d6;
   border-radius: 12px;
   font-size: 2rem;
   letter-spacing: .5em;
   text-align: center;
   padding-left: .5em;
}

.pin-champ:focus { outline: none; border-color: var(--bleu); }

.pin-clavier {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 10px;
}

.pin-clavier button {
   min-height: 60px;
   border: 0;
   border-radius: 14px;
   background: #e8edf5;
   color: var(--bleu);
   font-size: 1.6rem;
   font-weight: 700;
   cursor: pointer;
   touch-action: manipulation;
}

.pin-clavier button:active { background: #d3dcea; }

.erreur { min-height: 1.4em; margin: 0; color: #b42318; font-weight: 700; }

.erreur:empty { visibility: hidden; }

.valider {
   min-height: 54px;
   border: 0;
   border-radius: 12px;
   background: var(--bleu);
   color: #fff;
   font-size: 1.1rem;
   font-weight: 700;
   cursor: pointer;
}

.est-envoye { opacity: .6; transition: opacity .2s ease; }

/* -------- Liste des applications -------- */
.apps { display: grid; gap: 12px; margin: 0 0 18px; padding: 0; list-style: none; }

.app {
   display: flex;
   align-items: center;
   gap: 14px;
   padding: 12px 14px;
   border: 2px solid #dbe3ee;
   border-radius: 16px;
   color: inherit;
   text-align: left;
   text-decoration: none;
   transition: border-color .15s ease, background-color .15s ease;
}

.app:hover, .app:focus-visible { border-color: var(--bleu); background: #f5f8fc; outline: none; }

.app.est-test { border-color: #f3c9a0; }

.app img { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 14px; }

.app span { display: grid; gap: 3px; min-width: 0; }

.app strong { color: var(--bleu); font-size: 1.2rem; }

.app small { color: var(--gris); font-size: .9rem; line-height: 1.3; }

.bouton-secondaire {
   display: block;
   min-height: 50px;
   padding: 14px;
   border: 2px dashed var(--orange);
   border-radius: 12px;
   color: var(--orange);
   font-weight: 700;
   text-decoration: none;
}

.lien {
   display: inline-block;
   margin-top: 16px;
   padding: 6px;
   border: 0;
   background: none;
   color: var(--gris);
   font: inherit;
   text-decoration: underline;
   cursor: pointer;
}

/* Condition d'accès : puce visible, sur sa propre ligne. */
.app-condition {
   display: flex;
   align-items: center;
   gap: 6px;
   color: #b45309;
   font-size: .85rem;
   font-style: normal;
   font-weight: 700;
}

.app-condition::before {
   content: "";
   flex: 0 0 auto;
   width: 7px;
   height: 7px;
   border-radius: 50%;
   background: currentColor;
}

/* Signature et date de version, discrètes, en bas de la carte. */
.version {
   margin: 18px 0 0;
   color: rgba(97, 112, 135, .72);
   font-size: .68rem;
   line-height: 1.2;
}

/* Sans consigne, la liste suit directement le titre. */
h1 + .apps { margin-top: 16px; }
