/* Foot-Tots — feuille de style commune */
:root {
  /* couleurs du logo Foot-Tots */
  --navy: #0a3a8c;      /* bleu profond */
  --blue: #0a6fd0;      /* bleu du nom FOOT-TOTS */
  --blue-2: #3d8bd6;    /* bleu maillot */
  --sky: #e8f2fc;
  --sky-2: #d3e5f8;
  --sun: #fcc018;       /* jaune t-shirt */
  --ball-orange: #c4570c;
  --ball-green: #24843c;
  --ball-red: #b0230c;
  --ball-blue: #0c48b4;
  --lavender: #9ca8e4;
  --g23: #e9a800; --g23-bg: #fff4cf; --g23-ink: #7a5300;   /* section 2-3 ans */
  --g45: #24843c; --g45-bg: #e3f4e8; --g45-ink: #1a6430;   /* section 4-5 ans */
  --line: #dbe3ee;
  --ink: #15203a;
  --muted: #5b6b85;
  --bg: #f6f9fd;
  --card: #ffffff;
  --green: #1e7b3a; --green-bg: #e3f4e8;
  --red: #b42318;   --red-bg: #fde4e4;
  --amber: #8a5a00; --amber-bg: #fff1d6;
  --violet: #7a2f9e; --violet-bg: #f2e6f8;
  --grey-bg: #eceff3;
  --paid: #0a4fa8; --paid-bg: #dcebff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 58, 140, .06), 0 6px 18px rgba(10, 58, 140, .07);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fredoka", "Nunito", system-ui, -apple-system, sans-serif;  /* titres et chiffres, ronds comme le logo */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; color: var(--navy); font-family: var(--display); font-weight: 600; letter-spacing: .005em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.display { font-family: var(--display); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* brand */
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--navy); }
.brand-ball { width: 34px; height: 34px; flex: none; }
.brand-word { height: 22px; width: auto; display: block; }
.brand-sub { font-size: .72rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
.rainbow { height: 5px; background: linear-gradient(90deg, var(--ball-orange) 0 25%, var(--ball-blue) 25% 50%, var(--ball-green) 50% 75%, var(--ball-red) 75%); }

/* sections par groupe */
.g23 { --g: var(--g23); --gbg: var(--g23-bg); --gink: var(--g23-ink); }
.g45 { --g: var(--g45); --gbg: var(--g45-bg); --gink: var(--g45-ink); }
.gtag { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 900; padding: .18rem .6rem; border-radius: 999px; background: var(--gbg); color: var(--gink); white-space: nowrap; }
.gtag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--g); }

/* cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* forms */
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .3rem; color: var(--navy); }
.field { margin-bottom: .9rem; }
.field .hint { font-weight: 500; color: var(--muted); font-size: .8rem; margin-top: .25rem; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 10px; padding: .65rem .75rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(47, 111, 191, .18); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.choice { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice label { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: 700; padding: .55rem .85rem; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; background: #fff; color: var(--ink); }
.choice input { accent-color: var(--blue); width: 18px; height: 18px; margin: 0; }
.choice label:has(input:checked) { border-color: var(--blue); background: var(--sky); color: var(--navy); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 600; font-size: .9rem; color: var(--ink); }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 800; font-size: .95rem; border: 0; border-radius: 10px; padding: .7rem 1.1rem; cursor: pointer; text-decoration: none; transition: transform .05s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--navy); }
.btn-sun { background: var(--sun); color: var(--navy); }
.btn-sun:hover { background: #f2b200; }
.btn-ghost { background: #fff; color: var(--blue); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--blue-2); }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid #f3c4c0; }
.btn-sm { padding: .45rem .7rem; font-size: .85rem; border-radius: 8px; white-space: nowrap; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 800; padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; background: var(--sky); color: var(--blue); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.violet { background: var(--violet-bg); color: var(--violet); }
.chip.grey { background: var(--grey-bg); color: var(--muted); }
.chip.paid { background: var(--paid-bg); color: var(--paid); }

.alert { border-radius: 10px; padding: .75rem .9rem; font-weight: 700; font-size: .9rem; }
.alert.error { background: var(--red-bg); color: var(--red); }
.alert.ok { background: var(--green-bg); color: var(--green); }
.alert.info { background: var(--sky); color: var(--navy); }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .7rem 1rem; border-radius: 10px; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); z-index: 100; max-width: calc(100% - 32px); }
.toast.error { background: var(--red); }

/* pavé de signature */
.sig-box { border: 2px dashed var(--line); border-radius: 14px; background: #fff; padding: .55rem .7rem .4rem; }
.sig-box.signed { border-style: solid; border-color: var(--blue-2); }
.sig-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; color: var(--navy); font-size: .9rem; }
.sig-clear { font: inherit; font-size: .8rem; font-weight: 800; color: var(--blue); background: none; border: 0; cursor: pointer; padding: .2rem; }
.sig-canvas { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; background: repeating-linear-gradient(transparent 0 118px, var(--line) 118px 119px, transparent 119px 150px); border-radius: 8px; }
.sig-hint { font-size: .72rem; color: var(--muted); font-weight: 600; text-align: center; }
.sig-box.signed .sig-hint { visibility: hidden; }
.sig-grid { display: grid; gap: .8rem; }

/* lecteur PDF intégré */
.pdfview { position: fixed; inset: 0; z-index: 80; background: #5b6472; display: flex; flex-direction: column; }
.pdfbar { display: flex; align-items: center; gap: .6rem; background: #fff; padding: .6rem .8rem; padding-top: max(.6rem, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.pdftitle { flex: 1; text-align: center; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdfpages { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pdfpages canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.pdfmsg { color: #fff; font-weight: 700; padding: 2rem 1rem; }
.pdfframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* pack équipement (inscription + espace parents) */
.equip { display: grid; grid-template-columns: 128px 1fr; gap: .9rem; align-items: start; background: #fff; border: 1.5px solid var(--sky-2); border-radius: 16px; padding: .75rem; box-shadow: var(--shadow); }
.equip.on { border-color: var(--blue); background: linear-gradient(180deg, #fff, var(--sky)); }
.equip-photo { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 12px; overflow: hidden; }
.equip-photo img { display: block; width: 100%; aspect-ratio: 600 / 962; object-fit: cover; }
.equip-title { display: block; font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--navy); line-height: 1.2; }
.equip-items { list-style: none; margin: .35rem 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.equip-items li { font-size: .78rem; font-weight: 800; background: var(--sky); color: var(--navy); border-radius: 999px; padding: .15rem .55rem; }
.equip-price { font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--blue); line-height: 1.1; margin-bottom: .5rem; }
.equip .field { margin-bottom: .5rem; }
.equip select { max-width: 220px; }
@media (max-width: 420px) { .equip { grid-template-columns: 104px 1fr; gap: .7rem; } }
.photo-zoom { position: fixed; inset: 0; z-index: 90; background: rgba(10, 20, 40, .88); display: grid; place-items: center; padding: 1rem; cursor: zoom-out; }
.photo-zoom img { max-width: 100%; max-height: 100%; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.equip .chip { white-space: normal; line-height: 1.25; }
.brand-logo { height: 78px; width: auto; display: block; flex: none; }
@media (max-width: 520px) { .brand-logo { height: 70px; } }

/* ballon Foot-Tots (dessin animé) qui rebondit */
.ballon-hero { width: 190px !important; height: auto; display: block; margin: 0 auto .6rem; animation: rebond 2.4s cubic-bezier(.5, 0, .5, 1) infinite; transform-origin: 50% 100%; }
@keyframes rebond { 0%, 100% { transform: translateY(0) rotate(-4deg); } 18% { transform: translateY(0) scale(1.04, .95) rotate(-2deg); } 50% { transform: translateY(-16px) rotate(5deg); } }

/* bandeau « nouvelle version » */
.updatebar { position: fixed; z-index: 120; left: 50%; transform: translateX(-50%); top: max(10px, env(safe-area-inset-top)); width: min(560px, calc(100% - 20px)); display: flex; align-items: center; gap: .7rem;
  background: var(--navy); color: #fff; border-radius: 16px; padding: .65rem .7rem .65rem .9rem; box-shadow: 0 12px 30px rgba(10, 30, 70, .3); animation: updIn .35s ease-out both; }
.updatebar img { width: 34px; height: 34px; flex: none; }
.updatebar div { flex: 1; font-size: .88rem; line-height: 1.25; }
.updatebar b { font-family: var(--display); font-weight: 600; font-size: 1rem; display: block; }
@keyframes updIn { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* bouton Actualiser */
.refresh-btn { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-weight: 800; font-size: .85rem; color: var(--blue); background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: .45rem .8rem .45rem .6rem; cursor: pointer; flex: none; }
.refresh-btn svg { width: 20px; height: 20px; fill: currentColor; }
.refresh-btn:hover { border-color: var(--blue-2); }
.refresh-btn:active { transform: scale(.96); }
.refresh-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .refresh-btn span { display: none; } .refresh-btn { padding: .55rem; } }
