/* ─────────────────────────────────────────────────────────────────────────────
   MyStockx — page de connexion (11/09/2026)
   Page autonome : ne dépend pas de style.css. Mêmes couleurs que le tableau
   de bord (fond #0a0c0f, accent menthe #22d3a0) pour rester dans la famille.
   ───────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0c0f;
  --bg2: #111318;
  --bg3: #181c23;
  --text: #e8eaf0;
  --muted: #7a8394;
  --muted2: #a4acbb;
  --accent: #22d3a0;
  --accent2: #1ab88a;
  --accent-soft: rgba(34, 211, 160, 0.14);
  --blue: #4f8cff;
  --red: #f26060;
  --border: rgba(255, 255, 255, 0.08);
  --border2: rgba(255, 255, 255, 0.16);
  --shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { height: 100%; }
body {
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ── Décor de fond ─────────────────────────────────────────────────────────── */
.scene {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(34, 211, 160, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(79, 140, 255, 0.10), transparent 60%),
    var(--bg);
}
/* Grille fine, estompée vers les bords */
.scene::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%);
}
/* Halos flottants */
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.55;
  animation: drift 22s var(--ease) infinite alternate;
}
.orb-a { width: 520px; height: 520px; left: -140px; top: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(34, 211, 160, 0.55), rgba(34, 211, 160, 0) 70%); }
.orb-b { width: 460px; height: 460px; right: -160px; bottom: -180px;
  background: radial-gradient(circle at 60% 60%, rgba(79, 140, 255, 0.45), rgba(79, 140, 255, 0) 70%);
  animation-duration: 28s; animation-delay: -9s; }
.orb-c { width: 260px; height: 260px; left: 55%; top: 60%;
  background: radial-gradient(circle, rgba(34, 211, 160, 0.25), rgba(34, 211, 160, 0) 70%);
  animation-duration: 18s; animation-delay: -4s; opacity: 0.4; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 40px, 0) scale(1.08); }
}

/* Courbe décorative : se dessine à l'ouverture */
.chart {
  position: absolute; left: 0; right: 0; bottom: 0;
  width: 100%; height: 42vh; min-height: 220px;
  opacity: 0.9; pointer-events: none;
}
.chart .fill  { fill: url(#chartFill); opacity: 0; animation: fadeIn 1.2s 1.1s var(--ease) forwards; }
.chart .line  { fill: none; stroke: url(#chartStroke); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: draw 2.4s 0.2s var(--ease) forwards; }
.chart .dot   { fill: var(--accent); opacity: 0; animation: fadeIn 0.6s 2.4s forwards; }
.chart .pulse { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0;
  animation: pulse 2.6s 2.6s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes draw   { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes pulse  { 0% { opacity: 0.8; transform: scale(0.4); } 100% { opacity: 0; transform: scale(3.2); } }

/* ── Mise en page ──────────────────────────────────────────────────────────── */
.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #34e2b1 0%, #22d3a0 38%, #3fb3d8 68%, #4f8cff 100%);
  color: #04120d;
  box-shadow: 0 8px 24px -6px rgba(34, 211, 160, 0.55);
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted2);
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 420px);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 48px) 64px;
}

/* Colonne de gauche : titre */
.intro { max-width: 560px; animation: rise 0.9s 0.1s var(--ease) both; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--accent); opacity: 0.7; }
.intro h1 {
  margin-top: 18px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.02; letter-spacing: -0.035em; font-weight: 750;
}
.intro h1 span {
  background: linear-gradient(90deg, var(--accent) 0%, #7ff0cf 50%, var(--blue) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro p { margin-top: 20px; font-size: 16px; line-height: 1.6; color: var(--muted2); max-width: 44ch; }
.facts { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.fact strong { display: block; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fact span { font-size: 12px; color: var(--muted); }

/* ── Carte ─────────────────────────────────────────────────────────────────── */
.auth-card {
  position: relative;
  padding: 34px 32px 28px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 23, 30, 0.82), rgba(14, 16, 21, 0.9));
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: rise 0.9s 0.25s var(--ease) both;
}
/* Liseré lumineux en haut de la carte */
.auth-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(34, 211, 160, 0.55), rgba(255, 255, 255, 0.06) 35%, rgba(79, 140, 255, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.auth-tabs { display: none; } /* conservé pour main.js (#tab-login) */

.card-head h2 { font-size: 22px; letter-spacing: -0.02em; font-weight: 700; }
.card-head p  { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

.form-group { margin-top: 18px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted2); margin-bottom: 8px; }
.field { position: relative; }
.field input {
  width: 100%; height: 48px;
  padding: 0 14px;
  font: inherit; font-size: 15px; color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border2);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder { color: #55607a; }
.field input:focus {
  border-color: rgba(34, 211, 160, 0.7);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: rgba(255, 255, 255, 0.045);
}
.field input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px #151920 inset; }
.field.has-toggle input { padding-right: 46px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.eye:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.eye .off { display: none; }
.eye[aria-pressed="true"] .on  { display: none; }
.eye[aria-pressed="true"] .off { display: block; }

.row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.forgot a, .back a { font-size: 12.5px; color: var(--muted); text-decoration: none; transition: color 0.15s; }
.forgot a:hover, .back a:hover { color: var(--accent); }

.submit-btn {
  width: 100%; height: 50px; margin-top: 22px;
  font: inherit; font-size: 15px; font-weight: 650; letter-spacing: 0.005em;
  color: #04120d;
  background: linear-gradient(135deg, #34e2b1 0%, var(--accent) 45%, var(--accent2) 100%);
  border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(34, 211, 160, 0.6);
  transition: transform 0.18s var(--ease), box-shadow 0.18s, filter 0.18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.submit-btn:hover  { transform: translateY(-1px); box-shadow: 0 16px 34px -10px rgba(34, 211, 160, 0.75); filter: saturate(1.08); }
.submit-btn:active { transform: translateY(0); filter: brightness(0.96); }
.submit-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.submit-btn .arrow { transition: transform 0.18s var(--ease); }
.submit-btn:hover .arrow { transform: translateX(3px); }
.submit-btn.loading { pointer-events: none; filter: saturate(0.7) brightness(0.9); }
.submit-btn.loading .arrow { display: none; }
.submit-btn.loading::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(4, 18, 13, 0.35); border-top-color: #04120d;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.forgot-intro { font-size: 13.5px; line-height: 1.55; color: var(--muted2); margin-top: 4px; }
.back { margin-top: 14px; text-align: center; }

/* Message d'erreur / de succès (rempli par main.js) */
#auth-error { min-height: 0; margin-top: 14px; font-size: 13px; text-align: center; line-height: 1.4; }
#auth-error:not(:empty) { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); }

.secure-note {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px; color: var(--muted);
}

.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px clamp(20px, 4vw, 48px);
  font-size: 12px; color: var(--muted);
}

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ── Réactif ───────────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .stage { grid-template-columns: 1fr; gap: 28px; padding-bottom: 40px; }
  .intro { max-width: none; text-align: center; margin: 0 auto; }
  .eyebrow::before { display: none; }
  .intro p { margin-left: auto; margin-right: auto; }
  .facts { justify-content: center; gap: 22px; margin-top: 26px; }
  .auth-card { width: min(100%, 440px); margin: 0 auto; }
  .chart { height: 30vh; opacity: 0.6; }
  .pill { display: none; }
}
@media (max-width: 480px) {
  .topbar { padding: 18px 20px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 18px; }
  .intro h1 { font-size: 30px; }
  .intro p, .facts { display: none; }
  .foot { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .chart .line, .chart .fill, .chart .dot, .chart .pulse, .intro, .auth-card { animation: none !important; }
  .chart .line { stroke-dashoffset: 0; }
  .chart .fill, .chart .dot { opacity: 1; }
  .chart .pulse { display: none; }
}
