/* =========================================================
   CourtCoach – Tennis Club Houdan
   Thème « terre battue » : orange brique, bleu nuit, jaune balle.
   ========================================================= */

:root {
  color-scheme: light;

  /* Couleurs */
  --clay: #b8471f;        /* terre battue (texte blanc lisible dessus) */
  --clay-dark: #93371a;
  --ink: #10203a;         /* bleu nuit */
  --ink-soft: #1c3155;
  --ball: #dcf247;        /* jaune balle */
  --ball-dark: #c9e02f;
  --chalk: #fbf7f1;       /* fond clair */
  --sand: #f3e7d9;        /* fond sable */
  --text: #1a2233;
  --muted: #4b5566;
  --line: #e4d6c5;

  /* Typographie */
  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Espacements (rythme de 8 px) */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s6: 48px;
  --s8: 64px;
  --s12: 96px;

  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--chalk);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;       /* 17 px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.05;
  margin: 0 0 var(--s2);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-weight: 800;
  font-stretch: 85%;
  letter-spacing: -0.01em;
  max-width: 22ch;
}

h3 { font-size: 1.3rem; font-weight: 750; }

p { margin: 0 0 var(--s2); }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--s2);
}

@media (min-width: 720px) {
  .wrap { padding-inline: var(--s4); }
}

.skip-link {
  position: absolute;
  left: var(--s2);
  top: -100px;
  z-index: 100;
  padding: var(--s1) var(--s2);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}
.skip-link:focus { top: var(--s1); }

.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: var(--s2);
}
.eyebrow--clay { color: var(--clay); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  min-height: 52px;
  padding: 0 var(--s3);
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: scale(.97); }

.btn--small { min-height: 44px; padding: 0 var(--s2); font-size: .95rem; }
.btn--block { width: 100%; }

.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--ink-soft); }

.btn--ball { background: var(--ball); color: var(--ink); box-shadow: 0 6px 0 var(--ink); }
.btn--ball:hover { background: var(--ball-dark); }
.btn--ball:active { box-shadow: 0 2px 0 var(--ink); transform: translateY(4px); }

.btn--clay { background: var(--clay); color: #fff; }
.btn--clay:hover { background: var(--clay-dark); }

.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn--ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 241, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
  min-height: 44px;
}
.brand__ball { width: 30px; height: 30px; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 80%;
  font-size: 1.45rem;
  letter-spacing: -.01em;
  color: var(--clay);
}
.brand__name span { color: var(--clay); }

.topbar__nav { display: none; gap: var(--s3); }
.topbar__nav a {
  text-decoration: none;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 0;
}
.topbar__nav a:hover { color: var(--ink); }

@media (min-width: 860px) {
  .topbar__nav { display: flex; margin-right: var(--s3); }
}

/* ---------- Bandeau principal (hero) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 100%, #9c3b18 0%, transparent 65%),
    var(--clay);
  color: #fff;
  padding-block: var(--s8) var(--s12);
}

.hero__court {
  position: absolute;
  inset: -10% -30% auto auto;
  width: 90%;
  height: 130%;
  color: rgba(255, 255, 255, .16);
  transform: rotate(-18deg);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  gap: var(--s8);
  align-items: center;
}

.hero .eyebrow { color: #fff; }
.hero .eyebrow::before {
  content: "";
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-right: .5em;
  background: var(--ball);
  border-radius: 50%;
  vertical-align: -.05em;
}

.hero h1 {
  font-size: clamp(2.6rem, 11vw, 5.4rem);
  font-weight: 900;
  font-stretch: 78%;
  letter-spacing: -.02em;
  line-height: .95;
  margin-bottom: var(--s3);
}
.hero h1 em {
  font-style: normal;
  color: var(--ink);
  background: var(--ball);
  padding: 0 .12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hero__lead {
  font-size: 1.15rem;
  max-width: 34rem;
  margin-bottom: var(--s4);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

@media (max-width: 479px) {
  .hero__actions .btn { width: 100%; }
}

@media (min-width: 900px) {
  .hero { padding-block: var(--s12); }
  .hero__grid { grid-template-columns: 1.25fr 1fr; }
  .hero__court { inset: -20% -10% auto auto; width: 60%; }
}

/* Aperçu fictif du téléphone */
.phone {
  justify-self: center;
  width: min(300px, 100%);
  padding: 12px;
  background: var(--ink);
  border-radius: 40px;
  box-shadow: 0 30px 60px -20px rgba(16, 32, 58, .6), 0 0 0 2px rgba(255,255,255,.08) inset;
  transform: rotate(3deg);
}

.phone__screen {
  background: var(--chalk);
  color: var(--text);
  border-radius: 30px;
  padding: var(--s3) var(--s2) var(--s2);
  font-size: .9rem;
  line-height: 1.35;
}

.phone__hello {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: var(--s2);
}

.phone__label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--s2) 0 var(--s1);
}

.phone__card {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.phone__card strong { display: block; font-size: .98rem; }
.phone__card small { color: var(--muted); }

.phone__card--clay,
.phone__card--ink {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 0;
}
.phone__card--clay { background: var(--clay); color: #fff; }
.phone__card--ink { background: var(--ink); color: #fff; }
.phone__card--clay small,
.phone__card--ink small { color: rgba(255,255,255,.85); }

.phone__day {
  display: grid;
  place-items: center;
  width: 48px;
  height: 52px;
  background: #fff;
  color: var(--clay);
  border-radius: 10px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.1;
}
.phone__day b { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); }

.phone__meter {
  height: 8px;
  background: var(--sand);
  border-radius: 99px;
  overflow: hidden;
}
.phone__meter span {
  display: block;
  width: var(--val);
  height: 100%;
  background: linear-gradient(90deg, var(--clay), #e0773f);
  border-radius: inherit;
}

.phone__play {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--ball);
  border-radius: 50%;
}
.phone__play::after {
  content: "";
  margin-left: 4px;
  border-left: 13px solid var(--ink);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--s8); }
.section--sand { background: var(--sand); }
.section--ink { background: var(--ink); color: #fff; }
.section--ink .eyebrow { color: var(--ball); }

@media (min-width: 900px) {
  .section { padding-block: var(--s12); }
}

/* Fonctions */
.features {
  list-style: none;
  margin: var(--s6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s2);
}

.feature {
  padding: var(--s3);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(16,32,58,.35); }
.feature p { color: var(--muted); margin: 0; }

.feature__icon {
  width: 48px;
  height: 48px;
  padding: 10px;
  margin-bottom: var(--s2);
  background: var(--sand);
  border-radius: 12px;
  fill: none;
  stroke: var(--clay);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 640px) {
  .features { grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
}
@media (min-width: 1000px) {
  .features { grid-template-columns: repeat(3, 1fr); }
}

/* Étapes « tableau de score » */
.score {
  list-style: none;
  margin: var(--s6) 0 0;
  padding: 0;
  display: grid;
  gap: var(--s2);
}

.score__step {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: var(--s2);
  align-items: start;
  padding: var(--s3) var(--s2);
  background: var(--chalk);
  border-radius: var(--radius);
}
.score__step h3 { margin-bottom: 6px; }
.score__step p { margin: 0; color: var(--muted); }

.score__num {
  display: grid;
  place-items: center;
  height: 60px;
  background: var(--ink);
  color: var(--ball);
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: 75%;
  font-size: 1.9rem;
  font-variant-numeric: tabular-nums;
}

.score__step--win { background: var(--ink); color: #fff; }
.score__step--win p { color: rgba(255,255,255,.85); }
.score__step--win .score__num { background: var(--ball); color: var(--ink); font-size: 1.5rem; }

@media (min-width: 900px) {
  .score { grid-template-columns: repeat(4, 1fr); gap: var(--s3); }
  .score__step { grid-template-columns: 1fr; padding: var(--s3); }
  .score__num { width: 88px; height: 72px; font-size: 2.3rem; }
}

/* Pour qui */
.audiences {
  display: grid;
  gap: var(--s4);
  margin-top: var(--s6);
}

.audience {
  padding-top: var(--s3);
  border-top: 3px solid var(--ball);
}
.audience h3 { font-size: 1.6rem; font-stretch: 85%; }
.audience p { color: rgba(255,255,255,.85); margin: 0; }

@media (min-width: 760px) {
  .audiences { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
}

/* Appel final */
.cta {
  background: var(--ball);
  color: var(--ink);
  padding-block: var(--s8);
}
.cta__inner { text-align: center; display: grid; justify-items: center; }
.cta h2 { max-width: 20ch; }
.cta p { max-width: 36rem; margin-bottom: var(--s4); }

/* Pied de page */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,.85);
  padding-block: var(--s4);
  font-size: .95rem;
}
.footer__inner { display: grid; gap: var(--s1); }
.footer p { margin: 0; }
.footer strong { color: #fff; }

@media (min-width: 760px) {
  .footer__inner { grid-template-columns: 1fr auto; }
}

/* ---------- Page « Mon compte » ---------- */
.page-head {
  position: relative;
  overflow: hidden;
  background: var(--clay);
  color: #fff;
  padding-block: var(--s6) var(--s8);
}
.page-head .hero__court { width: 70%; height: 220%; inset: -60% -20% auto auto; }
.page-head .wrap { position: relative; }
.page-head h1 {
  font-size: clamp(2.3rem, 9vw, 4rem);
  font-weight: 900;
  font-stretch: 78%;
  letter-spacing: -.02em;
  line-height: .95;
}
.page-head p { max-width: 36rem; margin: 0; font-size: 1.1rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: var(--s2);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.account { padding-block: 0 var(--s8); }

/* Raccourcis visibles sur téléphone pour aller directement au bon formulaire */
.jump {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1);
  margin: calc(-1 * var(--s4)) 0 var(--s3);
  padding: 6px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 30px -14px rgba(16,32,58,.4);
  position: relative;
}
.jump a {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: var(--sand);
}
.jump a:hover { background: var(--line); }

.account__grid {
  display: grid;
  gap: var(--s3);
  align-items: start;
}

.auth-card {
  padding: var(--s3);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  scroll-margin-top: 88px;
}
.auth-card h2 { font-size: clamp(1.7rem, 5vw, 2.2rem); margin-bottom: var(--s1); }
.auth-card__intro { color: var(--muted); }
.auth-card--new { border-top: 6px solid var(--ball); }
.auth-card--login { border-top: 6px solid var(--ink); }

.auth-card__small {
  margin: var(--s2) 0 0;
  font-size: .95rem;
  color: var(--muted);
  text-align: center;
}
.auth-card__small a { color: var(--clay); font-weight: 700; }

@media (min-width: 860px) {
  .jump { display: none; }
  .account { padding-top: 0; }
  .account__grid { grid-template-columns: 1fr 1fr; gap: var(--s4); }
  .auth-card { padding: var(--s4); box-shadow: 0 20px 50px -30px rgba(16,32,58,.45); }
}

.auth__notice {
  margin: 0 0 var(--s3);
  font-size: .92rem;
  padding: 12px var(--s2);
  background: #fff8d6;
  border-left: 4px solid var(--ball-dark);
  border-radius: 8px;
}

.form { display: grid; gap: 6px; }
.form label { font-weight: 700; margin-top: 10px; }
.form input[type="email"],
.form input[type="password"],
.form input[type="text"] {
  min-height: 48px;
  padding: 0 14px;
  font: inherit;
  font-size: 1rem;           /* 16 px : évite le zoom automatique sur iPhone */
  color: var(--text);
  background: var(--chalk);
  border: 2px solid var(--line);
  border-radius: 12px;
}
.form input:focus-visible { outline: none; border-color: var(--ink); background: #fff; }
.form input[aria-invalid="true"] { border-color: #b3261e; }
.form .btn { margin-top: var(--s3); }

.auth__hint { font-size: .9rem; color: var(--muted); margin: 0; }

.auth__status { margin: var(--s1) 0 0; font-weight: 700; min-height: 1.6em; }
.auth__status.is-error { color: #b3261e; }
.auth__status.is-ok { color: #1f6b3a; }

.roles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  border: 0;
}
.roles legend { font-weight: 700; margin-bottom: var(--s1); padding: 0; }
.roles label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.roles label:has(input:checked) { border-color: var(--clay); background: #fdf1ea; }
.roles input { accent-color: var(--clay); width: 18px; height: 18px; margin: 0; }

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

/* Aperçu vidéo dans le téléphone de l'accueil */
.phone__video { border-radius: 12px; overflow: hidden; line-height: 0; background: #16294a; }
.phone__video svg { width: 100%; height: auto; }

/* Boutons « Essayer la démo » */
.demo-try { margin-top: var(--s4); }
.demo-try p { margin: 0 0 var(--s1); font-weight: 700; }
.demo-try__buttons { display: flex; flex-wrap: wrap; gap: var(--s1); }

.demo-box {
  margin: var(--s3) 0;
  padding: var(--s2);
  background: #fff8d6;
  border: 1px solid var(--ball-dark);
  border-radius: var(--radius);
}
.demo-box p { margin: 0 0 var(--s1); }
.demo-box .btn-row { display: flex; flex-wrap: wrap; gap: var(--s1); }
.jump { margin: 0 0 var(--s3); }

/* ---------- Cases à cocher (consentements) ---------- */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; line-height: 1.4; margin: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--clay); }
.check a { color: var(--clay-dark); font-weight: 700; }

/* ---------- Page de politique de confidentialité ---------- */
.legal { max-width: 46rem; padding-block: var(--s4) var(--s6); }
.legal h2 { font-size: clamp(1.25rem, 2vw + .8rem, 1.6rem); font-stretch: 88%; max-width: none; margin: var(--s4) 0 var(--s1); }
.legal p, .legal li { font-size: 1rem; line-height: 1.6; text-wrap: pretty; }
.legal ul { padding-left: 1.25rem; margin: 0 0 var(--s2); }
.legal li { margin-bottom: 6px; }
.legal mark { background: #fff3b0; padding: 1px 4px; border-radius: 4px; }
.legal .box { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--clay); border-radius: 12px; padding: var(--s2); margin: var(--s2) 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: .9375rem; margin-bottom: var(--s2); }
.legal th, .legal td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { background: var(--sand); }

.form .check, .form .check span { font-weight: 400; }
