/* ============================================================
   LA FORGE — AUTH (Inscription / Connexion)
   Système partagé, fidèle à La Forge.html (design system Mindset Journey)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

:root {
  /* Palette — identique au landing */
  --noir:        #0d0d0d;
  --noir-2:      #121110;
  --surface:     #181613;
  --surface-2:   #201d18;
  --gold:        #cf6e22;
  --gold-bright: #ea8636;
  --ember:       #c97a32;
  --white:       #f5f5f5;
  --muted:       #9a9387;
  --muted-dim:   #6b655c;
  --border:      rgba(207,110,34,0.16);
  --border-soft: rgba(245,245,245,0.07);
  --error:       #c0492b;
  --ok:          #7fa05a;

  --font-title: 'Bebas Neue', 'Arial', 'Helvetica Neue', sans-serif;
  --font-body:  'DM Sans', -apple-system, Segoe UI, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --grain-opacity: 0.05;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--noir);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain global chaud */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96  0 0 0 0 0.82  0 0 0 0 0.45  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
}
::selection { background: var(--gold); color: var(--noir); }

a { color: inherit; }

/* ============================================================
   STAGE + COUCHES DE FOND
   ============================================================ */
.auth-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Lueurs de braise */
.auth-glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(58% 50% at 50% 18%, rgba(201,122,50,0.14) 0%, transparent 60%),
    radial-gradient(70% 55% at 50% 118%, rgba(207,110,34,0.16) 0%, transparent 62%);
}

/* Cercle Ensō en filigrane derrière la carte */
.auth-enso {
  position: absolute; left: 50%; top: 52%;
  transform: translate(-50%, -50%);
  width: clamp(440px, 64vw, 760px); height: clamp(440px, 64vw, 760px);
  z-index: 0; opacity: 0.5; pointer-events: none;
}
.auth-enso { background: url("assets/enso-brush-ember.png") center/contain no-repeat; filter: drop-shadow(0 0 60px rgba(207,110,34,0.18)); }
.auth-enso svg { display: none; }  /* médaillon au pinceau à la place de l'anneau animé */
.auth-enso .enso-path {
  stroke: var(--gold); stroke-width: 3.4; fill: none; stroke-linecap: round;
  opacity: 0.16;
  stroke-dasharray: 1100; stroke-dashoffset: 1100;
  animation: drawEnso 2.6s var(--ease) 0.25s forwards;
}
@keyframes drawEnso { to { stroke-dashoffset: 0; } }

/* Chiffre d'édition en filigrane */
.auth-watermark {
  position: absolute; right: -2%; bottom: -8%;
  font-family: var(--font-title);
  font-size: clamp(260px, 42vw, 560px);
  line-height: 0.7; color: var(--white);
  opacity: 0.02; z-index: 0; pointer-events: none; user-select: none;
  letter-spacing: -0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .auth-enso .enso-path { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   CHROME (logo + lien haut-droit)
   ============================================================ */
.auth-top {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px clamp(22px, 4vw, 48px);
}
.auth-logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-title); font-size: 22px;
  letter-spacing: 0.04em; color: var(--white); text-decoration: none;
}
.auth-logo .enso-mark { width: 26px; height: 26px; flex-shrink: 0; background: url("assets/enso-brush-ember.png") center/contain no-repeat; }
.enso-mark path { stroke: transparent; }  /* pinceau à la place de l'anneau géométrique */
.auth-logo b { font-weight: 400; color: var(--gold); }

.auth-top-link {
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.25s var(--ease);
}
.auth-top-link b { color: var(--gold); font-weight: 600; }
.auth-top-link:hover { color: var(--white); }

/* ============================================================
   ZONE CENTRALE + CARTE
   ============================================================ */
.auth-main {
  position: relative; z-index: 2;
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 24px clamp(22px, 4vw, 48px) 56px;
}
.auth-card {
  width: 100%; max-width: 452px;
  background: linear-gradient(180deg, rgba(24,22,19,0.9), rgba(18,17,16,0.92));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: clamp(34px, 4.5vw, 52px) clamp(26px, 4vw, 46px);
  box-shadow: 0 30px 80px -34px rgba(13,13,13,0.95), inset 0 1px 0 rgba(245,245,245,0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Eyebrow */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
  display: inline-flex; align-items: center; gap: 11px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: var(--gold); display: inline-block;
}

/* Titres */
.auth-h1 {
  font-family: var(--font-title); font-weight: 400; text-transform: uppercase;
  font-size: clamp(40px, 6vw, 58px); line-height: 0.9; letter-spacing: 0.01em;
  color: var(--white); margin: 18px 0 0;
}
.auth-h1 .gold { color: var(--gold); }
.auth-lead {
  font-size: 15px; color: var(--muted); line-height: 1.6; font-weight: 300;
  margin-top: 14px;
}

/* ============================================================
   PROGRESSION (inscription)
   ============================================================ */
.auth-steps {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.auth-step-pill {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--border-soft); overflow: hidden; position: relative;
}
.auth-step-pill::after {
  content: ""; position: absolute; inset: 0; width: 0;
  background: var(--gold); transition: width 0.5s var(--ease);
}
.auth-step-pill.done::after,
.auth-step-pill.active::after { width: 100%; }
.auth-step-label {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-dim);
  white-space: nowrap;
}

/* ============================================================
   FORMULAIRE
   ============================================================ */
.auth-form { margin-top: 26px; display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.field-input-wrap { position: relative; display: flex; }
.field input {
  width: 100%;
  background: rgba(13,13,13,0.6); border: 1px solid var(--border);
  border-radius: 5px; color: var(--white);
  font-family: var(--font-body); font-size: 15.5px; font-weight: 300;
  padding: 15px 16px; outline: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field input::placeholder { color: var(--muted-dim); }
.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(207,110,34,0.12);
}
.field.has-toggle input { padding-right: 50px; }
.field.invalid input { border-color: var(--error); }
.field.invalid input:focus { box-shadow: 0 0 0 3px rgba(192,73,43,0.16); }

.field-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-dim); transition: color 0.2s var(--ease);
}
.field-toggle:hover { color: var(--gold); }

.field-error {
  font-size: 12.5px; color: var(--error); font-weight: 400;
  display: none; align-items: center; gap: 6px;
  letter-spacing: 0.01em;
}
.field.invalid .field-error { display: flex; }

/* Jauge de mot de passe */
.pw-meter { display: flex; gap: 5px; margin-top: 2px; }
.pw-meter span {
  flex: 1; height: 3px; border-radius: 2px; background: var(--border-soft);
  transition: background 0.3s var(--ease);
}
.pw-meter[data-level="1"] span:nth-child(1) { background: var(--error); }
.pw-meter[data-level="2"] span:nth-child(-n+2) { background: var(--ember); }
.pw-meter[data-level="3"] span:nth-child(-n+3) { background: var(--gold); }
.pw-meter[data-level="4"] span { background: var(--ok); }
.pw-hint { font-size: 11.5px; color: var(--muted-dim); margin-top: 4px; letter-spacing: 0.01em; }

/* Case à cocher */
.check-row {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 13px; color: var(--muted); line-height: 1.45; cursor: pointer;
  margin-top: 2px;
}
.check-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.check-box {
  width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px;
  border: 1px solid var(--border); border-radius: 4px;
  background: rgba(13,13,13,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.check-box svg { opacity: 0; transform: scale(0.5); transition: all 0.2s var(--ease); color: var(--noir); }
.check-row input:checked + .check-box { background: var(--gold); border-color: var(--gold); }
.check-row input:checked + .check-box svg { opacity: 1; transform: scale(1); }
.check-row input:focus-visible + .check-box { box-shadow: 0 0 0 3px rgba(207,110,34,0.2); }
.check-row a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--border); }
.check-row a:hover { color: var(--gold-bright); }
.check-row.invalid .check-box { border-color: var(--error); }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  font-family: var(--font-title); font-weight: 400; font-size: 20px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 16px 28px 13px; border: none; cursor: pointer;
  border-radius: 5px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.25s var(--ease);
}
.btn-primary {
  background: var(--gold); color: var(--noir);
  box-shadow: 0 10px 32px -12px rgba(207,110,34,0.65);
  width: 100%;
}
.btn-primary:hover { background: var(--gold-bright); transform: translateY(-2px); box-shadow: 0 16px 42px -12px rgba(207,110,34,0.72); }
.btn-primary:active { transform: translateY(0) scale(0.99); }
.btn-primary[disabled] { opacity: 0.55; cursor: progress; transform: none; box-shadow: none; }
.btn-arrow { transition: transform 0.25s var(--ease); }
.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-ghost {
  background: none; border: 1px solid var(--border); color: var(--white);
  width: 100%;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

.btn .spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(13,13,13,0.35); border-top-color: var(--noir);
  animation: spin 0.7s linear infinite; display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-text, .btn.loading .btn-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SÉPARATEUR + BAS DE CARTE
   ============================================================ */
.auth-rule {
  display: flex; align-items: center; gap: 16px;
  margin: 26px 0; color: var(--muted-dim);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
}
.auth-rule::before, .auth-rule::after {
  content: ""; flex: 1; height: 1px; background: var(--border-soft);
}

.auth-switch {
  text-align: center; font-size: 14px; color: var(--muted); margin-top: 24px;
}
.auth-switch a {
  color: var(--gold); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--border); padding-bottom: 1px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.auth-switch a:hover { color: var(--gold-bright); border-color: var(--gold); }

.auth-mini-link {
  font-size: 13px; color: var(--muted-dim); text-decoration: none;
  align-self: flex-end; transition: color 0.2s var(--ease);
}
.auth-mini-link:hover { color: var(--gold); }

/* ============================================================
   PIED DE PAGE
   ============================================================ */
.auth-foot {
  position: relative; z-index: 2;
  text-align: center; padding: 0 24px 28px;
  font-size: 11px; color: var(--muted-dim); letter-spacing: 0.04em;
}
.auth-foot .tagline {
  font-family: var(--font-title); letter-spacing: 0.16em; font-size: 13px;
  color: var(--gold); opacity: 0.75;
}

/* ============================================================
   PANNEAUX D'ÉTAPE (transitions)
   ============================================================ */
.step-panel { display: none; }
.step-panel.active { display: block; animation: fadeStep 0.5s var(--ease); }
@keyframes fadeStep { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   ÉTAPE TELEGRAM / SUCCÈS
   ============================================================ */
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px;
}
.success-icon.gold {
  background: rgba(207,110,34,0.1); border: 1px solid var(--gold); color: var(--gold);
}
.success-icon svg { width: 30px; height: 30px; }

.telegram-card {
  margin: 24px 0 8px;
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(207,110,34,0.05);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
}
.telegram-card .tg-ic {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--gold); color: var(--noir);
  display: flex; align-items: center; justify-content: center;
}
.telegram-card .tg-ic svg { width: 23px; height: 23px; }
.telegram-card .tg-name { font-family: var(--font-title); font-size: 20px; letter-spacing: 0.03em; color: var(--white); line-height: 1; }
.telegram-card .tg-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.telegram-card .tg-meta::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.recap-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: var(--muted); padding: 8px 0;
}
.recap-row svg { color: var(--gold); flex-shrink: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 540px) {
  .auth-top-link span.full { display: none; }
  .auth-watermark { display: none; }
}
