:root {
  --bg: #07111f;
  --card: rgba(13, 27, 47, .82);
  --card-strong: rgba(16, 33, 57, .94);
  --field: rgba(8, 21, 37, .86);
  --field-hover: rgba(11, 29, 51, .94);
  --line: rgba(98, 130, 170, .28);
  --line-strong: rgba(116, 170, 220, .44);
  --text: #eef6ff;
  --muted: #8ea6c4;
  --blue: #2dd4ff;
  --purple: #7c5cff;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --glow: 0 0 0 4px rgba(45, 212, 255, .13), 0 18px 45px rgba(45, 212, 255, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(30, 72, 126, .95), transparent 34rem),
    radial-gradient(circle at 86% 10%, rgba(124, 92, 255, .22), transparent 30rem),
    linear-gradient(180deg, rgba(7, 17, 31, 0) 0%, var(--bg) 42rem);
  background-repeat: no-repeat;
  background-size: 100% 100vh, 100% 100vh, 100% 100vh;
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
.icon { margin-right: .4rem; }
button .icon, .button .icon { margin-right: .35rem; }
label {
  color: var(--muted);
  font-weight: 700;
}
input, textarea, select, button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .95rem 1rem;
  background: var(--field);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 10px 30px rgba(0, 0, 0, .12);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}
input:hover, textarea:hover, select:hover {
  background: var(--field-hover);
  border-color: var(--line-strong);
}
input:focus, textarea:focus, select:focus {
  outline: 0;
  background: rgba(10, 27, 48, .98);
  border-color: var(--blue);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .06);
}
input::placeholder, textarea::placeholder { color: rgba(142, 166, 196, .62); }
button, .button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 48px;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: -.01em;
  background: linear-gradient(180deg, rgba(18, 43, 72, .98), rgba(9, 24, 42, .98));
}
button:hover, .button:hover {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(23, 54, 90, .98), rgba(12, 31, 55, .98));
  transform: translateY(-1px);
}
button:active, .button:active { transform: translateY(0); }
button:focus-visible, .button:focus-visible {
  outline: 0;
  box-shadow: var(--glow);
}
.primary {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border: 0;
  color: #03111f;
  box-shadow: 0 16px 40px rgba(45, 212, 255, .2), inset 0 1px 0 rgba(255, 255, 255, .36);
}
.primary:hover {
  background: linear-gradient(135deg, #5de2ff, #9178ff);
  box-shadow: 0 20px 52px rgba(45, 212, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .42);
}
.container { width: min(1120px, calc(100% - 2rem)); margin: 1rem auto 4rem; }
.top-nav {
  position: sticky; top: 0; z-index: 5;
  isolation: isolate;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .85rem max(1rem, calc((100vw - 1120px) / 2));
  background:
    linear-gradient(180deg, rgba(11, 26, 45, .88), rgba(7, 17, 31, .7));
  backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid rgba(116, 170, 220, .2);
  box-shadow: 0 16px 45px rgba(0, 0, 0, .18);
}
.top-nav::before {
  content: "";
  position: absolute;
  inset: .55rem max(.65rem, calc((100vw - 1138px) / 2));
  z-index: -1;
  border: 1px solid rgba(116, 170, 220, .16);
  border-radius: 999px;
  background: rgba(7, 17, 31, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  min-height: 42px;
  padding: .72rem 1rem;
  border: 1px solid rgba(45, 212, 255, .28);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(45, 212, 255, .16), rgba(124, 92, 255, .12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 32px rgba(45, 212, 255, .08);
  font-weight: 950;
  color: var(--blue);
  letter-spacing: -.03em;
}
.brand .icon, .brand i { filter: drop-shadow(0 0 10px rgba(45, 212, 255, .45)); }
.nav-links {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  padding: .3rem;
  border: 1px solid rgba(116, 170, 220, .16);
  border-radius: 999px;
  background: rgba(13, 27, 47, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 14px 36px rgba(0, 0, 0, .14);
}
.nav-links form { margin: 0; display: flex; }
.nav-links a, .nav-links button {
  width: auto;
  min-height: 40px;
  border-radius: 999px;
  padding: .68rem .88rem;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(238, 246, 255, .86);
  font-size: .93rem;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links button:hover {
  color: var(--text);
  border-color: rgba(116, 170, 220, .22);
  background: linear-gradient(135deg, rgba(45, 212, 255, .14), rgba(124, 92, 255, .12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 24px rgba(45, 212, 255, .08);
}
.nav-links form button {
  color: rgba(255, 214, 220, .9);
}
.nav-links form button:hover {
  border-color: rgba(251, 113, 133, .26);
  background: linear-gradient(135deg, rgba(251, 113, 133, .14), rgba(124, 92, 255, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 24px rgba(251, 113, 133, .08);
}
.card, .auth-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0)),
    var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.45rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.12);
  margin-bottom: 1rem;
}
.card::before, .auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.auth-card { max-width: 430px; margin: 8vh auto; }
.hero, .section-title, .split, .stats { display: grid; gap: 1rem; }
.hero { grid-template-columns: 1fr auto; align-items: end; margin: 1.5rem 0; }
.split { grid-template-columns: minmax(0, 1fr) minmax(300px, .45fr); }
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
.stats article {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(15, 35, 61, .92), rgba(9, 24, 42, .92));
  box-shadow: 0 16px 44px rgba(0, 0, 0, .18);
}
.stats strong { display: block; font-size: 2.2rem; color: var(--blue); }
.stack, .grid-form { display: grid; gap: .9rem; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.muted, .eyebrow { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 900; }
.list-row, .session-card {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  padding: 1rem; border: 1px solid var(--line); border-radius: 20px; margin: .5rem 0;
  background: linear-gradient(180deg, rgba(11, 29, 51, .9), rgba(7, 21, 38, .9));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.list-row:hover, .session-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .2);
  transform: translateY(-1px);
}
.session-card { display: grid; border-left: 5px solid var(--blue); }
.easy { border-left-color: var(--green); }
.medium { border-left-color: var(--amber); }
.hard, .critical, .danger { border-left-color: var(--red); }
.pill {
  display: inline-block;
  width: auto;
  padding: .42rem .75rem;
  border-radius: 999px;
  background: rgba(16, 36, 60, .92);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.alert {
  border-left: 5px solid var(--amber);
  padding: 1rem;
  border-radius: 18px;
  background: rgba(10, 24, 40, .86);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
  margin: .75rem 0;
}
.inline-form { display: grid; grid-template-columns: 1fr 160px; gap: .6rem; }
.builder-toolbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.builder-block {
  display: grid;
  gap: .7rem;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  padding: 1rem;
  margin: .8rem 0;
  background: rgba(8, 21, 37, .52);
}
.workout-block.queued { opacity: .7; }
.memory { color: var(--green); }
.wall { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 2rem 0; }
.wall span { height: 34px; background: linear-gradient(135deg, #1d4ed8, var(--blue)); border-radius: 6px; }
.is-offline body::before { content: "Mode hors-ligne"; position: fixed; bottom: 1rem; right: 1rem; background: var(--amber); color: #111; padding: .5rem .8rem; border-radius: 999px; z-index: 10; }
.wizard { display: grid; gap: 1.2rem; min-height: min(680px, calc(100vh - 10rem)); }
.wizard-progress { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(8, 21, 37, .9); border: 1px solid var(--line); }
.wizard-progress span { display: block; width: 0; height: 100%; background: linear-gradient(135deg, var(--blue), var(--purple)); transition: width .25s ease; box-shadow: 0 0 18px rgba(45, 212, 255, .5); }
.wizard-step { display: none; align-content: center; gap: 1.2rem; min-height: 430px; }
.wizard-step.is-active { display: grid; }
.wizard-step h2 { margin: 0; max-width: 760px; font-size: clamp(2.1rem, 7vw, 4.8rem); line-height: .95; letter-spacing: -.04em; }
.wizard-step label { display: grid; gap: .55rem; font-size: 1rem; color: var(--muted); }
.wizard-step input, .wizard-step textarea, .wizard-step select {
  min-height: 58px;
  font-size: clamp(1.05rem, 4vw, 1.45rem);
}
.wizard-step textarea { min-height: 140px; resize: vertical; }
.wizard-actions { display: grid; grid-template-columns: minmax(0, .35fr) minmax(0, .65fr); gap: .75rem; margin-top: auto; }
.wizard-actions.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.choice-grid label { cursor: pointer; }
.choice-grid input { position: absolute; opacity: 0; pointer-events: none; }
.choice-grid span {
  display: grid; min-height: 120px; place-items: center; text-align: center;
  border: 1px solid var(--line); border-radius: 24px; background: var(--field);
  font-size: clamp(1rem, 4vw, 1.35rem); font-weight: 800;
  transition: border-color .2s ease, box-shadow .2s ease, color .2s ease, transform .2s ease;
}
.choice-grid span:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.choice-grid input:checked + span { border-color: var(--blue); box-shadow: var(--glow); color: var(--blue); }
.avatar-capture { display: grid; place-items: center; }
.avatar-capture img, .avatar-capture video {
  width: min(64vw, 260px); aspect-ratio: 1; object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--blue);
  background: var(--field);
  box-shadow: 0 0 0 8px rgba(45, 212, 255, .08), 0 24px 60px rgba(0, 0, 0, .28);
}
.avatar-capture img[src=""] { display: none; }

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

@media (max-width: 760px) {
  .hero, .split, .stats, .grid-form, .builder-toolbar, .inline-form { grid-template-columns: 1fr; }
  .top-nav {
    align-items: stretch;
    flex-direction: column;
    padding: .75rem;
  }
  .top-nav::before {
    inset: .45rem;
    border-radius: 26px;
  }
  .brand {
    justify-content: center;
    width: 100%;
  }
  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 24px;
  }
  .nav-links a, .nav-links button {
    justify-content: center;
    width: 100%;
  }
  .nav-links form { width: 100%; }
  .container { width: min(100% - 1rem, 1120px); }
  .card { border-radius: 18px; padding: 1rem; }
  .wizard { min-height: calc(100vh - 8rem); }
  .wizard-step { min-height: 58vh; }
  .wizard-actions, .wizard-actions.compact, .choice-grid { grid-template-columns: 1fr; }
  .choice-grid span { min-height: 86px; }
}
