@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&display=swap');

:root {
  --gold-1: #F8EBB0;
  --gold-2: #CDA531;
  --gold-3: #7E611A;
  --gold-line: #8C7A34;
  --cream: #F5EFDD;
  --cream-dim: rgba(245, 239, 221, 0.75);
  --error: #FF8A80;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100dvh;
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: #012304;
  color: var(--cream);
}

.screen {
  width: 100%;
  max-width: 402px;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.screen.active { display: flex; }

/* Logo fixe, pile au meme endroit en haut de l'ecran, quel que soit
   l'ecran affiche -- sinon il "danse" selon la hauteur du contenu au
   dessus de lui dans chaque .screen. */
.mark {
  position: fixed;
  top: max(28px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: 83px;
  height: 56px;
  margin: 0;
  z-index: 5;
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.25))
    drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45))
    drop-shadow(0 2px 8px rgba(205, 165, 49, 0.35));
}
.mark path { fill: url(#markGradient); }

.mark.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.75; }
}

/* --- Onboarding --- */
/* Button - Liquid Glass - Text */


#screen-onboarding h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
}
#screen-onboarding p {
  font-size: 14px;
  color: var(--cream-dim);
  margin: 0 0 32px;
  max-width: 300px;
}
.field {
  width: 100%;
  margin-bottom: 28px;
  text-align: left;
}
.field label {
  display: block;
  font-size: 13px;
  color: var(--cream-dim);
  margin-bottom: 10px;
}
.field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gold-line);
  padding: 0 0 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--cream);
  outline: none;
  text-align: center;
}
.field input:focus { border-color: var(--gold-1); }

.field textarea,
.field select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gold-line);
  padding: 8px 0 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--cream);
  outline: none;
  resize: none;
}
.field textarea:focus,
.field select:focus { border-color: var(--gold-1); }
.field select option { color: #1a1a1a; }

#contrib-statut {
  margin-top: 14px;
  font-size: 13px;
  color: var(--cream-dim);
  min-height: 18px;
}

/* --- Ecran de validation --- */
.validation-liste {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.validation-liste p {
  font-size: 14px;
  color: var(--cream-dim);
}
.validation-item {
  border: 1px solid rgba(140, 122, 52, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
}
.validation-auteur {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gold-1);
}
.validation-texte {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.4;
}
.validation-actions {
  display: flex;
  gap: 10px;
}
.validation-actions .btn-gold {
  padding: 10px 18px;
  font-size: 13px;
  margin-top: 0;
}
.validation-actions .reset-link {
  margin-top: 0;
}

.onboarding-erreur {
  min-height: 16px;
  margin: -14px 0 18px;
  font-size: 13px;
  color: var(--error);
  text-align: center;
}

.relation-progression {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin: -6px 0 6px;
}

.relation-question {
  font-size: 17px;
  line-height: 1.4;
  margin-bottom: 20px;
  font-weight: 600;
}


.btn-gold {
  border: none;
  border-radius: 1000px;
  cursor: pointer;
  padding: 15px 36px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #2b2205;
  background: linear-gradient(180deg, #F8EBB0 0%, #CDA531 55%, #7E611A 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -6px 10px rgba(0,0,0,0.18),
    0 6px 18px rgba(0,0,0,0.35);
  transition: transform 0.15s ease;
}
.btn-gold:hover { transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); }

/* --- Loading (écran d'accroche) --- */
#screen-loading p {
  font-size: 14px;
  color: var(--cream-dim);
  margin-top: 4px;
}

/* --- Punchline card --- */
.owner-tag {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-1);
  margin-bottom: 10px;
}

/* --- Texte brut flouté, net au tap (plus de cadre/carte autour) --- */

.reveal-zone {
  width: 100%;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  animation: cardIn 0.5s ease forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
@keyframes cardIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal-texte {
  margin: 0;
  font-family: 'Baloo 2', 'Inter', system-ui, sans-serif;
  font-size: 36px;
  line-height: 1.35;
  font-weight: 700;
  text-align: center;
  filter: blur(9px);
  transition: filter 0.4s ease;
  user-select: none;
}
.reveal-zone.revele .reveal-texte {
  filter: blur(0);
}

.screen-none-texte {
  font-family: 'Baloo 2', 'Inter', system-ui, sans-serif;
  font-size: 24px;
  line-height: 1.4;
  font-weight: 700;
  margin-top: 18px;
}

.flip-hint {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--cream-dim);
  animation: hintPulse 1.8s ease-in-out infinite;
  transition: opacity 0.3s ease;
}
.reveal-zone.revele .flip-hint {
  opacity: 0;
  pointer-events: none;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Icônes rondes discrètes en haut des écrans -- flèche retour à gauche,
   bonhomme "compte" à droite. Plus sobres que les .fab du bas (actions
   secondaires de navigation, pas des actions principales). */
.top-icon {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.top-icon svg { width: 19px; height: 19px; }
.top-icon:hover { background: rgba(255,255,255,0.08); border-color: var(--gold-1); }
.top-icon-left { left: max(20px, env(safe-area-inset-left)); }
.top-icon-right { right: max(20px, env(safe-area-inset-right)); }

.compte-infos {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 0 28px;
}
.compte-ligne {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.03);
}
.compte-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-2);
}

/* Boutons ronds flottants, ancrés aux coins bas de l'écran (façon maquette
   fournie), verts façon DA de l'app plutôt que bleus. */
.fab {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 20;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(248, 235, 176, 0.35);
  background: radial-gradient(circle at 32% 28%, #2F8F4E, #0F5A26 70%);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255,255,255,0.18);
  transition: transform 0.15s ease, background 0.15s ease;
}
.fab svg { width: 22px; height: 22px; }
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: translateY(0); }
.fab-left { left: max(24px, env(safe-area-inset-left)); }
.fab-right { right: max(24px, env(safe-area-inset-right)); }

.badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5484d;
  box-shadow: 0 0 0 2px rgba(1, 25, 4, 0.9);
}
.badge-dot[hidden] { display: none; }

.reset-link {
  margin-top: 26px;
  font-size: 12px;
  color: var(--cream-dim);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

/* --- Demo panel (aide au test sans vraie puce NFC) --- */
.demo-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px 14px;
  background: rgba(1, 20, 4, 0.85);
  border-top: 1px solid var(--gold-line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  font-size: 11px;
}
.demo-panel .demo-label {
  width: 100%;
  text-align: center;
  color: var(--cream-dim);
  margin-bottom: 2px;
}
.demo-panel button {
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--cream);
  border-radius: 20px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}
.demo-panel button:hover { border-color: var(--gold-1); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translate(-50%, 12px);
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(1, 35, 4, 0.95);
  border: 1px solid var(--gold-line);
  color: var(--cream);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: 90vw;
  text-align: center;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
