/* Jetons repris à l'identique du site public (rules_UI « Système visuel Pronolulu ») : aucune couleur, rayon ni durée dans un composant. */

:root {
  --bg: #05070c;
  --bg2: #080b12;
  --panel: #0c111b;

  --lime: #ccff00;
  --emerald: #00e87a;
  --red: #ff5c86;
  --grad: linear-gradient(110deg, #ccff00, #00e87a);
  /* Encre posée sur le dégradé d'accent, identique dans les deux thèmes. */
  --on-grad: #04140a;
  --grad-soft: linear-gradient(110deg, rgba(204, 255, 0, .18), rgba(0, 232, 122, .14));

  /* Pastilles d'entité (aucun logo de tiers) : teintes à nous, attribuées par api-sportmonks (palette.ts), identiques dans les deux thèmes. */
  --marker-01: #5fcb83;
  --marker-02: #00ceb9;
  --marker-03: #00c8e7;
  --marker-04: #4fbbff;
  --marker-05: #92aaff;
  --marker-06: #c399fd;
  --marker-07: #e68dd9;
  --marker-08: #fb87a9;
  --marker-09: #ff8c75;
  --marker-10: #f19a42;
  --marker-11: #d2ad28;
  --marker-12: #a1bf4d;
  --marker-ink: #08130d;

  /* ball.png est un tracé sombre sur fond transparent : fond clair dans les deux thèmes. */
  --avatar-bg: #ffffff;
  /* Diamètre unique des avatars affichés (hors bulle d'édition du vestiaire). */
  --avatar-size: 44px;
  --avatar-size-lg: 50px;

  --ink: #f3f7fb;
  --muted: #9aa6bd;
  --faint: #7d88a0; /* AA : 4,5:1 minimum sur --bg, --bg2 et --panel */

  --glass: rgba(255, 255, 255, .045);
  --glass-brd: rgba(255, 255, 255, .16);
  --line: rgba(255, 255, 255, .12);
  --shadow: 0 30px 80px rgba(0, 0, 0, .5);
  --glow: 0 0 50px rgba(25, 240, 166, .28);
  --topbar-bg: rgba(6, 9, 15, .55);
  --halo: rgba(0, 232, 122, .15);
  /* Voile sombre dans les deux thèmes : un voile clair sur fond clair ne fait pas reculer le fond. */
  --scrim: rgba(2, 6, 12, .62);

  --scroll-thumb: rgba(255, 255, 255, .16);
  --scroll-thumb-hover: var(--emerald);

  --r: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --pill: 100px;

  --disp: "Space Grotesk", sans-serif;
  --body: "Inter", sans-serif;

  /* --fs-xs est le plancher absolu (micro-libellés) ; --fs-sm celui de tout texte lu pour lui-même. */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur: 220ms;

  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap: 18px;
  --gap-lg: 28px;
}

:root[data-theme="light"] {
  --bg: #eef3f0;
  --bg2: #f6faf7;
  --panel: #ffffff;
  --lime: #49c14f;
  --emerald: #2da635;
  --red: #e13a63;
  --grad: linear-gradient(110deg, #49c14f, #2da635);
  --grad-soft: linear-gradient(110deg, rgba(73, 193, 79, .16), rgba(45, 166, 53, .12));
  --ink: #08130d;
  --muted: #4a5a55;
  --faint: #5f7079; /* AA : 4,5:1 minimum sur --bg, --bg2 et --panel */
  --glass: rgba(255, 255, 255, .7);
  --glass-brd: rgba(10, 40, 30, .10);
  --line: rgba(10, 40, 30, .12);
  --shadow: 0 24px 60px rgba(20, 70, 50, .14);
  --glow: 0 0 44px rgba(8, 168, 119, .2);
  --topbar-bg: rgba(246, 250, 247, .7);
  --halo: rgba(45, 166, 53, .13);
  --scrim: rgba(8, 19, 13, .5);
  --scroll-thumb: rgba(10, 40, 30, .22);
}

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

html {
  min-height: 100svh;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--disp);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
}

a {
  color: inherit;
  text-decoration: none;
}
img, svg {
  max-width: 100%;
  display: block;
}

/* Une règle d'auteur (svg { display: block }) l'emporterait sur le [hidden] du navigateur. */
[hidden] {
  display: none !important;
}

ul {
  list-style: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

/* Sur * : scrollbar-color n'est pas hérité par les conteneurs qui défilent eux-mêmes. */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: var(--pill);
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background var(--dur) var(--ease);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
  background-clip: padding-box;
}

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

.auth-shell {
  /* height et non min-height : c'est la rangée centrale qui se contraint, pas l'enveloppe qui grandit. */
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Un débordement est coupé et se voit, plutôt que de faire défiler l'écran d'authentification. */
body.no-scroll {
  overflow: hidden;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: var(--gap) clamp(16px, 4vw, 32px);
  /* min-height: 0 et overflow: hidden transmettent la borne de hauteur à la carte. */
  min-height: 0;
  overflow: hidden;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  /* Rangée définie : sans elle, le max-height: 100% de la colonne et de la carte ne se résout pas. */
  grid-template-rows: minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  width: min(1240px, 100%);
  max-height: 100%;
  min-height: 0;
}

.auth-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--gap-sm);
  min-height: 0;
  max-height: 100%;
  width: min(440px, 100%);
}

/* Inscription : la colonne du formulaire s'élargit (data-auth-panel posé sur body par CP_AuthCard). */
@media (min-width: 1024px) {
  body[data-auth-panel="panel-register"] .auth-layout {
    grid-template-columns: .68fr 1.32fr;
  }

  body[data-auth-panel="panel-register"] .auth-column {
    width: min(760px, 100%);
  }

  body[data-auth-panel="panel-register"] .auth-main {
    padding-block: var(--gap-xs);
  }
}

@media (max-width: 1023px) {
  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 460px;
    gap: clamp(14px, 3svh, 24px);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 720px) {
  .auth-main { padding-block: 12px; }
  .auth-layout { gap: 12px; }
  .auth-column { gap: 10px; }
}

.brand {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: baseline;
}

.brand b {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: .98rem;
  padding: 14px 26px;
  border-radius: var(--pill);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  border: 1px solid transparent;
  background: none;
}

.btn-primary {
  background: var(--grad);
  color: #04140a;
  box-shadow: var(--glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 70px rgba(25, 240, 166, .5);
}

.btn-ghost {
  border-color: var(--glass-brd);
  color: var(--ink);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--emerald);
  color: var(--emerald);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn--full {
  width: 100%;
}

.btn__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.field {
  display: grid;
  gap: 6px;
}

/* minmax(0, 1fr) : une piste auto s'élargirait au libellé le plus long et ferait déborder la carte. */
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gap-sm);
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.field__label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--glass-brd);
  border-radius: var(--r);
  background: var(--glass);
  color: var(--ink);
  transition: border-color var(--dur) var(--ease);
}

.input::placeholder {
  color: var(--faint);
}

/* Chevron redessiné : celui du système ne suit pas le thème. */
.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa6bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  cursor: pointer;
}

.select:invalid {
  color: var(--faint);
}

/* Le menu natif n'hérite pas des variables de thème. */
.select option {
  background: var(--panel);
  color: var(--ink);
}

.input:focus {
  outline: none;
  border-color: var(--emerald);
}

.input--with-toggle {
  padding-right: 48px;
}

.input-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

.input-toggle:hover {
  color: var(--ink);
}

.field__hint {
  font-size: .76rem;
  color: var(--faint);
}

.field__hint--error { color: var(--red); }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .84rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
}

.checkbox input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.checkbox a {
  color: var(--emerald);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-alert {
  padding: 10px 14px;
  border-radius: var(--r);
  border: 1px solid var(--glass-brd);
  font-size: .86rem;
  background: var(--glass);
}

.alert--error {
  border-color: var(--red);
  color: var(--red);
}

.alert--success {
  border-color: var(--emerald);
  color: var(--emerald);
}

.alert--info {
  color: var(--muted);
}

.pwd-strength {
  display: grid;
  gap: 5px;
}

.pwd-strength__bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.pwd-strength__bar {
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  transition: background var(--dur) var(--ease);
}

.pwd-strength__bar.is-on {
  background: var(--grad);
}

.pwd-strength__label {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--grad);
  color: #04140a;
  padding: 10px 16px;
  border-radius: var(--r);
  font-weight: 700;
  font-size: .85rem;
}

.skip-link:focus {
  left: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
