/* Coach Padel — sobre, lisible, une main sur iPhone. */
:root {
  --fond: #f2f5f8; --carte: #ffffff; --texte: #14202b; --doux: #6b7884; --trait: #e2e8ee;
  --accent: #0f5f99; --accent-fonce: #0b4673; --accent-clair: #e3eff8; --balle: #c9dc2f;
  --vert: #18804a; --vert-clair: #e2f4ea; --rouge: #c0392b; --rouge-clair: #fbe9e7; --ambre: #b7791f; --ambre-clair: #fdf3e1;
  --ombre: 0 1px 2px rgba(15, 35, 55, .06), 0 6px 18px rgba(15, 35, 55, .06);
  --rayon: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0e141a; --carte: #18212a; --texte: #eef3f7; --doux: #93a1ad; --trait: #263240;
    --accent: #4ea3e0; --accent-fonce: #2f86c7; --accent-clair: #16314a;
    --vert: #4fcf8a; --vert-clair: #143326; --rouge: #ff7b6b; --rouge-clair: #3a1d1a; --ambre: #f0b54a; --ambre-clair: #3a2c12;
    --ombre: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--texte); }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.doux { color: var(--doux); }
.petit { font-size: 13px; }
.centre { text-align: center; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.err { min-height: 20px; color: var(--rouge); font-size: 14px; margin: 8px 2px; }

/* ---------- boutons / champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 14px; font-weight: 600; font-size: 16px; transition: transform .08s, opacity .1s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.principal { background: var(--accent); color: #fff; }
.btn.vert { background: var(--vert); color: #fff; }
.btn.rouge-plein { background: var(--rouge); color: #fff; }
.btn.contour { border: 1.5px solid var(--trait); background: var(--carte); }
.btn.rouge { border: 1.5px solid var(--rouge); color: var(--rouge); background: var(--carte); }
.btn.large { width: 100%; }
.btn.lien { min-height: 40px; padding: 0 6px; color: var(--accent); font-weight: 600; }
.champ { display: block; width: 100%; min-height: 50px; border: 1.5px solid var(--trait); border-radius: 12px; padding: 12px 14px; background: var(--carte); font-size: 17px; outline: none; }
.champ:focus { border-color: var(--accent); }
textarea.champ { min-height: 90px; resize: vertical; }
.etiquette { display: block; margin: 16px 2px 6px; font-size: 14px; font-weight: 600; color: var(--doux); }
.ligne-btns { display: flex; gap: 10px; }
.ligne-btns > * { flex: 1; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { min-height: 42px; padding: 0 14px; border-radius: 21px; border: 1.5px solid var(--trait); background: var(--carte); font-weight: 600; font-size: 15px; }
.puce.actif { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- connexion ---------- */
#v-auth, #v-reinit, #v-attente, #v-oubli { min-height: 100dvh; display: flex; justify-content: center; padding: calc(30px + env(safe-area-inset-top, 0px)) 20px 40px; }
.auth-boite { width: 100%; max-width: 380px; text-align: center; }
.auth-boite form { text-align: left; }
.logo { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--ombre); }
.auth-boite h1 { margin: 12px 0 2px; font-size: 28px; letter-spacing: -.02em; }
.auth-boite > p { margin: 0 0 18px; }
.segment { display: flex; background: var(--trait); border-radius: 12px; padding: 3px; margin: 8px 0 6px; }
.segment button { flex: 1; min-height: 40px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--doux); }
.segment button.actif { background: var(--carte); color: var(--texte); box-shadow: var(--ombre); }
.choix-role { display: flex; gap: 10px; }
.choix-role button { flex: 1; min-height: 56px; border-radius: 14px; border: 2px solid var(--trait); background: var(--carte); font-weight: 700; font-size: 17px; }
.choix-role button.actif { border-color: var(--accent); background: var(--accent-clair); color: var(--accent); }
#auth-ok { margin-top: 6px; }
.centre-bloc { display: flex; margin: 14px auto 0; }
.gros-texte { font-size: 17px; line-height: 1.45; margin: 0 0 10px !important; overflow-wrap: anywhere; }
.ok-msg { min-height: 0; color: var(--vert); font-size: 15px; font-weight: 600; margin: 0 2px 8px !important; }
.ok-msg:empty, #att-err:empty { margin: 0 !important; }
#f-att-email { margin-top: 6px; }
#f-att-email .btn, #f-oubli .btn, #f-reinit .btn { margin-top: 12px; }
.bandeau { background: var(--accent-clair); color: var(--accent-fonce); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .bandeau { color: var(--accent); } }

/* ---------- structure ---------- */
#v-app { padding: calc(env(safe-area-inset-top, 0px)) 16px calc(110px + env(safe-area-inset-bottom, 0px)); max-width: 640px; margin: 0 auto; }
.hors-ligne { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--ambre-clair); color: var(--ambre); font-size: 14px; text-align: center; }
h1.titre { margin: 18px 2px 12px; font-size: 30px; letter-spacing: -.025em; }
.titre-sec { margin: 24px 4px 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); }
.carte + .carte { margin-top: 10px; }
.vide { padding: 28px 18px; text-align: center; color: var(--doux); }
.vide .btn { margin-top: 14px; }

.barre { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: color-mix(in srgb, var(--carte) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--trait); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
.barre button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; font-size: 12px; font-weight: 600; color: var(--doux); position: relative; }
.barre button svg { width: 25px; height: 25px; }
.barre button.actif { color: var(--accent); }
.pastille { position: absolute; top: 0; left: calc(50% + 6px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--rouge); color: #fff; font-size: 12px; font-weight: 700; line-height: 19px; text-align: center; }
.plus { position: fixed; right: max(18px, calc(50% - 302px)); bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 36px; font-weight: 300; line-height: 1; box-shadow: 0 6px 20px rgba(15, 70, 115, .35); z-index: 21; }
.plus:active { transform: scale(.94); }

/* ---------- séances ---------- */
.jour { margin: 22px 4px 8px; font-size: 15px; font-weight: 700; }
.seance { display: block; width: 100%; text-align: left; padding: 14px 16px; }
.seance + .seance { border-top: 1px solid var(--trait); }
.seance-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.heure { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.duree { color: var(--doux); font-size: 14px; white-space: nowrap; }
.lieu { color: var(--doux); font-size: 14px; margin-top: 2px; }
.joueurs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.etat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.etat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.etat.attente { background: var(--ambre-clair); color: var(--ambre); }
.etat.accepte { background: var(--vert-clair); color: var(--vert); }
.etat.refuse { background: var(--rouge-clair); color: var(--rouge); }
.cause { font-size: 14px; color: var(--rouge); margin-top: 4px; }
.note { margin-top: 8px; padding: 8px 10px; background: var(--accent-clair); border-radius: 10px; font-size: 14px; white-space: pre-wrap; }

.demande { padding: 16px; border: 2px solid var(--ambre-clair); }
.demande .qui { font-size: 14px; color: var(--doux); }
.demande .quand { font-size: 20px; font-weight: 700; margin: 2px 0; }
.demande .ligne-btns { margin-top: 14px; }
.demande .btn { min-height: 54px; font-size: 17px; }
.demande .serie { margin-top: 10px; width: 100%; }

.avis { padding: 12px 16px; }
.avis-l { padding: 8px 0; font-size: 15px; }
.avis-l + .avis-l { border-top: 1px solid var(--trait); }
.avis-l small { display: block; color: var(--doux); font-size: 12px; }
.avis-haut { display: flex; justify-content: space-between; align-items: center; }
.avis-haut strong { font-size: 15px; }

.info-notif { padding: 14px 16px; margin-top: 12px; }
.info-notif p { margin: 0 0 10px; font-size: 15px; }

/* ---------- joueurs / bilans ---------- */
.periode { margin: 4px 0 10px; }
.dates-libres { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.dates-libres input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; font-size: 15px; }
.totaux { display: flex; padding: 16px; gap: 10px; }
.totaux > div { flex: 1; }
.gros { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 10px 16px; text-align: left; }
.ligne + .ligne { border-top: 1px solid var(--trait); }
.ligne .nom { font-weight: 600; }
.ligne .chiffres { text-align: right; font-size: 14px; color: var(--doux); font-variant-numeric: tabular-nums; }
.ligne .chiffres b { color: var(--texte); font-size: 16px; }
.inviter { margin: 0 0 14px; }

/* ---------- formulaire séance ---------- */
.coche { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px; width: 100%; text-align: left; font-size: 17px; }
.coche + .coche { border-top: 1px solid var(--trait); }
.coche i { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--trait); flex: none; display: flex; align-items: center; justify-content: center; }
.coche.actif i { background: var(--accent); border-color: var(--accent); }
.coche.actif i::after { content: ""; width: 7px; height: 13px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }
.liste-coches { max-height: 300px; overflow-y: auto; }
.resume { margin: 18px 2px 6px; font-weight: 700; font-size: 17px; text-align: center; }
.alerte { background: var(--ambre-clair); color: var(--ambre); border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.alerte ul { margin: 6px 0 10px; padding-left: 18px; }
.case { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 16px; font-weight: 600; }
.case input { width: 22px; height: 22px; accent-color: var(--accent); }
.rangee { display: flex; gap: 10px; }
.rangee > * { flex: 1; min-width: 0; }

/* ---------- feuille ---------- */
.voile { position: fixed; inset: 0; background: rgba(5, 15, 25, .38); z-index: 40; }
.feuille { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column; background: var(--fond); border-radius: 20px 20px 0 0; z-index: 41; max-width: 640px; margin: 0 auto; animation: monte .2s ease-out; }
@keyframes monte { from { transform: translateY(30px); opacity: .5; } }
.feuille-haut { display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--trait); }
.feuille-haut h2 { margin: 0; font-size: 17px; text-align: center; }
.fermer { color: var(--accent); font-weight: 600; min-height: 40px; text-align: left; padding-left: 4px; }
.feuille-corps { overflow-y: auto; padding: 4px 16px calc(24px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }
.feuille-corps .btn.large { margin-top: 12px; }
.lien-texte { word-break: break-all; padding: 12px 14px; font-size: 14px; user-select: all; -webkit-user-select: all; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); background: #14202b; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; z-index: 60; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.compte p { margin: 0; padding: 14px 16px; }
.compte p + p { border-top: 1px solid var(--trait); }
