/* ==========================================================================
   SkanAll — scanner de QR Codes KYskan
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.sk {
    min-height: 100vh; min-height: 100dvh; color: #0b1433; background: #eaf1ff;
    font-family: 'Plus Jakarta Sans', Inter, system-ui, var(--cjk), -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.sk::before {
    content: ''; position: fixed; inset: 0; z-index: -2;
    background: url('../img/brand/bg-mobile.webp') center 35% / cover no-repeat;
}
body.sk::after {
    content: ''; position: fixed; inset: 0; z-index: -1;
    background: radial-gradient(ellipse 80% 55% at 50% 30%, rgba(255,255,255,.78) 0%, rgba(255,255,255,.45) 55%, rgba(255,255,255,.1) 100%);
}
@media (min-aspect-ratio: 1/1) {
    body.sk::before { background-image: url('../img/brand/bg-laptop.webp'); background-position: center 60%; }
}
[hidden] { display: none !important; }
.sk-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.sk-top {
    position: relative; z-index: 5; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px;
    max-width: 720px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px 8px;
}
.sk-round {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.85);
    background: rgba(255,255,255,.75); color: #0b1433; text-decoration: none; font-size: 26px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 14px rgba(20,30,80,.12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sk-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.sk-brand__logo { font-size: 26px; }
.sk-brand__tag { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sk-top .lang-switch summary { background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.85); }

/* Accueil */
.sk-main { max-width: 520px; margin: 0 auto; padding: 0 20px 24px; }
.sk-home { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(24px, 9vh, 90px); }
.sk-title { margin: 0; font-size: clamp(52px, 15vw, 76px); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.sk-title span { background: linear-gradient(95deg, #1d6bff, #7b3dff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sk-sub { max-width: 340px; margin: 14px 0 34px; font-size: 16px; line-height: 1.5; color: #2b3452; }
.sk-bigbtn {
    position: relative; display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
    background: radial-gradient(circle at 35% 30%, #3b82ff, #1d4ed8 55%, #312e81);
    box-shadow: 0 0 0 10px rgba(255,255,255,.55), 0 0 0 11px rgba(29,107,255,.35), 0 22px 50px rgba(29,78,216,.45);
    transition: transform .15s ease;
}
.sk-bigbtn::after { content: ''; position: absolute; inset: -22px; border-radius: 50%; border: 2px solid rgba(29,107,255,.35); animation: sk-pulse 2.4s ease-out infinite; }
.sk-bigbtn:hover { transform: scale(1.03); }
.sk-bigbtn:focus-visible { outline: 3px solid #7b3dff; outline-offset: 16px; }
@keyframes sk-pulse { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.25); opacity: 0; } }
.sk-hint { margin: 30px 0 0; font-weight: 700; font-size: 15px; color: #1d4ed8; }
.sk-status { min-height: 1.4em; max-width: 360px; margin: 12px 0 0; font-size: 14px; line-height: 1.45; color: #9a3412; }
.sk-status:empty { margin: 0; }
.sk-import {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; padding: 11px 18px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
    background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(20,30,80,.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.sk-import:focus-within { outline: 3px solid #7b3dff; outline-offset: 3px; }

/* Caméra plein écran */
body[data-state="cam"] { background: #05070f; }
body[data-state="cam"]::before, body[data-state="cam"]::after, body[data-state="cam"] .sk-top, body[data-state="cam"] .bnav { display: none; }
.sk-cam { position: fixed; inset: 0; z-index: 20; background: #05070f; }
.sk-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sk-cam__close { position: absolute; top: max(16px, env(safe-area-inset-top)); inset-inline-start: 16px; z-index: 3; }
.sk-frame { position: absolute; left: 50%; top: 44%; width: min(72vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 2; box-shadow: 0 0 0 100vmax rgba(5,7,15,.45); border-radius: 22px; }
.sk-frame i { position: absolute; width: 48px; height: 48px; border: 5px solid transparent; border-image: linear-gradient(135deg, #1d6bff, #7b3dff 50%, #ff7a2f) 1; }
.sk-frame i:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.sk-frame i:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.sk-frame i:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.sk-frame i:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.sk-line { position: absolute; left: 6%; right: 6%; top: 10%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #3b82ff, #7b3dff, transparent); box-shadow: 0 0 18px 3px rgba(59,130,255,.7); animation: sk-scan 2.2s ease-in-out infinite; }
@keyframes sk-scan { 0%, 100% { top: 10%; } 50% { top: 88%; } }
.sk-pill {
    position: absolute; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom)); z-index: 3; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 14px 22px; border-radius: 999px; white-space: nowrap;
    background: rgba(10,14,30,.72); color: #fff; font-size: 15px; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* Fenêtre du bas */
.sk-sheet { width: min(460px, calc(100vw - 20px)); max-width: none; max-height: calc(100dvh - 30px); margin: auto auto 10px; padding: 0; border: 0; background: transparent; overflow: visible; }
.sk-sheet::backdrop { background: rgba(5, 8, 25, .45); backdrop-filter: blur(3px); }
.sk-sheet__card { position: relative; max-height: calc(100dvh - 30px); overflow-y: auto; padding: 22px 18px 18px; border-radius: 28px; background: rgba(255,255,255,.95); color: #0b1433; box-shadow: 0 -10px 60px rgba(0,0,0,.3); }
.sk-sheet__close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #eef1f8; font-size: 22px; line-height: 1; cursor: pointer; color: #0b1433; }
.sk-sheet__title { margin: 0; font-size: 17px; font-weight: 800; }
.sk-analyse { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 14px 0 8px; text-align: center; }
.sk-analyse__ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #1d6bff, #6d3dff); }
.sk-progress { width: 70%; height: 6px; border-radius: 99px; background: #e6ebf7; overflow: hidden; }
.sk-progress i { display: block; width: 40%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1d6bff, #7b3dff); animation: sk-load 1s ease-in-out infinite alternate; }
@keyframes sk-load { from { transform: translateX(-20%); } to { transform: translateX(170%); } }

/* Aperçu du profil */
.sk-profile__head { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4px; }
.sk-profile__avatar { position: relative; display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: 10px; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 8px 22px rgba(20,30,80,.2); }
.sk-profile__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sk-profile__avatar--initial { color: #fff; font-size: 38px; font-weight: 800; background: linear-gradient(135deg, #1d6bff, #6d3dff); }
.sk-profile__avatar .sk-badge { position: absolute; inset-inline-end: -2px; bottom: 2px; background: #fff; border-radius: 50%; padding: 2px; line-height: 0; }
.sk-profile__name { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 21px; font-weight: 800; }
.sk-badge { display: inline-flex; line-height: 0; }
.sk-profile__headline { margin: 4px 0 0; font-size: 14.5px; color: #3b4466; }
.sk-profile__location { margin: 2px 0 0; font-size: 13px; color: #5b6479; }
.sk-links { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.sk-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: #f5f7fc; border: 1px solid #eaeef7; color: #0b1433; text-decoration: none; font-weight: 600; font-size: 15px; }
.sk-link:hover { background: #eef3ff; }
.sk-link__ico { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: #e7eeff; color: #1d4ed8; }
.sk-link__ico--emoji { font-size: 18px; }
.sk-link__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-link__chev { flex-shrink: 0; color: #9aa3b8; }

/* Boutons */
.sk-actions { display: grid; gap: 10px; margin-top: 16px; }
.sk-actions__row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sk-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid #dfe4f0;
    background: #fff; color: #0b1433; font: inherit; font-weight: 700; font-size: 14.5px; text-decoration: none; cursor: pointer;
}
.sk-btn--primary { min-height: 54px; border: 0; color: #fff; font-size: 16px; background: linear-gradient(95deg, #1d6bff, #6d3dff); box-shadow: 0 10px 26px rgba(29,78,216,.35); }
.sk-btn--ghost { border-color: transparent; background: transparent; color: #1d4ed8; }
.sk-btn:focus-visible, .sk-link:focus-visible, .sk-round:focus-visible, .sk-sheet__close:focus-visible { outline: 3px solid #7b3dff; outline-offset: 2px; }
.sk-other__value { margin: 10px 0 0; padding: 12px 14px; border-radius: 14px; background: #f5f7fc; font-size: 14px; overflow-wrap: anywhere; }
.sk-other .sk-actions { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
    .sk-bigbtn::after, .sk-line, .sk-progress i { animation: none; }
    .sk-line { top: 50%; }
}

.sk-top__end { display: flex; align-items: center; gap: 6px; }
.sk-top .theme-btn { width: 42px; height: 42px; border-color: rgba(255,255,255,.85); background: rgba(255,255,255,.75); box-shadow: 0 4px 14px rgba(20,30,80,.12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
@media (max-width: 400px) { .sk-top .lang-switch summary span { display: none; } .sk-brand__tag { display: none; } }

/* ===== Mode sombre ===== */
:root[data-theme="dark"] body.sk { color: #f3f6ff; background: #081033; color-scheme: dark; }
:root[data-theme="dark"] body.sk::before { filter: brightness(.6) saturate(1.2); }
:root[data-theme="dark"] body.sk::after { background: radial-gradient(ellipse 80% 55% at 50% 30%, rgba(6,12,42,.72) 0%, rgba(6,12,42,.5) 55%, rgba(6,12,42,.25) 100%); }
:root[data-theme="dark"] .sk-round, :root[data-theme="dark"] .sk-top .theme-btn, :root[data-theme="dark"] .sk-top .lang-switch summary, :root[data-theme="dark"] .sk-import {
    background: rgba(16,26,70,.7); border-color: rgba(255,255,255,.14); color: #f3f6ff; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
:root[data-theme="dark"] .sk-sub { color: #d4dbf6; }
:root[data-theme="dark"] .sk-hint { color: #8fb4ff; }
:root[data-theme="dark"] .sk-status { color: #ffb08f; }
:root[data-theme="dark"] .sk-bigbtn { box-shadow: 0 0 0 10px rgba(16,26,70,.6), 0 0 0 11px rgba(143,180,255,.35), 0 22px 50px rgba(0,0,0,.5); }
:root[data-theme="dark"] .sk-sheet__card { background: rgba(14,22,58,.97); color: #f3f6ff; }
:root[data-theme="dark"] .sk-sheet__close { background: rgba(255,255,255,.1); color: #f3f6ff; }
:root[data-theme="dark"] .sk-progress { background: rgba(255,255,255,.1); }
:root[data-theme="dark"] .sk-profile__avatar { box-shadow: 0 0 0 4px #0e163a, 0 8px 22px rgba(0,0,0,.4); }
:root[data-theme="dark"] .sk-profile__avatar .sk-badge { background: #0e163a; }
:root[data-theme="dark"] .sk-profile__headline { color: #d4dbf6; }
:root[data-theme="dark"] .sk-profile__location { color: #a4aed3; }
:root[data-theme="dark"] .sk-link, :root[data-theme="dark"] .sk-other__value { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); color: #f3f6ff; }
:root[data-theme="dark"] .sk-link:hover { background: rgba(255,255,255,.1); }
:root[data-theme="dark"] .sk-link__ico { background: #1a2350; color: #8fb4ff; }
:root[data-theme="dark"] .sk-link__chev { color: #7d88b0; }
:root[data-theme="dark"] .sk-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #f3f6ff; }
:root[data-theme="dark"] .sk-btn--primary { background: linear-gradient(95deg, #1d6bff, #6d3dff); border: 0; }
:root[data-theme="dark"] .sk-btn--ghost { background: transparent; border-color: transparent; color: #8fb4ff; }
/* QR Code d'un autre réseau : créer la fiche de la personne dans ses KYP (doré, comme le patch KYP) */
.sk-btn--kyp { color: #6b4700; font-weight: 800; background: linear-gradient(135deg, #fff1c4, #f5c542); border-color: #e0a92a; }
:root[data-theme="dark"] .sk-btn--kyp { color: #4a3100; background: linear-gradient(135deg, #ffe7a3, #f5c542); border-color: #e0a92a; }

/* Accueil du visiteur : le compte en petit sous SkanAll */
.sk-round--blank { visibility: hidden; }
.sk-account { margin: 26px 0 0; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.sk-account a { color: #1d4ed8; text-decoration: none; padding: 6px 4px; }
.sk-account a:hover { text-decoration: underline; }
.sk-account span { color: #94a3b8; }
.sk-pitch { margin: 6px auto 0; max-width: 300px; font-size: 12.5px; line-height: 1.45; color: #334155; text-align: center; text-shadow: 0 1px 8px rgba(255,255,255,.95); }
.sk-legal { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); text-align: center; font-size: 11px; color: #64748b; }
.sk-legal .legal-links { justify-content: center; }
.sk-legal a { color: inherit; text-shadow: 0 1px 6px rgba(255,255,255,.9); }
.sk-save { margin: 0; }
.sk-save .sk-btn { width: 100%; }
:root[data-theme="dark"] .sk-account a { color: #8fb4ff; }
:root[data-theme="dark"] .sk-pitch, :root[data-theme="dark"] .sk-legal { color: #a9b6d8; }

:root[data-theme="dark"] .sk-pitch, :root[data-theme="dark"] .sk-legal a { text-shadow: none; }
.sk-pitch a { color: #1d4ed8; font-weight: 700; text-decoration: none; white-space: nowrap; }
:root[data-theme="dark"] .sk-pitch a { color: #8fb4ff; }

/* Visiteur venu par le KYcode d'un membre : « Rejoignez vite Kyskan.com », SkanAll en plus petit dessous */
.sk-home--invite { padding-top: 8px; }
.sk-invite { width: min(420px, 100%); margin: 0 0 18px; padding: 16px 18px 14px; border-radius: 26px; text-align: center;
    background: rgba(255,255,255,.88); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 18px 44px rgba(10,20,50,.18);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.sk-invite__card { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 10px; border-radius: 16px; text-align: start; text-decoration: none; color: inherit; background: #f1f5fd; }
.sk-invite__photo { flex-shrink: 0; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; overflow: hidden; font-size: 20px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #1a5cf0, #e2513a); }
.sk-invite__photo img { width: 100%; height: 100%; object-fit: cover; }
.sk-invite__who { min-width: 0; display: flex; flex-direction: column; }
.sk-invite__who strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-invite__who small { font-size: 13px; color: #56607e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sk-invite__title { margin: 4px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.sk-invite__text { margin: 0 0 14px; font-size: 14.5px; line-height: 1.45; color: #2b3452; }
.sk-invite__yes { width: 100%; }
.sk-invite__no { display: inline-block; margin-top: 10px; padding: 6px; font-size: 14px; font-weight: 600; color: #56607e; }
.sk-invite__login { margin: 6px 0 0; font-size: 13px; color: #56607e; }
.sk-invite__login a { color: #1d4ed8; font-weight: 700; text-decoration: none; }
.sk-home--invite .sk-title { font-size: 34px; }
.sk-home--invite .sk-sub { margin: 4px 0 14px; font-size: 13px; }
.sk-home--invite .sk-bigbtn { transform: scale(.72); margin: -18px 0; }
.sk-home--invite .sk-hint { margin-top: 6px; }
:root[data-theme="dark"] .sk-invite { background: rgba(14,22,58,.9); border-color: rgba(255,255,255,.14); }
:root[data-theme="dark"] .sk-invite__card { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .sk-invite__text, :root[data-theme="dark"] .sk-invite__who small, :root[data-theme="dark"] .sk-invite__no, :root[data-theme="dark"] .sk-invite__login { color: #a9b6d8; }
:root[data-theme="dark"] .sk-invite__login a { color: #8fb4ff; }
