/* ==========================================================================
   BriqueBall · feuille de style unique
   Zéro dépendance, polices système (SF sur Apple), aucune animation en boucle.
   ========================================================================== */

:root {
  /* Couleurs inspirées NBA (aucun logo ni marque officielle) */
  --blue: #1D428A;
  --red: #C8102E;
  --accent: #5B8CFF;

  --bg: #000;
  --text: #F5F5F7;
  --text-2: rgba(245, 245, 247, .62);
  --text-3: rgba(245, 245, 247, .38);
  --hair: rgba(255, 255, 255, .1);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Inter, Roboto, Arial, sans-serif;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--font);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Scène : un seul éclairage, comme sous les projecteurs ---------- */

.stage {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(42% 34% at 50% 14%, rgba(255, 255, 255, .085), transparent 72%),
    radial-gradient(18% 22% at 41% 32%, rgba(29, 66, 138, .42), transparent 80%),
    radial-gradient(18% 22% at 59% 32%, rgba(200, 16, 46, .26), transparent 80%),
    var(--bg);
}
.stage::after { /* grain anti-banding */
  content: ""; position: absolute; inset: 0; opacity: .045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- En-tête ---------- */

.top { position: relative; z-index: 2; padding: max(26px, env(safe-area-inset-top)) 32px 0; }
.mark {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; color: var(--text);
}
.mark svg { color: var(--text); opacity: .9; }

/* ---------- Composition ---------- */

.auth__main {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 20px 32px;
}

/* ---------- Éventail de cartes joueurs ---------- */

.fan {
  --w: 168px;
  position: relative; width: calc(var(--w) * 2.6); height: calc(var(--w) * 1.48);
  margin-bottom: -60px; /* les cartes glissent sous le verre */
}
.pcard {
  position: absolute; left: 50%; top: 0;
  width: var(--w); aspect-ratio: 5 / 7; margin-left: calc(var(--w) / -2);
  padding: 13px 13px 12px;
  border-radius: 14px;
  display: flex; flex-direction: column;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 30px 60px -18px rgba(0, 0, 0, .9), 0 10px 20px -10px rgba(0, 0, 0, .6);
  overflow: hidden;
  transition: transform .6s var(--ease);
}
.pcard::before { /* liseré intérieur */
  content: ""; position: absolute; inset: 6px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18); pointer-events: none;
}
.pcard::after { /* reflet vernis */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 62%, rgba(255, 255, 255, .06) 100%);
}
.pcard--rare  { background: linear-gradient(160deg, #3467CF 0%, var(--blue) 42%, #0A1A3D 100%); transform: translate(-112px, 26px) rotate(-11deg); }
.pcard--epic  { background: linear-gradient(160deg, #E8445C 0%, var(--red) 42%, #3E0510 100%); transform: translate(112px, 26px) rotate(11deg); }
.pcard--legend {
  z-index: 1; color: #0B0C10;
  background: linear-gradient(160deg, #FFFFFF 0%, #EEF0F4 40%, #C6CBD6 100%);
  transform: translateY(-4px) scale(1.06);
}
.pcard--legend { --ink: rgba(10, 12, 16, .32); }
.pcard--legend::before { border-color: rgba(10, 12, 16, .14); }
.pcard--legend::after { /* touche irisée, très discrète */
  background:
    linear-gradient(125deg, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, 0) 35%),
    linear-gradient(115deg, transparent 45%, rgba(120, 170, 255, .16) 55%, rgba(255, 120, 150, .12) 62%, transparent 72%);
}
@media (hover: hover) {
  .fan:hover .pcard--rare { transform: translate(-128px, 20px) rotate(-14deg); }
  .fan:hover .pcard--epic { transform: translate(128px, 20px) rotate(14deg); }
  .fan:hover .pcard--legend { transform: translateY(-12px) scale(1.08); }
}

.pcard__head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.pcard__ovr { display: block; font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.pcard__pos { display: block; margin-top: 3px; font-size: 9.5px; font-weight: 600; letter-spacing: .14em; opacity: .7; }
.pcard__tier { margin-top: 2px; font-size: 8.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }

.pcard__art { position: relative; flex: 1; display: grid; place-items: center; }
.pcard__art::before { /* rond central du terrain */
  content: ""; position: absolute; width: 74%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid currentColor; opacity: .14;
}
.pcard__art span {
  font-size: 74px; line-height: 1; font-weight: 800; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1.2px var(--ink, rgba(255, 255, 255, .6));
}

.pcard__name { position: relative; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.pcard__stats {
  position: relative; margin: 7px 0 0; padding-top: 7px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid currentColor; border-top-color: color-mix(in srgb, currentColor 18%, transparent);
}
.pcard__stats div { display: grid; }
.pcard__stats dt { font-size: 8px; font-weight: 600; letter-spacing: .12em; opacity: .55; }
.pcard__stats dd { margin: 1px 0 0; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Panneau verre liquide ---------- */

.panel {
  position: relative; z-index: 2;
  width: 100%; max-width: 400px;
  padding: 44px 30px 26px;
  border-radius: 32px;
  background: rgba(28, 30, 36, .38);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
          backdrop-filter: blur(30px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .22),          /* arête haute éclairée */
    inset 1px 0 0 rgba(255, 255, 255, .06),
    inset -1px 0 0 rgba(255, 255, 255, .06),
    inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 0 0 .5px rgba(255, 255, 255, .08),
    0 40px 80px -24px rgba(0, 0, 0, .8);
}

.panel__title { margin: 0; text-align: center; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.panel__sub { margin: 6px 0 26px; text-align: center; color: var(--text-2); font-size: 14px; }
.panel__sub .num { color: var(--text); font-weight: 500; }
.panel__foot { margin: 22px 0 0; text-align: center; color: var(--text-2); font-size: 13.5px; }

.alert {
  margin: -10px 0 18px; padding: 10px 14px; border-radius: 12px;
  background: rgba(200, 16, 46, .14); color: #FFB4BF; font-size: 13.5px; text-align: center;
}

/* ---------- Formulaire ---------- */

.form { display: grid; gap: 18px; }

.group {
  border-radius: 14px; overflow: hidden;
  background: rgba(0, 0, 0, .32);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.fld { position: relative; display: block; }
.fld + .fld { border-top: 1px solid var(--hair); }
.fld input {
  display: block; width: 100%; height: 56px; padding: 20px 16px 4px;
  border: 0; background: transparent; outline: none;
  color: var(--text); font: inherit; font-size: 16px; /* 16px : pas de zoom iOS */
}
.fld:has(.fld__eye) input { padding-right: 52px; }
.fld span {
  position: absolute; left: 16px; top: 18px;
  color: var(--text-3); font-size: 16px; pointer-events: none;
  transform-origin: 0 0; transition: transform .25s var(--ease), color .25s;
}
.fld input:focus + span,
.fld input:not(:placeholder-shown) + span { transform: translateY(-10px) scale(.72); color: var(--text-2); }
.fld:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.fld:first-child:focus-within { border-radius: 14px 14px 0 0; }
.fld:last-child:focus-within { border-radius: 0 0 14px 14px; }
.fld input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 100px #15171c inset; }

.fld__eye {
  position: absolute; top: 50%; right: 8px; margin-top: -18px; width: 36px; height: 36px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: none; color: var(--text-3); cursor: pointer; transition: color .2s;
}
.fld__eye:hover, .fld__eye[aria-pressed="true"] { color: var(--text); }

.form__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }

.switch { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i {
  position: relative; flex: none; width: 36px; height: 22px; border-radius: 11px;
  background: rgba(120, 120, 128, .36); transition: background-color .25s var(--ease);
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  transition: transform .25s var(--ease);
}
.switch input:checked + i { background: var(--blue); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(91, 140, 255, .5); }

.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

.btn {
  height: 50px; border: 0; border-radius: 25px;
  background: #F5F5F7; color: #000;
  font: inherit; font-size: 16px; font-weight: 600; letter-spacing: -.01em;
  cursor: pointer; transition: background-color .2s, transform .2s var(--ease);
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 3px solid rgba(91, 140, 255, .6); outline-offset: 2px; }

/* ---------- Pied de page ---------- */

.legal {
  position: relative; z-index: 1;
  padding: 0 20px max(20px, env(safe-area-inset-bottom));
  text-align: center; font-size: 11.5px; color: var(--text-3);
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .top { padding: max(18px, env(safe-area-inset-top)) 0 0; text-align: center; }
  .auth__main { padding: 8px 16px 24px; }
  .fan { --w: 128px; margin-bottom: -46px; }
  .pcard { padding: 10px 10px 9px; border-radius: 11px; }
  .pcard::before { inset: 5px; border-radius: 8px; }
  .pcard--rare { transform: translate(-84px, 20px) rotate(-11deg); }
  .pcard--epic { transform: translate(84px, 20px) rotate(11deg); }
  .pcard__ovr { font-size: 23px; }
  .pcard__art span { font-size: 56px; }
  .pcard__name { font-size: 10.5px; }
  .pcard__stats { margin-top: 5px; padding-top: 5px; }
  .pcard__stats dt { font-size: 6.5px; }
  .pcard__stats dd { font-size: 10px; }
  .pcard__pos, .pcard__tier { font-size: 7.5px; }
  .panel { padding: 38px 20px 22px; border-radius: 28px; }
  .panel__title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel { background: rgba(22, 24, 30, .94); }
}
