:root {
  --navy: #1a7bb8;
  --navy-deep: #14608f;
  --teal: #3ec6d8;
  --teal-soft: #dff6fa;
  --orange: #f4a022;
  --orange-soft: #fff3e0;
  --ink: #1b2430;
  --ink-soft: #5b6672;
  --bg: #eef3f6;
  --surface: #ffffff;
  --line: #d7e0e6;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(26, 54, 78, 0.08);
  --header: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

a { color: var(--navy); }
img { max-width: 100%; }

.skip {
  position: absolute; left: -999px; top: 8px;
}
.skip:focus { left: 8px; background: #fff; padding: 8px 12px; z-index: 20; }

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(62, 198, 216, 0.28), transparent 55%),
    radial-gradient(700px 380px at 110% 0%, rgba(244, 160, 34, 0.22), transparent 50%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 32px 28px 26px;
  text-align: center;
}

.login-card .logo { width: 168px; margin: 0 auto 10px; display: block; }
.login-card h1 { margin: 0 0 4px; font-size: 1.35rem; letter-spacing: -0.03em; }
.login-card .eyebrow {
  color: var(--navy); font-weight: 700; font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 18px;
}
.login-card p.lead { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 22px; }

.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--bg); border-radius: 999px; padding: 4px; }
.auth-tab {
  flex: 1; border: none; background: none; border-radius: 999px; padding: 8px 10px;
  font: inherit; font-weight: 700; font-size: 0.82rem; color: var(--ink-soft); cursor: pointer;
}
.auth-tab.is-active { background: #fff; color: var(--navy-deep); box-shadow: var(--shadow); }

.form { display: grid; gap: 12px; text-align: left; }
.form label { font-size: 0.78rem; color: var(--ink-soft); display: grid; gap: 5px; }
.form input {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
}
.form input:focus { outline: none; border-color: var(--navy); }
.hint { font-size: 0.78rem; color: var(--ink-soft); margin: 12px 0 0; }
.hint code { background: var(--teal-soft); padding: 1px 6px; border-radius: 6px; font-size: 0.76rem; }
.error { color: #b42318; font-size: 0.84rem; min-height: 1.2em; }

/* App chrome */
.app-header {
  position: sticky; top: 0; z-index: 10;
  height: var(--header);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 12px;
}
.app-header .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.app-header .brand img { height: 42px; width: auto; }
.app-header .brand strong { font-size: 0.92rem; display: block; line-height: 1.1; }
.app-header .brand span { font-size: 0.72rem; color: var(--ink-soft); }

.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.82rem; font-weight: 600;
  padding: 8px 10px; border-radius: 999px; background: none; border: none; cursor: pointer; font-family: inherit;
}
.nav a:hover, .nav a.is-active { background: var(--teal-soft); color: var(--navy-deep); }

.user-chip { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.78rem;
}

/* V2 : pleine largeur sur grand ecran (demande Sofiane) ; sur mobile le plafond etait sans effet -> rien ne change. */
.page { max-width: none; margin: 0 auto; padding: 22px 16px 56px; }
.page-title { margin: 0 0 6px; font-size: 1.55rem; letter-spacing: -0.03em; }
.page-sub { margin: 0 0 20px; color: var(--ink-soft); }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1.3fr 0.9fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 12px; font-size: 1rem; }
.title-dot { display: flex; align-items: center; gap: 8px; }
.title-dot::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 55%, var(--orange) 100%);
}

.btn {
  border: none; border-radius: 10px; padding: 11px 14px;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn-primary { background: var(--navy); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-ghost { background: var(--teal-soft); color: var(--navy-deep); }
.btn-orange { background: var(--orange); color: #fff; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px; font-size: 0.75rem; font-weight: 700;
}
.news-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: none; }
.news-item time { color: var(--ink-soft); font-size: 0.75rem; }

.match-row {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.match-row:last-child { border-bottom: 0; }
.match-row .when { font-size: 0.78rem; color: var(--ink-soft); }
.match-row .where { font-size: 0.78rem; color: var(--ink-soft); }
.team-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 10px; font-size: 0.78rem; font-weight: 650; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-chip.is-on { border-color: transparent; color: #fff; }
.filter-chip input { display: none; }

.cal-list { display: grid; gap: 10px; }
.event {
  background: #fff; border-radius: 14px; padding: 12px 14px;
  border-left: 5px solid var(--navy);
  box-shadow: var(--shadow);
}
.event .meta { font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.badge-home { background: var(--teal-soft); color: var(--navy-deep); }
.badge-away { background: var(--orange-soft); color: #9a5b00; }
.badge-train { background: #eef1f3; color: var(--ink-soft); }

.team-card {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit;
  overflow: hidden;
}
.team-card .banner {
  height: 72px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.roster { display: grid; gap: 8px; }
.member {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center;
}
.member .num { font-weight: 800; color: var(--navy); }

/* ---------- Calendrier : vue mensuelle ---------- */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav__month { font-weight: 800; font-size: 1.05rem; text-transform: capitalize; }
.cal-nav__arrow {
  border: 1.5px solid var(--line); background: #fff; border-radius: 8px;
  width: 32px; height: 32px; font-size: 1rem; cursor: pointer; color: var(--ink); flex-shrink: 0;
}
.cal-nav__arrow:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.cal-nav__arrow:disabled { opacity: 0.3; cursor: default; }
.cal-nav__today {
  border: none; background: var(--teal-soft); color: var(--navy-deep); border-radius: 8px;
  padding: 0 12px; font-size: 0.78rem; font-weight: 700; cursor: pointer; height: 32px; white-space: nowrap;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-grid__dow { text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--ink-soft); padding-bottom: 4px; }
.cal-day {
  aspect-ratio: 1/1; border-radius: 9px; background: var(--bg);
  padding: 5px 4px; display: flex; flex-direction: column; gap: 3px; position: relative;
  border: none; font-family: inherit; text-align: left; width: 100%; cursor: default;
}
.cal-day--empty { background: transparent; }
.cal-day--today { box-shadow: inset 0 0 0 2px var(--navy); }
.cal-day--has-events { cursor: pointer; }
.cal-day--has-events:hover { box-shadow: inset 0 0 0 2px var(--teal); }
.cal-day__num { font-size: 0.7rem; font-weight: 700; color: var(--ink-soft); }
.cal-day__stack { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.cal-day__bar { height: 6px; border-radius: 3px; }
@media (max-width: 560px) { .cal-day__num { font-size: 0.62rem; } .cal-day__bar { height: 5px; } }

.day-modal {
  display: none; position: fixed; inset: 0; background: rgba(20,24,30,0.55);
  z-index: 50; align-items: center; justify-content: center; padding: 20px;
}
.day-modal.is-open { display: flex; }
.day-modal__box { background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%; max-height: 80vh; overflow-y: auto; padding: 16px 18px; }
.day-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.day-modal__head h3 { margin: 0; font-size: 1rem; text-transform: capitalize; }
.day-modal__close { border: none; background: var(--teal-soft); color: var(--navy-deep); border-radius: 8px; padding: 6px 12px; font-weight: 700; cursor: pointer; font-size: 0.8rem; }

.week {
  display: grid; grid-template-columns: 1fr 1.5fr 1.2fr;
  gap: 10px; padding: 12px 8px; border-bottom: 1px solid var(--line);
}
.week.is-now { background: var(--teal-soft); border-radius: 10px; }
.court {
  border-radius: 10px; padding: 8px 10px; font-size: 0.82rem; margin-bottom: 6px;
  border: 1px solid var(--line); background: #f8fafb;
}
.court strong { display: block; }
.muted { color: var(--ink-soft); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-ph {
  aspect-ratio: 4/3; border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-soft), #fff);
  display: grid; place-items: center; color: var(--ink-soft); font-size: 0.82rem; text-align: center; padding: 10px;
}

.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-photo {
  width: 84px; height: 84px; border-radius: 20px;
  background: linear-gradient(135deg, var(--teal), var(--orange));
  display: grid; place-items: center; color: #fff; font-size: 1.4rem; font-weight: 800;
}

.cadre-links { display: grid; gap: 8px; }
.cadre-links a {
  display: block; padding: 12px 14px; border-radius: 12px; background: var(--teal-soft);
  text-decoration: none; font-weight: 650;
}

.data-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.data-row:last-child { border-bottom: none; }
.data-row__main strong { display: block; }
.data-row__main span { color: var(--ink-soft); font-size: 0.8rem; }
.data-row__del { border: none; background: none; color: #b42318; cursor: pointer; font-size: 0.78rem; font-weight: 700; flex-shrink: 0; }

@media (max-width: 860px) {
  .grid-2, .grid-3, .week { grid-template-columns: 1fr; }
  .nav { display: none; }
  .app-header { height: auto; padding: 10px 12px; flex-wrap: wrap; }
  .mobile-nav {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: 10px; right: 10px; z-index: 40;
  display: flex; overflow-x: auto; gap: 4px;
  padding: 6px 8px;
  border-radius: 999px;
  -webkit-overflow-scrolling: touch;

  /* Verre au repos : très transparent, mais flou + reflet */
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(10px) saturate(1.6);
  backdrop-filter: blur(10px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),   /* reflet haut */
    0 4px 16px rgba(26, 54, 78, 0.08);

  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    -webkit-backdrop-filter 0.25s ease,
    backdrop-filter 0.25s ease;
}

/* Pendant le défilement : caché */
.mobile-nav.is-scrolling {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

/* Interaction : plus visible */
.mobile-nav:hover,
.mobile-nav:active,
.mobile-nav:focus-within,
.mobile-nav.is-touched {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.8);
  backdrop-filter: blur(22px) saturate(1.8);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 28px rgba(26, 54, 78, 0.18);
}
  .page { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .mobile-nav a {
  white-space: nowrap; text-decoration: none;
  color: var(--navy-deep);
  font-size: 0.82rem; font-weight: 650;
  padding: 11px 13px; border-radius: 999px;
  background: transparent;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9); /* lisibilité sur fond chargé */
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease;
}
.mobile-nav a.is-active {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 861px) {
  .mobile-nav { display: none; }
}