/* ==========================================================================
   KYcard publique au design « verre » (maquette kyskan_news/profil.html)
   Téléphone : la photo de la personne en plein écran, nette ; au-dessous, une carte de verre bleuté
   (nom + badge, métier, trait, phrase, réseaux en pastilles brillantes, liens en pilules, KYcode « Scanner pour me contacter »),
   puis la barre d'actions en capsule de verre. Ordinateur : la photo reste dans la carte, le fond flou autour.
   Les faces (recto / verso), le KY Memo et l'ajustement automatique (card.js) sont inchangés.
   ========================================================================== */

@property --kg-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.kg {
    --kg-glass: rgba(71, 138, 220, .17);
    --kg-rim: rgba(255, 255, 255, .92);
    --kg-rim-dim: rgba(255, 255, 255, .4);
    --kg-line: rgba(255, 255, 255, .34);
    --kg-lift: 0 1px 8px rgba(8, 12, 35, .3);
    --kg-spring: cubic-bezier(.34, 1.56, .64, 1);
    --kg-out: cubic-bezier(.2, .8, .2, 1);
    font-family: 'Plus Jakarta Sans', Inter, system-ui, var(--cjk, 'PingFang SC'), sans-serif;
}
/* Dans la carte : texte blanc, boutons de verre (les couleurs du thème restent pour le reste) */
.kg .kyc { --text: #fff; --btn: rgba(255, 255, 255, .1); --btn-text: #fff; --border: none; }

/* --- Barre du haut : retour · KYSKAN · langue · options --- */
.kg .kyc-top { display: grid; grid-template-columns: 44px 1fr auto 44px; gap: 8px; }
.kg .kyc-round { width: 38px; height: 38px; border: 0; background: rgba(60, 90, 160, .35);
    box-shadow: inset 0 0 0 .5px rgba(255,255,255,.45), inset 0 0 6px rgba(255,255,255,.12); -webkit-backdrop-filter: blur(8px) saturate(1.3); backdrop-filter: blur(8px) saturate(1.3);
    animation: kg-round 2.4s ease-in-out infinite; transition: transform .35s var(--kg-spring), background .25s; }
.kg .kyc-round:hover { background: rgba(255, 255, 255, .14); animation: none; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.7), 0 0 18px rgba(170,180,255,.35); }
.kg .kyc-round:active { transform: scale(.92); }
.kg .kyc-round svg { width: 19px; height: 19px; }
.kg-brand { position: relative; justify-self: center; display: flex; flex-direction: column; align-items: center; padding-top: 11px; color: #fff; text-decoration: none; text-shadow: var(--kg-lift); }
.kg-brand__spark { position: absolute; top: 0; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 1.2px; transform: rotate(45deg);
    background: linear-gradient(135deg, #fff6d8 0%, #f8dd9c 40%, #e2b673 70%, #c08c55 100%); box-shadow: 0 0 6px rgba(255, 214, 150, .55); animation: kg-spark 3.6s ease-in-out infinite; }
.kg-brand__word { padding-inline-start: 7px; font-size: 18px; line-height: 1; font-weight: 400; letter-spacing: 6.9px; }
.kg-brand__a { position: relative; }
.kg-brand__a::after { content: ''; position: absolute; left: calc(50% - 4.2px); top: 11.6px; width: 2.2px; height: 1.6px; border-radius: 1px; background: #e9a868; box-shadow: 0 0 3px rgba(255,170,90,.8); }
.kg .kyc-top .lang-float .lang-switch > summary { height: 32px; border: 0; color: #fff; background: rgba(60, 90, 160, .35); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.45);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* --- Carte de verre : nom, métier, trait, phrase, réseaux, liens, KYcode --- */
.kg .kyc__body { position: relative; text-align: center; text-shadow: var(--kg-lift); }
.kg .kyc__name { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 8px; font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -.12px; }
.kg .kyc__name .vbadge { margin: 0; }
.kg .kyc__name .vbadge svg { width: 22px; height: 22px; }
.kg .kyc__headline { margin-top: 8px; font-size: 14px; font-weight: 300; letter-spacing: .1px; opacity: .92; }
.kg-rule { width: auto; height: .5px; margin: 11px 23px 0; border: 0; background: linear-gradient(90deg, transparent, var(--kg-line) 18%, var(--kg-line) 82%, transparent); }
.kg .kyc__bio { margin-top: 10px; font-size: 12px; line-height: 1.45; opacity: .92; }
.kg .kyc__where { justify-content: center; font-size: 13px; }
.kg .kyc-itin__label { opacity: .8; }

/* Top 3 : réseaux en pastilles rondes brillantes, liens en pilules de verre (icône · titre · chevron) */
.kg .kyc .kyc-ln--top { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 12px !important; margin-top: 12px !important; }
.kg .kyc .kyc-ln--top > a[style*="--c"], .kg .kyc .kyc-ln--top > .social-id, .kg .kyc .kyc-ln--nets > a[style*="--c"], .kg .kyc .kyc-ln--nets > .social-id { position: relative; order: 0; width: 38px; height: 38px; border: 0; border-radius: 50%; color: #fff;
    background: var(--c); box-shadow: inset 0 1px 1.5px rgba(255,255,255,.32), inset 0 -2px 4px rgba(0,0,0,.2), inset 0 0 0 .75px rgba(255,255,255,.14);
    transition: transform .4s var(--kg-spring), box-shadow .3s var(--kg-out); animation: kg-soc 2.4s ease-in-out infinite; }
.kg .kyc .kyc-ln--top > a[style*="--c"] svg, .kg .kyc .kyc-ln--top > .social-id svg { width: 20px; height: 20px; fill: currentColor; }
.kg .kyc .kyc-ln--top > a[style*="--c"]:hover, .kg .kyc .kyc-ln--top > .social-id:hover { transform: translateY(-3px) scale(1.07); }
.kg .kyc .kyc-ln--top > .kyc-ln__link { order: 1; flex: 1 1 100%; width: auto; height: 42px; flex-direction: row; gap: 0; padding: 0 18px 0 6px; border-radius: 999px; overflow: hidden;
    position: relative; isolation: isolate; text-align: start; color: #fff; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .42);
    animation: kg-link 2.4s ease-in-out infinite; transition: background .3s var(--kg-out), box-shadow .3s var(--kg-out), transform .35s var(--kg-spring); }
.kg .kyc .kyc-ln--top > .kyc-ln__link::after { content: ''; width: 7px; height: 7px; margin-inline-start: auto; border-right: 1.6px solid currentColor; border-top: 1.6px solid currentColor; transform: rotate(45deg); opacity: .9; }
.kg .kyc .kyc-ln--top > .kyc-ln__link:hover { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.75), 0 6px 22px -6px rgba(150,160,255,.55); animation: none; transform: none; }
.kg .kyc .kyc-ln--top .kyc-ln__tile { width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 50%; background: rgba(6, 10, 30, .14); box-shadow: none; color: #fff; }
.kg .kyc .kyc-ln--top .kyc-ln__brand { background: var(--c); }
.kg .kyc .kyc-ln--top .kyc-ln__label { margin-inline-start: 18px; max-width: none; font-size: 12px; font-weight: 500; opacity: 1; }

/* KYcode : « Scanner pour me contacter » (le toucher l'agrandit) */
.kg-qr { position: relative; display: flex; align-items: center; gap: 18px; width: 100%; margin-top: 12px; padding: 5px; border: 0; border-radius: 15px; cursor: zoom-in; color: #fff; text-align: start; font: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .28); }
.kg-qr__tile { position: relative; flex: none; width: 82px; height: 82px; padding: 4px; overflow: hidden; border-radius: 7px; background: #fff; animation: kg-tile 2.4s ease-in-out infinite; transition: transform .4s var(--kg-spring); }
.kg-qr__tile img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.kg-qr__tile b { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; border-radius: 3px; background: #fff;
    color: #1d2549; font: 800 14px/1 'Plus Jakarta Sans', system-ui, sans-serif; }
.kg-qr__tile::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 14px; opacity: 0; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(80,150,255,.35) 70%, rgba(120,180,255,.9)); }
.kg-qr:hover .kg-qr__tile { transform: scale(1.04); }
.kg-qr:hover .kg-qr__tile::after { opacity: 1; animation: kg-scan 1.6s ease-in-out infinite alternate; }
.kg-qr__text { flex: 1; font-size: 12.5px; line-height: 1.5; font-weight: 500; text-shadow: var(--kg-lift); }
.kg-qr__icon { width: 23px; height: 23px; margin-inline-end: 16px; animation: kg-beat 2.4s ease-in-out infinite; }

/* --- Barre d'actions : capsule de verre, liseré irisé qui tourne --- */
.kg .kyc__bar { border-top: 0; color: #fff; background: linear-gradient(180deg, rgba(115,135,205,.3) 0%, rgba(32,42,95,.55) 55%, rgba(18,24,64,.66) 100%);
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
.kg .kyc__act { color: #fff; text-shadow: var(--kg-lift); }
.kg .kyc__act:hover { background: rgba(255, 255, 255, .1); }
.kg .kyc__act svg { filter: drop-shadow(0 0 3px rgba(150, 180, 255, .55)); }

/* --- Verso : même carte de verre --- */
.kg .kyc__title { color: #fff; }
.kg .kyc__body--back .kyc-col li, .kg .kyc__empty { color: #fff; }

/* ==========================================================================
   Téléphone : la photo en plein écran, la carte de verre par-dessus le bas
   ========================================================================== */
@media (max-width: 760px) {
    .kg .kyc-backdrop { inset: 0; filter: none; transform: none; background-position: center top; background-size: cover; }
    .kg .kyc-backdrop:not([style]) { background: url('../img/brand/bg-night.webp') center 30% / cover; }
    .kg .kyc-backdrop::after { background: linear-gradient(to bottom, rgba(8,12,40,.25), transparent 22%, transparent 40%, rgba(20,16,40,.35) 70%, rgba(20,16,40,.55)); }
    .kg .kyc { border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
    .kg .kyc-stage { padding-bottom: 14px; }
    /* Recto : la place de la photo reste une fenêtre sur le fond (le visage), sans cadre */
    .kg .face--front .kyc__hero { flex: 1 1 auto; background: none; min-height: 140px; height: auto; overflow: visible; }
    .kg .kyc__face .kyc__body { flex: 0 1 auto; max-height: calc(100% - 140px); }
    .kg .face--front .kyc__hero::after, .kg .face--front .kyc__photo, .kg .face--front .kyc__initial, .kg .face--front .kyc__brand, .kg .face--front .kyc__qr { display: none; }
    .kg .kyc__fav { width: 40px; height: 40px; border: 0; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.55), 0 4px 12px rgba(10,20,50,.25); }
    /* La carte de verre */
    .kg .kyc__face .kyc__body { margin: 0 10px; padding: 16px 18px 14px; border-radius: 32px; background: var(--kg-glass);
        -webkit-backdrop-filter: blur(18px) saturate(1.35); backdrop-filter: blur(18px) saturate(1.35);
        box-shadow: inset 0 0 1.5px rgba(255,255,255,.45), inset 0 0 9px rgba(255,255,255,.16), 0 0 4px rgba(255,255,255,.22), 0 0 18px 3px rgba(150,170,255,.25); }
    /* Liseré : ombre intérieure (reste au bord même quand la carte défile) */
    .kg .kyc__face .kyc__body { box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), inset 0 0 9px rgba(255,255,255,.16), 0 0 4px rgba(255,255,255,.22), 0 0 18px 3px rgba(150,170,255,.25); }
    .kg .kyc__face.is-scrollable .kyc__body { overscroll-behavior: contain; }
    .kg .home-link { display: none; }
    /* Verso : la couverture laisse place au fond ; le nom au-dessus de la carte */
    .kg .kyc__hero--back { flex: 1 1 auto; background: none !important; height: auto; min-height: 110px; }
    .kg .kyc__hero--back::before, .kg .kyc__hero--back::after, .kg .kyc__hero--back .kyc__brand { display: none; }
    .kg .kyc__back-id { text-align: center; }
    /* Capsule d'actions sous la carte */
    .kg .kyc__bar { margin: 10px 10px 0; padding: 8px 10px; border-radius: 34px;
        box-shadow: inset 0 1px 6px rgba(255,255,255,.12), inset 0 0 14px rgba(110,140,255,.12), 0 0 12px rgba(60,100,255,.18); }
    .kg .kyc__bar::before { content: ''; position: absolute; inset: 0; padding: 1px; border-radius: inherit; pointer-events: none;
        background: conic-gradient(from var(--kg-angle), rgba(255,255,255,.9), rgba(170,195,255,.45) 30deg, rgba(210,220,255,.4) 150deg, rgba(225,175,255,.45) 210deg, rgba(170,195,255,.45) 330deg, rgba(255,255,255,.9));
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: kg-spin 14s linear infinite; }
    .kg .kyc-memo { left: 10px; right: 10px; }
    .kg .kyc-stage > .kyc-dirs, .kg .kyc-stage > [data-pick-wrap] { flex-shrink: 0; }
}
/* Ranger dans mes annuaires : verre de nuit */
.kg .kyc-dirs { color: #fff; background: linear-gradient(180deg, rgba(100,125,200,.42), rgba(24,34,84,.62)); border-color: rgba(255,255,255,.3);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.4), 0 0 12px rgba(60,100,255,.2); }
.kg .kyc-dirs__chips i { color: #fff; background: rgba(255,255,255,.18); }
.kg .kyc-dirs__chips em { color: rgba(255,255,255,.8); }
.kg .kyc-dirs__btn { background: radial-gradient(circle at 50% 40%, #1d72f7 0%, #0a58e2 100%); box-shadow: 0 0 10px rgba(20,95,255,.5); }
.kg .kyc-dirs__opt:hover { background: rgba(255,255,255,.08); }
.kg .kyc-dirs__new input, .kg .kyc-dirs__new select { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }

/* Ordinateur : la carte garde sa photo ; le corps devient un verre sombre */
@media (min-width: 761px) {
    .kg .kyc { background: linear-gradient(180deg, rgba(30, 40, 90, .55), rgba(20, 22, 60, .78)); border-color: rgba(255,255,255,.6); }
    .kg .kyc__body { -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
    .kg .face--front .kyc__qr { display: none; }
}

@keyframes kg-spin { to { --kg-angle: 360deg; } }
@keyframes kg-spark { 0%, 100% { filter: brightness(1); box-shadow: 0 0 6px rgba(255,214,150,.55); } 50% { filter: brightness(1.25); box-shadow: 0 0 11px rgba(255,214,150,.9); } }
@keyframes kg-round { 0%, 100% { box-shadow: inset 0 0 0 .5px rgba(255,255,255,.45), inset 0 0 6px rgba(255,255,255,.12); }
    50% { box-shadow: inset 0 0 0 .5px rgba(255,255,255,.6), inset 0 0 8px rgba(200,215,255,.22), 0 0 10px rgba(140,165,255,.35); } }
@keyframes kg-link { 0%, 100% { box-shadow: inset 0 0 0 .5px rgba(255,255,255,.42); } 50% { box-shadow: inset 0 0 0 .5px rgba(255,255,255,.58), inset 0 0 10px rgba(170,190,255,.1), 0 0 10px rgba(120,150,255,.2); } }
@keyframes kg-tile { 0%, 100% { box-shadow: 0 0 0 rgba(140,180,255,0); } 50% { box-shadow: 0 0 12px rgba(140,180,255,.45); } }
@keyframes kg-soc { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 5px var(--c)); } }
@keyframes kg-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes kg-scan { from { transform: translateY(-14px); } to { transform: translateY(82px); } }
@media (prefers-reduced-motion: reduce) { .kg *, .kg *::before, .kg *::after { animation: none !important; } }

/* Verso : réseaux en pastilles brillantes, liens et KY-CV en pilules de verre */
.kg .kyc .kyc-ln--nets { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 12px !important; max-height: none; }
.kg .kyc .kyc-ln--nets > a[style*="--c"] svg, .kg .kyc .kyc-ln--nets > .social-id svg { width: 20px; height: 20px; fill: currentColor; }
.kg .kyc .socials.kyc-ln-row2 { flex-direction: column; align-items: stretch; gap: 6px; }
.kg .kyc .kyc-ln--links { display: flex !important; flex-direction: column; gap: 6px !important; max-height: none; }
.kg .kyc .kyc-ln--links > a.kyc-ln__link, .kg .kyc .kyc-ln-row2 > a.kyc-ln__cv { width: auto; height: 42px; flex-direction: row; gap: 0; padding: 0 18px 0 6px; border-radius: 999px;
    color: #fff; text-align: start; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .42); animation: kg-link 2.4s ease-in-out infinite; }
.kg .kyc .kyc-ln--links > a.kyc-ln__link::after, .kg .kyc .kyc-ln-row2 > a.kyc-ln__cv::after { content: ''; width: 7px; height: 7px; margin-inline-start: auto; border-right: 1.6px solid currentColor; border-top: 1.6px solid currentColor; transform: rotate(45deg); }
.kg .kyc .kyc-ln--links > a.kyc-ln__link:hover, .kg .kyc .kyc-ln-row2 > a.kyc-ln__cv:hover { transform: none; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.75), 0 6px 22px -6px rgba(150,160,255,.55); }
.kg .kyc .kyc-ln--links .kyc-ln__tile, .kg .kyc .kyc-ln-row2 > a.kyc-ln__cv .kyc-ln__tile { width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 50%; background: rgba(6, 10, 30, .14); box-shadow: none; color: #fff; }
.kg .kyc .kyc-ln--links .kyc-ln__brand { background: var(--c); }
.kg .kyc .kyc-ln--links .kyc-ln__label, .kg .kyc .kyc-ln-row2 > a.kyc-ln__cv .kyc-ln__label { margin-inline-start: 18px; max-width: none; font-size: 12px; font-weight: 500; opacity: 1; }
.kg .kyc__title--rule::after { background: var(--kg-line); }
.kg .kyc .kyc-ln--top > button.kyc-ln__link { border: 0; font: inherit; cursor: pointer; }
.kg .kyc .kyc-ln--links, .kg .kyc .kyc-ln-row2 { width: 100%; align-items: stretch !important; }
.kg .kyc .kyc-ln--links > a.kyc-ln__link, .kg .kyc .kyc-ln-row2 > a.kyc-ln__cv { width: 100%; align-self: stretch; }

/* KY-card privée : la carte garde sa hauteur, les blocs « WeChat » et « Ranger » défilent dessous */
.kg.kyp-page .kyc-stage { justify-content: flex-start; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.kg.kyp-page .kyc { flex: 0 0 auto; height: min(calc(100dvh - 90px), 760px); }
.kg .kyp-wx { color: #fff; background: linear-gradient(180deg, rgba(100,125,200,.45), rgba(24,34,84,.7)); border-color: rgba(255,255,255,.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.4), 0 0 14px rgba(60,100,255,.25); }
.kg .kyp-wx.is-focus { border-color: #07c160; box-shadow: 0 0 0 1px #07c160, 0 0 22px rgba(7,193,96,.35); }
.kg .kyp-wx__lang, .kg .kyp-wx__steps small, .kg .kyp-wx__note { color: rgba(255,255,255,.8); }
.kg .kyp-wx__steps textarea, .kg .kyp-wx__lang select { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); }
.kg .kyp-wx__btn:not(.kyp-wx__btn--main) { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); }
.kg .kyp-wx__done { background: radial-gradient(circle at 50% 40%, #1d72f7 0%, #0a58e2 100%); box-shadow: 0 0 12px rgba(20,95,255,.5); }
