/*
 * Inscription tournoi : style « programme de compétition ».
 * Couleurs du club (bleu nuit + or) sur fond papier, titres condensés façon tableau de scores.
 */

:root {
  --ink: #0b1f3a;          /* bleu nuit du club */
  --ink-2: #16345e;
  --gold: #f5b700;         /* or */
  --gold-soft: #fff4cc;
  --paper: #f4f1ea;        /* fond */
  --card: #ffffff;
  --field: #fbfaf7;
  --line: #e6e0d3;
  --line-2: #d8d0bf;
  --text: #1c2433;
  --text-2: #4a5263;
  --muted: #7a8090;
  --ok: #1f8a4c;
  --error: #c62828;
  --error-soft: #fdecec;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 12px 32px -12px rgba(11, 31, 58, .18);
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--body); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1100px; margin: -4.5rem auto 0; padding: 0 1rem 2rem; flex: 1; position: relative; z-index: 1; }

.font-display { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.gold { color: var(--gold); }

/* ---------- En-tête ---------- */
.header {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  padding: 3rem 1rem 7rem;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 22px),
    radial-gradient(120% 90% at 50% 0%, var(--ink-2) 0%, var(--ink) 65%);
}
.header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold) 80%, transparent);
}
.eyebrow {
  display: inline-block; margin: 0 0 1rem; padding: .35rem .9rem; border-radius: 999px;
  border: 1px solid rgba(245, 183, 0, .55); color: var(--gold);
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow sup { font-size: .65em; }
.header h1 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.2rem, 6.5vw, 4.6rem); line-height: .95; letter-spacing: .005em;
  margin: 0 auto .9rem; max-width: 16ch;
}
.header-meta { margin: 0; color: #c9d4e6; font-weight: 600; font-size: clamp(.85rem, 1.8vw, 1rem); letter-spacing: .04em; }

/* ---------- Étapes ---------- */
.steps {
  display: flex; list-style: none; margin: 0 auto 1.25rem; padding: 1rem 1.25rem; max-width: 56rem;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow);
}
.steps li { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.steps li + li::before {
  content: ""; position: absolute; top: 16px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
.steps li.done::before, .steps li.active::before { background: var(--ink); }
.steps .num {
  position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 2px solid var(--line-2); color: var(--muted);
  font-family: var(--display); font-weight: 700; font-size: 1.05rem; transition: all .25s ease;
}
.steps .lbl { margin-top: .4rem; font-size: .75rem; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.2; padding: 0 .15rem; }
.steps li.done .num { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.active .num { background: var(--gold); border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 5px var(--gold-soft); }
.steps li.active .lbl { color: var(--ink); }

/* ---------- Cartes ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2.25rem; max-width: 48rem; margin: 0 auto 2rem; animation: rise .45s cubic-bezier(.2, .7, .2, 1) both;
}
.card.narrow { max-width: 40rem; }
.card h2 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; color: var(--ink);
  font-size: clamp(1.7rem, 3.4vw, 2.2rem); line-height: 1; margin: 0 0 1.75rem;
}
.card h2::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 2px; background: var(--gold); margin-top: .7rem; }
.center h2::after { margin-left: auto; margin-right: auto; }
.card h2.big { font-size: clamp(2.2rem, 5vw, 3rem); }
.center { text-align: center; }

/* ---------- Champs ---------- */
.fields { display: grid; gap: 1.1rem; }
.field { display: block; }
.label { display: block; font-size: .85rem; font-weight: 700; color: var(--text-2); margin-bottom: .45rem; }
.label.sm { font-size: .72rem; margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .06em; }
.req { color: var(--error); font-weight: 800; }
.hint { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=password], input[type=search] {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  padding: .8rem 1rem; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.row input { padding: .6rem .8rem; font-size: .95rem; }
input::placeholder { color: #a7abb6; }
input:hover { border-color: var(--line-2); }
input:focus { outline: none; background: #fff; border-color: var(--ink); box-shadow: 0 0 0 4px var(--gold-soft); }
input.invalid { border-color: var(--error) !important; background: var(--error-soft); }
input.invalid:focus { box-shadow: 0 0 0 4px rgba(198, 40, 40, .12); }
.error-message { color: var(--error); font-size: .82rem; font-weight: 600; margin-top: .35rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Boutons ---------- */
.btn {
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; border: 0; border-radius: 12px;
  padding: .85rem 1.5rem; transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--gold-soft), 0 0 0 6px var(--ink); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--ink-2); box-shadow: 0 10px 22px -10px rgba(11, 31, 58, .6); }
#submit-btn, .btn-gold { background: var(--gold); color: var(--ink); letter-spacing: .04em; }
#submit-btn:hover:not(:disabled), .btn-gold:hover:not(:disabled) { background: #ffc41f; box-shadow: 0 10px 22px -10px rgba(245, 183, 0, .9); }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink); background: #fff; }
.btn-add { background: transparent; color: var(--ink); border: 1.5px dashed var(--line-2); padding: .7rem 1rem; }
.btn-add:hover:not(:disabled) { border-color: var(--gold); border-style: solid; background: var(--gold-soft); }
#add-judge { padding: .85rem; margin-bottom: .5rem; }
.btn-delete { background: var(--error-soft); color: var(--error); padding: 0; width: 38px; height: 38px; border-radius: 10px; font-size: .9rem; }
.btn-delete:hover { background: var(--error); color: #fff; }
.btn-block { width: 100%; }
.actions { display: flex; gap: .75rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.actions .btn { flex: 1; }
.card > .btn-primary { margin-top: 1.75rem; padding: .85rem 2rem; }

/* ---------- Catégories et lignes ---------- */
.category { border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1rem; background: var(--card); }
.category-title {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .9rem;
  padding-left: .8rem; border-left: 4px solid var(--gold);
  font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; color: var(--ink); line-height: 1.1;
}
.category-title .years { font-family: var(--body); font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: .25rem; }
.badge {
  font-family: var(--display); font-size: 1rem; font-weight: 700; min-width: 2rem; height: 2rem; padding: 0 .55rem;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--ink); color: #fff;
}
.list:not(:empty) { margin-bottom: .9rem; }
.row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: .75rem; align-items: start;
  background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: .6rem;
  animation: rise .3s ease both;
}
.row .full { grid-column: 1 / -1; }
.row .btn-delete { margin-top: 1.25rem; }

/* ---------- Récapitulatif ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .6rem; margin-bottom: .5rem; }
.summary p {
  margin: 0; padding: .8rem 1rem; border-radius: 12px; background: var(--field); border: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text-2);
}
.summary p strong { font-weight: 700; color: var(--text); }
.summary p:nth-child(-n+2) { grid-column: 1 / -1; justify-content: flex-start; }
.summary .count { font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1; }
.summary details { grid-column: 1 / -1; font-size: .875rem; color: var(--text-2); padding: .25rem .25rem 0; }
.summary summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.summary ul { margin: .6rem 0 0; padding-left: 1.2rem; line-height: 1.7; }

/* ---------- Confirmation ---------- */
.success-icon {
  width: 84px; height: 84px; margin: 0 auto 1.5rem; border-radius: 50%; background: var(--gold); color: var(--ink);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 10px var(--gold-soft);
}
.success-icon svg { width: 42px; height: 42px; stroke-width: 2.5; }
.lead { color: var(--text-2); font-size: 1.1rem; line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xsmall { font-size: .78rem; }
.en { font-style: italic; }

/* ---------- Pied de page ---------- */
.footer { text-align: center; padding: 1.5rem 1rem 2.5rem; color: var(--muted); font-size: .82rem; }
.footer p { margin: 0; }
.footer p + p { margin-top: .4rem; }
.footer a { color: var(--ink); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--gold); }
.footer a:hover { color: var(--ink-2); }

/* ---------- Modale et notifications ---------- */
.modal { position: fixed; inset: 0; background: rgba(11, 31, 58, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.modal-card { max-width: 28rem; margin: 0; padding: 2.25rem; }
.modal-card h3 { font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; color: var(--ink); margin: 0 0 .5rem; }
.spinner { width: 56px; height: 56px; margin: 0 auto 1.25rem; border: 4px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .9s linear infinite; }
.toasts { position: fixed; top: 1rem; right: 1rem; left: 1rem; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; pointer-events: none; }
.toast {
  pointer-events: auto; color: #fff; background: var(--ink); padding: .8rem 1.2rem; border-radius: 12px; max-width: 26rem;
  font-weight: 600; font-size: .9rem; box-shadow: 0 12px 30px -10px rgba(11, 31, 58, .5); border-left: 5px solid var(--gold);
  animation: slideIn .3s ease-out; transition: opacity .3s ease;
}
.toast.success { border-left-color: #3ccf7a; }
.toast.error { background: #3a0d12; border-left-color: #ff5a5a; }

/* ---------- Musique par participant ---------- */
.music-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.btn-file { position: relative; overflow: hidden; padding: .5rem .9rem; font-size: .85rem; border-radius: 10px; cursor: pointer; }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn-file:focus-within { box-shadow: 0 0 0 4px var(--gold-soft), 0 0 0 6px var(--ink); }
.music-status { font-size: .85rem; color: var(--muted); word-break: break-all; }
.music-status.ok { color: var(--ok); font-weight: 700; }
.music-status.warn { color: #a15c00; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--error); }
.music.invalid-box { outline: 2px solid var(--error); outline-offset: 5px; border-radius: 8px; }
.music-warning { background: var(--gold-soft); border: 1px solid #f0d27a; color: #6b4a00; border-radius: 12px; padding: .85rem 1rem; margin: 1.25rem 0; font-size: .875rem; text-align: left; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .card { padding: 1.5rem; }
  .category { padding: 1rem; }
  .steps { border-radius: 18px; padding: .85rem .5rem; }
  .steps .lbl { font-size: .68rem; }
}
@media (max-width: 560px) {
  .header { padding: 2.25rem 1rem 6.5rem; }
  .steps .lbl { display: none; }
  .steps li.active .lbl { display: block; position: absolute; top: 2.4rem; white-space: nowrap; }
  .steps { padding-bottom: 2rem; }
  .row { grid-template-columns: 1fr auto; }
  .row > .field:first-child { grid-column: 1 / 2; }
  .row > .field:nth-child(2) { grid-column: 1 / 2; grid-row: 2; }
  .row .btn-delete { grid-column: 2; grid-row: 1; }
  .category-title { font-size: 1.15rem; }
  .actions { flex-direction: column-reverse; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
