.pilule-portail[aria-current="page"] {
  border-color: rgba(var(--accent-texte-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.12);
}

.compte {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: min(var(--haut), 980px);
  padding: calc(env(safe-area-inset-top, 0px) + var(--barre-h) + clamp(40px, 8vw, 104px)) var(--marge) clamp(72px, 10vw, 136px);
}
.compte::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: -30%;
  width: min(1000px, 160vw);
  aspect-ratio: 1.5;
  translate: -50% 0;
  background: radial-gradient(closest-side, rgba(var(--bouton-b-rgb), 0.22), rgba(var(--bleu-rgb), 0.07) 55%, rgba(var(--fond-rgb), 0) 100%);
  pointer-events: none;
}
.compte::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(var(--filet) 1px, transparent 1px), linear-gradient(90deg, var(--filet) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 60% 62% at 50% 8%, var(--noir) 18%, transparent 74%);
  mask-image: radial-gradient(ellipse 60% 62% at 50% 8%, var(--noir) 18%, transparent 74%);
  pointer-events: none;
}

.compte-etat { width: min(100%, 440px); }
.compte-etat.large { width: min(100%, 760px); }

.compte-carte {
  position: relative;
  padding: clamp(28px, 6vw, 44px) clamp(20px, 6vw, 44px) clamp(28px, 5vw, 40px);
  border: 1px solid var(--filet-fort);
  border-radius: var(--rayon-l);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1) 78%);
  box-shadow: 0 0 0 1px rgba(var(--noir-rgb), 0.6), 0 40px 80px -30px rgba(var(--noir-rgb), 0.9), 0 0 140px -50px var(--lueur-violette);
}
.compte-carte::before {
  content: "";
  position: absolute;
  inset: 0 12% auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(var(--blanc-rgb), 0), rgba(var(--blanc-rgb), 0.38), rgba(var(--blanc-rgb), 0));
  pointer-events: none;
}

.compte-tete {
  display: grid;
  justify-items: center;
  gap: var(--e-3);
  text-align: center;
}
.compte-p {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--e-3);
  border: 1px solid var(--filet-fort);
  border-radius: 15px;
  background:
    radial-gradient(90% 70% at 50% 115%, rgba(var(--accent-rgb), 0.38), rgba(var(--accent-rgb), 0) 70%),
    linear-gradient(180deg, var(--surface-3), var(--surface-2));
  box-shadow: inset 0 1px 0 rgba(var(--blanc-rgb), 0.08), 0 14px 34px -14px rgba(var(--bouton-b-rgb), 0.7);
}
.compte-p .marque-p { width: 26px; height: 26px; }
.compte h1 {
  font-size: clamp(1.625rem, 1.35rem + 1vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.022em;
}
.compte-intro {
  max-width: 30em;
  color: var(--second);
  font-size: 1rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.compte .formulaire {
  gap: 18px;
  margin-top: var(--e-6);
}
.compte .champ > label { color: var(--texte); }
.compte .bouton.plein { margin-top: var(--e-2); }
.compte .statut { line-height: 1.5; }

.compte-lien {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--second);
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: rgba(var(--second-rgb), 0.45);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.compte-oubli {
  display: flex;
  justify-content: center;
  margin-top: var(--e-3);
}
.compte-note {
  max-width: 30em;
  margin: var(--e-6) auto 0;
  color: var(--second);
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  text-wrap: pretty;
}
.compte-note a {
  padding-block: 13px;
  color: var(--accent-texte);
  text-decoration-color: rgba(var(--accent-texte-rgb), 0.45);
  white-space: nowrap;
}
.compte-sortie {
  display: flex;
  justify-content: center;
  margin-top: var(--e-3);
}

.grille-espaces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--e-3);
  margin-top: clamp(32px, 5vw, 48px);
}
.espace {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 1.25rem;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: var(--e-4);
  row-gap: 2px;
  min-height: 88px;
  padding: 18px 20px;
  border: 1px solid var(--filet-fort);
  border-radius: var(--rayon);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  color: var(--texte);
  text-decoration: none;
  transition: border-color 0.25s ease, transform 0.3s var(--doux), box-shadow 0.3s ease;
}
.espace::after {
  content: "\2192";
  content: "\2192" / "";
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  color: var(--second);
  transition: transform 0.25s var(--doux), color 0.2s ease;
}
.espace-marque {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--filet-fort);
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--accent-texte);
}
.espace-marque svg { width: 22px; height: 22px; }
.espace-nom {
  grid-column: 2;
  align-self: end;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.espace-detail {
  grid-column: 2;
  align-self: start;
  min-width: 0;
  color: var(--second);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.espace-detail:empty { display: none; }
.espace:has(.espace-detail:empty) .espace-nom { grid-row: 1 / span 2; align-self: center; }
.grille-espaces > p {
  grid-column: 1 / -1;
  max-width: none;
  padding: var(--e-6) var(--e-5);
  border: 1px dashed var(--filet-vif);
  border-radius: var(--rayon);
  color: var(--second);
  text-align: center;
}

.fil {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 10px;
  margin-bottom: var(--e-4);
  font-family: var(--mono);
  font-size: var(--t-etiquette);
  line-height: 1.4;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--second);
}
.fil::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 1px;
  background: var(--second);
}
.fil a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--second);
  text-decoration: underline;
  text-decoration-color: rgba(var(--second-rgb), 0.4);
  transition: color 0.2s ease;
}
.fil [aria-current="page"] { color: var(--texte); }
.legal-date { margin-top: var(--e-6); }
.legal-date time { color: var(--texte); }

.legal {
  display: grid;
  gap: var(--e-7);
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--filet);
}
.legal-sommaire ol {
  margin: var(--e-3) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--filet);
}
.legal-sommaire li { border-bottom: 1px solid var(--filet); }
.legal-sommaire a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
  min-height: 48px;
  padding-block: 12px;
  color: var(--second);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease;
}
.legal-no {
  font-family: var(--mono);
  font-size: var(--t-etiquette);
  letter-spacing: 0.04em;
  color: var(--second);
}

.legal-texte { counter-reset: legal; }
.legal-texte > section > * + * { margin-top: 1em; }
.legal-texte > section + section {
  margin-top: clamp(40px, 5vw, 56px);
  padding-top: clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--filet);
}
.legal-texte h2 {
  margin-top: 0;
  counter-increment: legal;
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem);
  line-height: 1.15;
}
.legal-texte h2::before {
  content: counter(legal, decimal-leading-zero);
  content: counter(legal, decimal-leading-zero) / "";
  display: block;
  margin-bottom: var(--e-4);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--second);
}
.legal-texte p {
  color: var(--texte);
  line-height: 1.7;
}
.legal-texte a {
  color: var(--accent-texte);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-texte-rgb), 0.45);
  overflow-wrap: anywhere;
}

@media (min-width: 1000px) {
  .legal {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--goutiere);
  }
  .legal-sommaire {
    grid-column: 1 / span 3;
    align-self: start;
    position: sticky;
    top: var(--colle);
  }
  .legal-texte { grid-column: 5 / span 8; }
}

@media (hover: hover) and (pointer: fine) {
  .compte-lien:hover { color: var(--texte); text-decoration-color: currentColor; }
  .compte-note a:hover,
  .legal-texte a:hover { text-decoration-color: currentColor; }
  .espace:hover {
    border-color: var(--filet-vif);
    transform: translateY(-1px);
    box-shadow: 0 24px 60px -30px rgba(var(--noir-rgb), 0.9), 0 0 60px -30px var(--lueur-violette);
  }
  .espace:hover::after { transform: translateX(3px); color: var(--accent-texte); }
  .fil a:hover { color: var(--texte); }
  .legal-sommaire a:hover { color: var(--texte); }
}

@media (pointer: coarse) {
  .compte-carte { box-shadow: 0 0 0 1px rgba(var(--noir-rgb), 0.6), 0 30px 60px -30px rgba(var(--noir-rgb), 0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .espace,
  .espace::after,
  .compte-lien { transition: none; }
  .espace:hover { transform: none; }
}
