/* Charte Growthappiness v2 : prune, néon, violet, crème. Jaune réservé au logo. */
@font-face { font-family: 'Space Grotesk'; font-weight: 400 700; font-display: swap; src: url(/fonts/spacegrotesk-753e9d.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-1ab1ad.woff2) format('woff2'); }

:root {
  --prune: #240F33; --prune-2: #321747; --prune-3: #40205a;
  --neon: #C77DFF; --violet: #B46FE6; --creme: #F6EFE5;
  --muted: rgba(246, 239, 229, .66); --line: rgba(246, 239, 229, .14);
  --ok: #7ee2b8; --warn: #ffb37e;
  --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--prune); color: var(--creme);
  font: 16px/1.5 Inter, system-ui, sans-serif;
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(199, 125, 255, .28), transparent 60%);
  background-attachment: fixed;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
}
h1, h2, .btn, .page-title { font-family: 'Space Grotesk', Inter, sans-serif; }
a { color: var(--neon); }
code { font-size: .85em; word-break: break-all; color: var(--neon); }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Boutons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 54px; padding: 14px 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .12s, background .2s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--neon); color: var(--prune); box-shadow: 0 8px 30px rgba(199, 125, 255, .35); }
.btn.ghost { background: transparent; color: var(--creme); border-color: rgba(199, 125, 255, .55); }
.btn.small { min-height: 42px; width: auto; font-size: 15px; padding: 8px 16px; background: var(--prune-3); color: var(--creme); }
.btn.small.ghost { background: transparent; }
.btn:disabled { opacity: .5; }
.warn-btn { color: var(--warn) !important; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 8px; }

/* Page publique */
.profile { max-width: 420px; margin: 0 auto; padding-top: 28px; text-align: center; }
.wordmark { height: 26px; width: auto; margin-bottom: 28px; }
.avatar { width: 160px; height: 160px; margin: 0 auto 18px; border-radius: 50%; padding: 4px; background: conic-gradient(from 200deg, var(--neon), var(--violet), var(--prune-3), var(--neon)); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; border: 3px solid var(--prune); }
.avatar.small { width: 96px; height: 96px; }
.profile h1 { font-size: 34px; line-height: 1.1; margin: 0 0 6px; letter-spacing: -.02em; }
.role { margin: 0; font-weight: 600; color: var(--neon); }
.tagline { margin: 6px 0 26px; color: var(--muted); }
.actions { display: grid; gap: 12px; }
.quick { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; padding: 0; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: var(--r);
  background: rgba(246, 239, 229, .06); border: 1px solid var(--line); color: var(--creme); text-decoration: none; font-size: 13px;
}
.quick .ico { width: 24px; height: 24px; color: var(--neon); }
.ticket {
  display: block; text-align: left; padding: 16px 18px; border-radius: var(--r); text-decoration: none; color: var(--creme);
  background: linear-gradient(120deg, rgba(180, 111, 230, .35), rgba(199, 125, 255, .12)); border: 1px dashed rgba(199, 125, 255, .6);
}
.ticket strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 17px; }
.ticket span { font-size: 14px; color: var(--muted); }
.foot { margin-top: 26px; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); }
.thanks h1 { margin-top: 4px; }

/* Formulaires et pages texte */
.sheet { max-width: 520px; margin: 0 auto; padding-top: 22px; }
.sheet h1 { font-size: 28px; line-height: 1.15; margin: 10px 0 8px; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.form { display: grid; gap: 12px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
input, textarea {
  width: 100%; font: 16px Inter, sans-serif; color: var(--creme); background: rgba(246, 239, 229, .07);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none;
}
input:focus, textarea:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(199, 125, 255, .25); }
input::placeholder, textarea::placeholder { color: rgba(246, 239, 229, .38); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; color: var(--creme); }
label.check input { width: 22px; height: 22px; flex: none; accent-color: var(--neon); margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.legal { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.legal a { color: var(--muted); }
.prose p, .prose li { color: rgba(246, 239, 229, .85); }
.prose h2 { font-size: 19px; margin-top: 28px; }
.flash, .warn { padding: 12px 14px; border-radius: 12px; font-size: 15px; margin: 0 0 14px; }
.flash { background: rgba(126, 226, 184, .12); color: var(--ok); }
.warn { background: rgba(255, 179, 126, .12); color: var(--warn); }
.muted { color: var(--muted); font-size: 14px; }

/* Espace d'Audrey */
.app { background-image: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; max-width: 640px; margin: 0 auto; padding: 12px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--creme); text-decoration: none; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.page-title { max-width: 640px; margin: 18px auto 12px; font-size: 26px; overflow-wrap: anywhere; }
.app-main { max-width: 640px; margin: 0 auto; }
.app-main h2 { font-size: 18px; margin: 26px 0 10px; }
.big-actions { display: grid; gap: 10px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 16px; }
.stats div { background: var(--prune-2); border-radius: 12px; padding: 10px; text-align: center; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font: 700 24px 'Space Grotesk', sans-serif; color: var(--neon); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar form { margin: 0; }
.search input { margin-bottom: 12px; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list a { display: flex; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 14px; background: var(--prune-2); color: var(--creme); text-decoration: none; }
.who { display: grid; min-width: 0; }
.who strong, .who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small, .meta small { color: var(--muted); font-size: 12.5px; }
.meta { display: grid; justify-items: end; align-content: start; gap: 3px; flex: none; }
.empty { color: var(--muted); padding: 20px; text-align: center; }
.badge, .hs { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.echange { background: rgba(199, 125, 255, .2); color: var(--neon); }
.badge.capture { background: rgba(246, 239, 229, .12); color: var(--creme); }
.hs.ok { color: var(--ok); } .hs.a_faire { color: var(--muted); } .hs.erreur { color: var(--warn); }
.hs-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.capture { display: grid; gap: 10px; margin-bottom: 18px; padding: 14px; border-radius: var(--r); background: var(--prune-2); }
.capture details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.capture textarea { margin: 8px 0; }
#preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; background: #000; }
.card-detail { padding: 14px; border-radius: var(--r); background: var(--prune-2); }
.fields { display: grid; gap: 10px; margin: 0; }
.fields dt { font-size: 12.5px; color: var(--muted); }
.fields dd { margin: 0; overflow-wrap: anywhere; }
details.danger { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 12px; }
details.danger summary { color: var(--muted); cursor: pointer; }
details.danger form { margin-top: 12px; }
.qr-card { background: var(--creme); color: var(--prune); border-radius: var(--r); padding: 20px; text-align: center; max-width: 300px; margin: 12px auto 16px; }
.qr-card .qr svg { width: 100%; height: auto; display: block; }
.qr-card p { margin: 8px 0 0; font: 700 15px 'Space Grotesk', sans-serif; }

@media (max-width: 360px) { .form .row { grid-template-columns: 1fr; } .stats { grid-template-columns: repeat(2, 1fr); } }

/* Scan de carte côté visiteur */
.scan { display: grid; gap: 12px; margin: 4px 0 8px; padding: 14px; border-radius: var(--r); background: var(--prune-2); border: 1px solid rgba(199, 125, 255, .35); }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot { position: relative; display: grid; place-items: center; aspect-ratio: 1.6; border-radius: 12px; border: 1.5px dashed rgba(199, 125, 255, .6); background: rgba(246, 239, 229, .04); color: var(--creme); cursor: pointer; overflow: hidden; text-align: center; }
.shot span { display: grid; justify-items: center; gap: 4px; font-size: 15px; font-weight: 600; }
.shot small { font-weight: 500; color: var(--muted); font-size: 12px; }
.shot .ico { width: 26px; height: 26px; color: var(--neon); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot.done { border-style: solid; border-color: var(--neon); }
.shot.done span { position: absolute; bottom: 6px; left: 6px; right: 6px; padding: 4px; border-radius: 8px; background: rgba(36, 15, 51, .8); font-size: 13px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 14px 0 10px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
input.filled { border-color: rgba(199, 125, 255, .6); }

/* Visée caméra plein écran, façon scan de carte bancaire */
body.cam-on { overflow: hidden; }
.cam { position: fixed; inset: 0; z-index: 50; background: #000; }
.cam[hidden] { display: none; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .18s; }
.cam.flash::after { opacity: .7; transition: none; }
.cam-guide {
  --p: 0; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: min(88vw, 560px); aspect-ratio: 1.586; border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(10, 4, 16, .62);
  outline: 2px solid rgba(246, 239, 229, calc(.35 + .65 * var(--p)));
  transition: outline-color .15s;
}
.cam-guide.lock { outline-color: var(--neon); }
.cam-guide i { position: absolute; width: 30px; height: 30px; border: 4px solid var(--neon); }
.cam-guide i:nth-child(1) { top: -4px; left: -4px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.cam-guide i:nth-child(2) { top: -4px; right: -4px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.cam-guide i:nth-child(3) { bottom: -4px; left: -4px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.cam-guide i:nth-child(4) { bottom: -4px; right: -4px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.cam-guide::after { content: ''; position: absolute; left: 0; bottom: -14px; height: 4px; border-radius: 4px; width: calc(100% * var(--p)); background: var(--neon); transition: width .14s linear; }
.cam-hint { position: absolute; left: 16px; right: 16px; top: calc(42% + min(88vw, 560px) / 3.172 + 34px); margin: 0; text-align: center; font: 600 18px 'Space Grotesk', Inter, sans-serif; color: var(--creme); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.cam-actions { position: absolute; left: 0; right: 0; bottom: calc(28px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 22px; }
.cam-shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid var(--creme); background: rgba(246, 239, 229, .25); cursor: pointer; }
.cam-shutter:active { background: var(--neon); }
.cam-btn { justify-self: start; min-width: 48px; height: 48px; border-radius: 24px; border: 0; background: rgba(246, 239, 229, .16); color: var(--creme); font: 600 16px Inter, sans-serif; padding: 0 14px; cursor: pointer; }
.cam-btn.wide { justify-self: end; }
.scan > .link { justify-self: center; }
.stats-title { font-size: 15px; margin: 4px 0 8px; color: var(--creme); }
.stats-title small, .stats dd small { font-size: 12px; font-weight: 500; color: var(--muted); }
