/* Carte de visite interactive NexFlow — page publique et aperçu de l'éditeur. Tout est rangé sous .nfc. */
* { box-sizing: border-box; }
html, body { margin: 0; -webkit-text-size-adjust: 100%; }

.nfc {
  --fond: #0d0f14; --surface: #171a22; --surface2: #1f2330; --texte: #eef0f6; --doux: #9aa1b4; --trait: rgba(255,255,255,.08);
  position: relative; min-height: 100vh; min-height: 100dvh; overflow: hidden;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--texte); background: var(--fond);
  padding: max(14px, env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
}
.nfc.clair { --fond: #f4f5f8; --surface: #ffffff; --surface2: #eef0f5; --texte: #14161c; --doux: #5f6678; --trait: rgba(0,0,0,.07); }
.nfc a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.nfc .ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.nfc-halo { position: absolute; inset: -20% -40% auto; height: 520px; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c2) 45%, transparent), transparent 70%),
              radial-gradient(closest-side at 30% 40%, color-mix(in srgb, var(--c1) 55%, transparent), transparent 70%);
  filter: blur(30px); opacity: .55; animation: halo 12s ease-in-out infinite alternate; }
.nfc.clair .nfc-halo { opacity: .35; }
@keyframes halo { to { transform: translate3d(8%, 4%, 0) scale(1.08); } }
.nfc > * { position: relative; z-index: 1; }
.nfc > .nfc-halo { position: absolute; z-index: 0; }

/* Apparition en cascade */
.entre { opacity: 0; transform: translateY(14px); animation: entre .6s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
@keyframes entre { to { opacity: 1; transform: none; } }

.nfc-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.nfc-marque { font-weight: 650; letter-spacing: .02em; font-size: 15px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nfc-rond { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--trait); background: var(--surface); color: var(--texte);
  display: grid; place-items: center; cursor: pointer; }
.nfc-rond:active { transform: scale(.94); }

/* La carte 3D */
.nfc-scene { perspective: 1100px; margin: 4px auto 6px; max-width: 420px; }
.nfc-carte { position: relative; width: 100%; aspect-ratio: 1.586; transform-style: preserve-3d; cursor: pointer; touch-action: pan-y;
  transition: transform .25s ease-out; border-radius: 20px; outline: none; --bx: 30%; --by: 20%; }
.nfc-carte.tourne { transition: transform .7s cubic-bezier(.3,1.3,.5,1); }
.nfc-carte:focus-visible { box-shadow: 0 0 0 3px var(--c2); }
.nfc-face { position: absolute; inset: 0; border-radius: 20px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 24px 50px -18px rgba(0,0,0,.55), 0 2px 0 rgba(255,255,255,.08) inset; }
.recto { color: var(--ct); padding: 20px 22px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, var(--c1) 0%, color-mix(in srgb, var(--c1) 55%, var(--c2)) 55%, var(--c2) 100%); }
.style-uni .recto { background: var(--c1); }
.style-verre .recto { background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 70%, transparent), color-mix(in srgb, var(--c2) 50%, transparent));
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255,255,255,.25); }
.brillance { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--bx) var(--by), rgba(255,255,255,.55), transparent 45%); }
.recto::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.22) 45%, transparent 55%); background-size: 250% 100%;
  animation: reflet 5.5s ease-in-out 1.2s infinite; }
@keyframes reflet { 0%, 60% { background-position: 130% 0; } 100% { background-position: -60% 0; } }
.recto-haut { display: flex; justify-content: space-between; align-items: flex-start; }
.photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.7); }
.logo { max-width: 90px; max-height: 44px; object-fit: contain; }
.logo-seul { max-width: 140px; max-height: 60px; object-fit: contain; }
.initiales { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-weight: 750; font-size: 22px; letter-spacing: .04em;
  background: color-mix(in srgb, var(--ct) 16%, transparent); border: 1px solid color-mix(in srgb, var(--ct) 30%, transparent); }
.recto .nom { font-size: clamp(21px, 6.4vw, 27px); font-weight: 760; letter-spacing: -.01em; line-height: 1.1; }
.recto .metier { font-size: 14px; opacity: .85; margin-top: 3px; }
.recto .coord { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; opacity: .78; margin-top: 10px; font-variant-numeric: tabular-nums; }
.recto .coord span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.puce { position: absolute; right: 22px; top: 50%; width: 30px; height: 22px; border-radius: 5px; transform: translateY(-80%); opacity: .55;
  background: repeating-linear-gradient(90deg, transparent 0 4px, color-mix(in srgb, var(--ct) 35%, transparent) 4px 5px),
              linear-gradient(135deg, color-mix(in srgb, var(--ct) 40%, transparent), color-mix(in srgb, var(--ct) 15%, transparent)); }
.verso { transform: rotateY(180deg); background: var(--surface); color: var(--texte); display: flex; align-items: center; gap: 18px; padding: 18px 22px;
  border: 1px solid var(--trait); }
.qr-boite { background: #fff; border-radius: 14px; padding: 6px; height: 100%; aspect-ratio: 1; flex: none; }
.qr-boite .qr { width: 100%; height: 100%; display: block; }
.verso-texte { display: flex; flex-direction: column; gap: 4px; }
.verso-texte strong { font-size: 19px; }
.verso-texte span { color: var(--doux); font-size: 14px; }
.nfc-indice { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--doux); font-size: 13px; margin: 12px 0 0; }
.nfc-indice .ic { width: 15px; height: 15px; }

.nfc-slogan { text-align: center; font-size: 17px; margin: 14px 8px 0; color: var(--texte); font-weight: 500; }

/* Actions rapides */
.nfc-actions { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 10px; margin: 20px 0 6px; }
.nfc-action { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12.5px; color: var(--doux); }
.bulle { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: var(--texte);
  background: var(--surface); border: 1px solid var(--trait); transition: transform .15s; }
.nfc-action .bulle { color: #fff; border: 0; background: linear-gradient(145deg, var(--c2), color-mix(in srgb, var(--c2) 60%, var(--c1)));
  box-shadow: 0 10px 22px -10px var(--c2); }
.nfc-action:active .bulle, .nfc-reseaux a:active .bulle { transform: scale(.92); }

.nfc-cta { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; padding: 16px 18px; border-radius: 18px; font-weight: 650; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 14px 30px -14px var(--c2); }
.nfc-cta span { flex: 1; }
.fin { margin-left: auto; opacity: .7; width: 18px !important; height: 18px !important; }

.nfc-bloc { margin-top: 26px; }
.nfc-bloc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--doux); margin: 0 0 10px 4px; font-weight: 650; }

/* Services */
.nfc-services { display: flex; flex-direction: column; gap: 8px; }
.nfc-service { background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; overflow: hidden; }
.nfc-service summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 15px 16px; cursor: pointer; }
.nfc-service summary::-webkit-details-marker { display: none; }
.nfc-service .num { font-size: 12px; font-weight: 700; color: var(--c2); font-variant-numeric: tabular-nums; }
.nfc-service .titre { flex: 1; font-weight: 600; }
.nfc-service .prix { font-size: 13px; color: var(--doux); white-space: nowrap; }
.nfc-service .plus { width: 14px; height: 14px; position: relative; flex: none; }
.nfc-service .plus::before, .nfc-service .plus::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 2px; background: var(--doux); transition: transform .25s; }
.nfc-service .plus::after { transform: rotate(90deg); }
.nfc-service[open] .plus::after { transform: rotate(0); }
.nfc-service .detail { padding: 0 16px 16px 42px; color: var(--doux); animation: entre .3s ease forwards; }
.nfc-service .detail p { margin: 0 0 10px; }
.nfc-service .detail a { display: inline-flex; align-items: center; gap: 4px; color: var(--c2); font-weight: 600; filter: brightness(1.25); }
.nfc.clair .nfc-service .detail a { filter: none; }
.nfc-service .detail a .ic { width: 16px; height: 16px; }

/* Liens et réseaux */
.nfc-lien { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--trait); margin-bottom: 10px; }
.nfc-lien .bulle { width: 44px; height: 44px; border-radius: 14px; background: var(--surface2); }
.nfc-lien .txt { display: flex; flex-direction: column; min-width: 0; }
.nfc-lien small { color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nfc-reseaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px 8px; }
.nfc-reseaux a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--doux); }
.nfc-reseaux .bulle { color: #fff; border: 0; }
.r-instagram { background: linear-gradient(45deg, #f9a43a, #e8336d 50%, #8a3ab9) !important; }
.r-facebook { background: #1877f2 !important; }
.r-tiktok { background: #111 !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.r-linkedin { background: #0a66c2 !important; }
.r-youtube { background: #ff0033 !important; }
.r-x { background: #111 !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }

.nfc-info { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; margin-bottom: 10px; }
.nfc-info p { margin: 0; color: var(--texte); }
.nfc-info .ic { color: var(--doux); margin-top: 1px; }

.nfc-pied { text-align: center; color: var(--doux); font-size: 12px; margin: 34px 0 0; opacity: .8; }

/* Barre du bas */
.nfc-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--fond) 55%, transparent); display: flex; justify-content: center; }
.nfc-enregistrer { width: 100%; max-width: 528px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px; border-radius: 18px;
  font-weight: 680; font-size: 17px; background: var(--texte); color: var(--fond) !important; box-shadow: 0 12px 30px -12px rgba(0,0,0,.5);
  animation: pulse 2.8s ease-in-out 2s infinite; }
.nfc-enregistrer:active { transform: scale(.98); }
@keyframes pulse { 0%, 100% { box-shadow: 0 12px 30px -12px rgba(0,0,0,.5), 0 0 0 0 color-mix(in srgb, var(--c2) 60%, transparent); }
  50% { box-shadow: 0 12px 30px -12px rgba(0,0,0,.5), 0 0 0 8px transparent; } }

.nfc-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 6;
  background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 12px; font-size: 14px; pointer-events: none; transition: .25s; }
.nfc-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .entre, .nfc-halo, .recto::after, .nfc-enregistrer { animation: none !important; opacity: 1; transform: none; }
  .nfc-carte, .nfc-carte.tourne { transition: none; }
}

/* Dans l'aperçu de l'éditeur, la barre reste dans le cadre. */
.apercu-cadre .nfc { min-height: 100%; padding-bottom: 96px; }
.apercu-cadre .nfc-barre, .apercu-cadre .nfc-toast { position: absolute; }
.apercu-cadre .entre { animation: none; opacity: 1; transform: none; }
