/* Connexion rapide (Face ID, empreinte) — includes/_cles_acces.html, includes/_proposition_cr.html, login.html */
#connexion-rapide [hidden], #connexion-rapide[hidden], #cr-proposition [hidden], #cr-proposition[hidden],
#webauthn-login-section[hidden], #webauthn-login-section [hidden], .cr-dlg [hidden] { display: none !important; }

.cr-msg { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; line-height: 1.45; }
.cr-msg[data-ton="info"] { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
.cr-msg[data-ton="ok"] { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.cr-msg[data-ton="erreur"] { background: #FFF1F2; color: #9F1239; border: 1px solid #FECDD3; }

/* Liste des clés (Mon compte) */
.cr-liste { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cr-cle { display: flex; align-items: center; gap: 12px; padding: 12px; background: #F8FAFC; border: 1px solid #E2E8F0; border-radius: 12px; }
.cr-cle__ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: #E6F0F4; color: #006289; display: flex; align-items: center; justify-content: center; }
.cr-cle__ico svg { width: 20px; height: 20px; }
.cr-cle__txt { flex: 1 1 auto; min-width: 0; }
.cr-cle__nom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: #0F172A; overflow-wrap: anywhere; }
.cr-cle__ici { padding: 1px 6px; border-radius: 6px; background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; font-size: 11px; font-weight: 700; }
.cr-cle__meta { margin-top: 2px; font-size: 12px; color: #64748B; line-height: 1.45; }
.cr-cle__actions { flex: none; display: flex; gap: 4px; }
.cr-icone-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: #475569; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.cr-icone-btn:hover { background: #EEF2F6; color: #0F172A; }
.cr-icone-btn--danger { color: #BE123C; }
.cr-icone-btn--danger:hover { background: #FFF1F2; color: #9F1239; }
.cr-icone-btn svg { width: 18px; height: 18px; }
.cr-icone-btn:focus-visible { outline: 3px solid #50A8CB; outline-offset: 1px; }
.cr-vide { margin: 0; padding: 8px 0; font-size: 13px; color: #64748B; }
.cr-note { margin: 0; font-size: 12.5px; color: #64748B; }

/* Fenêtre maison (renommer / supprimer) */
.cr-dlg { border: 0; border-radius: 16px; padding: 22px 20px; width: 100%; max-width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(7, 58, 80, .35); color: #0D2B3A; }
.cr-dlg::backdrop { background: rgba(7, 58, 80, .55); }
.cr-dlg h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.cr-dlg p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: #335566; overflow-wrap: anywhere; }
.cr-dlg label, .cr-dlg__champ { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: #334155; }
.cr-dlg input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 16px; border: 1px solid #CBD5E1; border-radius: 10px; box-sizing: border-box; }
.cr-dlg input:focus { outline: none; border-color: #006289; box-shadow: 0 0 0 3px rgba(0, 98, 137, .15); }
.cr-dlg__err { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: #9F1239; }
.cr-dlg__btns { display: flex; gap: 10px; }
.cr-dlg__btns button { flex: 1 1 0; min-height: 46px; border-radius: 10px; font-size: 14.5px; font-weight: 700; cursor: pointer; border: 1px solid #CBD5E1; background: #fff; color: #334155; }
.cr-dlg__btns [data-ton="principal"] { background: #073A50; border-color: #073A50; color: #fff; }
.cr-dlg__btns [data-ton="danger"] { background: #BE123C; border-color: #BE123C; color: #fff; }
.cr-dlg__btns button:disabled { opacity: .6; cursor: wait; }

/* Proposition (après connexion, fin d'inscription) */
.cr-prop { text-align: center; }
.cr-prop__ico { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; background: #E6F0F4; color: #006289; display: flex; align-items: center; justify-content: center; }
.cr-prop__ico svg { width: 34px; height: 34px; }
.cr-prop__titre { margin: 0 0 10px; font-size: 22px; line-height: 1.25; font-weight: 800; color: #0D2B3A; }
.cr-prop p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; color: #335566; }
.cr-prop__rassure { font-size: 13.5px !important; color: #5C7A88 !important; }
.cr-prop__actions { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.cr-prop__actions form { margin: 0; }
.cr-prop .cr-msg { margin-top: 12px; text-align: left; }
.cr-encart { margin-top: 18px; padding: 18px 16px; border: 1px solid #DCE6EA; border-radius: 14px; background: #F6FAFB; }
.cr-encart .cr-prop__titre { font-size: 18px; }
.cr-encart .cr-prop__ico { width: 48px; height: 48px; margin-bottom: 10px; }
.cr-encart .cr-prop__ico svg { width: 26px; height: 26px; }

/* Page de connexion */
.cr-login-aide { margin: 6px 0 0; text-align: center; font-size: 12.5px; color: #64748B; }
#webauthn-login-msg { margin-top: 10px; }

/* Bouton de connexion en attente de Face ID (login.html) */
.cr-btn-occupe { cursor: progress; opacity: .92; }
.cr-roue { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: cr-tourne .8s linear infinite; flex: none; }
@keyframes cr-tourne { to { transform: rotate(360deg); } }

/* Écran « Connectez-vous plus vite » (core/connexion_rapide_proposer.html)
   Mobile : plein écran, illustration pétrole en haut, texte et actions en bas. Ordinateur : carte centrée. */
body:has(main.crx-main) { background-image: none !important; background-color: #EDF3F5 !important; }
main.crx-main { width: 100%; display: flex; flex-direction: column; }
.crx { flex: 1 1 auto; display: flex; flex-direction: column; }
.crx[hidden] { display: none !important; }
.crx-carte { flex: 1 1 auto; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
/* Mobile (appli iPhone comprise) : l'écran remplit tout l'espace entre la bande du haut et la barre du bas ;
   la place en trop va à l'illustration pétrole (plus de grand vide blanc entre le texte et les boutons),
   et le fond sous la carte est blanc (plus de bande grise au-dessus de la barre du bas). */
@media (max-width: 767.98px) {
  body:has(main.crx-main) { background-color: #fff !important; }
  main.crx-main { min-height: calc(100svh - var(--pwa-offset, 0px) - 69px - var(--sab, 0px)); }
}
.crx-haut { position: relative; flex: 1 1 auto; min-height: min(28vh, 240px); display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 0%, #0A5574 0%, #073A50 62%, #052C3D 100%); color: #fff; }
.crx-visage, .crx-ok { width: 128px; height: 128px; }
.crx-ok { position: absolute; color: #6EE7B7; opacity: 0; transform: scale(.7); transition: opacity .35s ease, transform .35s ease; }
.crx-coin { color: #fff; }
.crx-traits { color: #B9DCEA; }
.crx-scan { color: #50A8CB; opacity: .9; animation: crx-scan 2.6s ease-in-out infinite; }
@keyframes crx-scan { 0%, 100% { transform: translateY(-26px); opacity: 0; } 15%, 85% { opacity: .9; } 50% { transform: translateY(26px); } }
.crx-visage { overflow: visible; }
.crx.is-ok .crx-visage { opacity: 0; transition: opacity .25s ease; }
.crx.is-ok .crx-ok { opacity: 1; transform: none; }
.crx-bas { flex: 0 0 auto; display: flex; flex-direction: column; margin-top: -22px; position: relative; padding: 28px 20px 20px;
  background: #fff; border-radius: 22px 22px 0 0; text-align: center; }
.crx-surtitre { margin: 0 0 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #006289; }
.crx-titre { margin: 0 0 12px; font-family: Newsreader, Georgia, serif; font-weight: 600; font-size: 29px; line-height: 1.12; color: #0D2B3A; letter-spacing: -.01em; }
.crx-texte { margin: 0 0 14px; font-size: 16px; line-height: 1.5; color: #335566; }
.crx-email { font-weight: 700; color: #0D2B3A; overflow-wrap: anywhere; }
.crx-rassure { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #F1F7F9; border: 1px solid #DCE9EE; text-align: left; font-size: 14px; line-height: 1.45; color: #335566; }
.crx-rassure svg { flex: none; width: 22px; height: 22px; color: #047857; margin-top: 1px; }
.crx .cr-msg { margin: 0 0 14px; text-align: left; }
.crx-actions { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.crx-actions form { margin: 0; }
.crx-btn { width: 100%; min-height: 54px; border: 0; border-radius: 14px; background: #073A50; color: #fff; font-size: 17px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(7,58,80,.65); transition: background .15s ease, transform .1s ease; }
.crx-btn:hover { background: #0A4D69; }
.crx-btn:active { transform: scale(.99); }
.crx-btn:focus-visible, .crx-plus-tard:focus-visible { outline: 3px solid #50A8CB; outline-offset: 2px; }
.crx-plus-tard { width: 100%; min-height: 46px; border: 0; background: none; color: #5C7A88; font-size: 15px; font-weight: 600; cursor: pointer; }
.crx-plus-tard:hover { color: #0D2B3A; text-decoration: underline; }
@media (min-width: 768px) {
  main.crx-main { padding: 96px 24px 64px; }
  .crx { margin-top: 16px; }
  .crx { align-items: center; }
  .crx-carte { flex: 0 0 auto; width: 100%; max-width: 460px; border-radius: 22px; border: 1px solid #DCE6EA;
    box-shadow: 0 1px 2px rgba(13,43,58,.04), 0 24px 48px -24px rgba(13,43,58,.35); }
  .crx-haut { min-height: 220px; }
  .crx-bas { padding: 32px 36px 24px; }
  .crx-actions { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .crx-scan { animation: none; opacity: 0; }
  .crx-ok, .crx.is-ok .crx-visage, .crx-btn, .cr-roue { transition: none; }
  .cr-roue { animation-duration: 2.4s; }
}
