/* ============================================================
   PARTIPADEL - Style partagé
   Palette : bleu profond / vert padel / blanc
   ============================================================ */
:root {
  --blue: #0b4f9e;
  --blue-dark: #073b78;
  --blue-soft: #e8f1fc;
  --green: #16b877;
  --green-dark: #0e9c63;
  --green-soft: #e4f7ee;
  --white: #ffffff;
  --ink: #12233b;
  --muted: #6a7c92;
  --line: #e3e9f1;
  --bg: #f5f8fc;
  --danger: #e2483d;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(11, 79, 158, .08);
  --shadow-lg: 0 10px 36px rgba(11, 79, 158, .16);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Conteneur mobile-first centré */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 84px;
}

/* ---------- En-tête ---------- */
.topbar {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.topbar .sub { font-size: 12.5px; opacity: .85; font-weight: 400; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  background: rgba(255,255,255,.15);
  border: none; color: #fff; width: 38px; height: 38px;
  border-radius: 11px; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: background .15s;
}
.icon-btn:active { background: rgba(255,255,255,.28); }
.badge-dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--green); color: #fff;
  border-radius: 9px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--blue-dark);
}

/* ---------- Contenu ---------- */
.content { padding: 20px; }
.section-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); font-weight: 700; margin: 4px 0 12px;
}

/* ---------- Logo / brand ---------- */
.brand {
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px;
  box-shadow: 0 2px 10px rgba(22,184,119,.4);
}

/* ---------- Cartes ---------- */
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
  border: 1px solid var(--line);
}
.card-row { display: flex; align-items: center; gap: 14px; }

/* ---------- Formulaires ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13.5px; font-weight: 600;
  margin-bottom: 7px; color: var(--ink);
}
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 5px; }
input, select, textarea {
  width: 100%; padding: 13px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
textarea { resize: vertical; min-height: 78px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px; font-size: 16px; font-weight: 700;
  border: none; border-radius: 12px; cursor: pointer;
  font-family: inherit; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-dark); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 3px 12px rgba(22,184,119,.32); }
.btn-green:active { background: var(--green-dark); }
.btn-ghost { background: var(--blue-soft); color: var(--blue); }
.btn-outline { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-danger-ghost { background: #fdeceb; color: var(--danger); }
.btn-sm { width: auto; padding: 9px 15px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Pastilles / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600;
}
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-green { background: var(--green-soft); color: var(--green-dark); }
.pill-muted { background: #eef1f6; color: var(--muted); }
.pill-level { background: var(--blue); color: #fff; }

/* ---------- Avatar ---------- */
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; background: var(--blue-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-weight: 700; font-size: 19px;
  flex-shrink: 0; border: 2px solid #fff; box-shadow: var(--shadow);
}
.avatar-lg { width: 92px; height: 92px; font-size: 34px; }

/* ---------- Niveau slider ---------- */
.level-display {
  font-size: 30px; font-weight: 800; color: var(--blue);
  text-align: center; margin-bottom: 6px;
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 8px; border-radius: 5px; padding: 0;
  background: linear-gradient(90deg, var(--green), var(--blue));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px;
  border-radius: 50%; background: #fff; border: 3px solid var(--blue);
  cursor: pointer; box-shadow: var(--shadow);
}
input[type=range]::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue); cursor: pointer;
}

/* ---------- Chips (jours / créneaux) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 14px; border-radius: 11px; font-size: 14px; font-weight: 600;
  background: #fff; border: 1.5px solid var(--line); color: var(--muted);
  cursor: pointer; user-select: none; transition: all .12s;
}
.chip.active {
  background: var(--green); border-color: var(--green); color: #fff;
}

/* ---------- Barre de navigation basse ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 50;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none;
}
.tab .ico { font-size: 21px; line-height: 1; }
.tab.active { color: var(--blue); }

/* ---------- États vides ---------- */
.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty .big { font-size: 46px; margin-bottom: 12px; }
.empty p { font-size: 14.5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 13px 20px;
  border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; transition: opacity .25s, transform .25s; max-width: 88%;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: var(--green-dark); }
.toast-error { background: var(--danger); }

/* ---------- Divers ---------- */
.center-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 28px;
}
.text-muted { color: var(--muted); font-size: 13.5px; }
.mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.link { color: var(--blue); font-weight: 600; text-decoration: none; cursor: pointer; }
.spinner {
  width: 34px; height: 34px; border: 3px solid var(--blue-soft);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-box {
  background: #fff; padding: 20px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center;
  box-shadow: var(--shadow);
}
.qr-box canvas, .qr-box img { border-radius: 8px; }
.code-chip {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px; font-weight: 700; letter-spacing: 2px;
  background: var(--blue-soft); color: var(--blue);
  padding: 10px 18px; border-radius: 10px; margin-top: 14px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
