/* =====================================================================
   Coachpote — feuille de style
   Identité « stade la nuit » : fond nuit, rouge vif + lime électrique,
   Anton (titres) + Hanken Grotesk (corps). Mobile-first.
   ===================================================================== */

:root {
    --bg:        #0B0E13;
    --bg-2:      #11151D;   /* panneaux / cartes */
    --bg-3:      #171D28;   /* éléments surélevés */
    --line:      #242C3A;
    --text:      #EEF1F6;
    --muted:     #8B95A7;
    --red:       #FF3D2E;   /* signature Coachpote */
    --red-dk:    #E22D20;
    --lime:      #C2FF45;   /* éclat électrique */
    --gold:      #FFC842;
    --radius:    14px;
    --shadow:    0 10px 30px rgba(0,0,0,.45);
    --glow-red:  0 0 0 1px rgba(255,61,46,.35), 0 8px 28px rgba(255,61,46,.18);
    --glow-lime: 0 0 0 1px rgba(194,255,69,.35), 0 8px 28px rgba(194,255,69,.15);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(255,61,46,.10), transparent 60%),
        radial-gradient(900px 500px at -10% 0%, rgba(194,255,69,.07), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    line-height: 1.55;
    font-size: 16px;
}

h1, h2, h3, .display {
    font-family: "Anton", "Hanken Grotesk", sans-serif;
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: uppercase;
    line-height: .98;
    margin: 0 0 .5rem;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.5rem; letter-spacing: .02em; }

a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- En-tête ---------------------------------------------------------- */
.topbar {
    background: linear-gradient(180deg, #0E131B, #0B0E13);
    border-bottom: 1px solid var(--line);
    position: relative;
}
.topbar::after {           /* liseré diagonal rouge -> lime, énergie sport */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px; height: 3px;
    background: linear-gradient(90deg, var(--red) 0%, var(--red) 45%, var(--lime) 100%);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
.topbar__inner {
    max-width: 960px; margin: 0 auto;
    padding: .8rem 1rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand__logo { display: block; width: 30px; height: 30px; }
.brand__name {
    font-family: "Anton", sans-serif;
    text-transform: uppercase; letter-spacing: .04em; font-size: 1.35rem;
}
.brand__name b { color: var(--red); font-weight: inherit; }
.nav { display: flex; align-items: center; gap: .9rem; font-size: .9rem; }
.nav a { color: var(--text); opacity: .8; }
.nav a:hover { opacity: 1; }
.nav__user { color: var(--lime); font-weight: 700; }
.nav__logout {
    border: 1px solid var(--line); border-radius: 8px; padding: .3rem .7rem; color: var(--text);
}
.nav__logout:hover { border-color: var(--red); }

/* --- Conteneur -------------------------------------------------------- */
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* --- Messages flash --------------------------------------------------- */
.flash {
    border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: 1rem;
    font-size: .95rem; border: 1px solid var(--line); background: var(--bg-2);
    border-left-width: 4px;
}
.flash--success { border-left-color: var(--lime); }
.flash--error   { border-left-color: var(--red); }
.flash--info    { border-left-color: var(--gold); }

/* --- Cartes ----------------------------------------------------------- */
.card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

/* --- Authentification ------------------------------------------------- */
.auth { max-width: 420px; margin: 2rem auto; }
.auth__card {
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.auth__bar { height: 6px; background: linear-gradient(90deg, var(--red), var(--lime)); }
.auth__body { padding: 1.9rem 1.6rem; }
.auth__title { margin-bottom: .35rem; font-size: 2.2rem; }
.auth__sub { color: var(--muted); font-size: .92rem; margin: 0 0 1.5rem; }
.auth__alt { text-align: center; margin-top: 1.2rem; font-size: .9rem; color: var(--muted); }

/* --- Formulaires ------------------------------------------------------ */
.field { margin-bottom: 1rem; }
.field label {
    display: block; font-size: .76rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: .4rem;
}
.field input {
    width: 100%; padding: .8rem .85rem; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.field input::placeholder { color: #4D586B; }
.field input:focus {
    outline: none; border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(255,61,46,.22);
}

/* --- Boutons ---------------------------------------------------------- */
.btn {
    display: inline-block; width: 100%; padding: .85rem 1.1rem;
    font-family: "Anton", sans-serif; text-transform: uppercase; letter-spacing: .05em;
    font-size: 1.05rem; color: #0B0E13; background: var(--red);
    border: none; border-radius: 10px; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    color: #fff;
}
.btn:hover { background: var(--red-dk); text-decoration: none; transform: translateY(-1px); box-shadow: var(--glow-red); }
.btn:focus-visible { outline: 3px solid rgba(255,61,46,.5); outline-offset: 2px; }
.btn--lime { background: var(--lime); color: #0B0E13; }
.btn--lime:hover { background: #b2f02f; box-shadow: var(--glow-lime); }
.btn--ghost {
    width: auto; background: transparent; color: var(--text); border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--text); background: var(--bg-3); transform: none; box-shadow: none; }

/* --- Tableau de bord -------------------------------------------------- */
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { position: relative; padding-bottom: .55rem; }
.page-head h1 .hl { color: var(--red); }
.page-head h1::after {
    content: ""; position: absolute; left: 0; bottom: 0;
    width: 56px; height: 5px; background: var(--lime);
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}
.lead { color: var(--muted); margin: 0; }

.empty { text-align: center; padding: 2.5rem 1.5rem; }
.empty p { color: var(--muted); max-width: 36ch; margin: .5rem auto 1.25rem; }

.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.25rem; }

/* --- Module clubs ----------------------------------------------------- */
.cluster { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn--inline { width: auto; }
.btn--sm {
    width: auto; padding: .45rem .75rem; font-size: .82rem; border-radius: 8px;
    font-family: "Anton", sans-serif; text-transform: uppercase; letter-spacing: .05em;
}
.btn--danger { color: var(--red); border-color: rgba(255,61,46,.4); }
.btn--danger:hover { background: rgba(255,61,46,.12); border-color: var(--red); }

.card--link { display: block; color: inherit; position: relative; overflow: hidden; }
.card--link::before {        /* liseré accent à gauche, vibe maillot */
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
    background: var(--red);
}
.card--link:hover { text-decoration: none; border-color: var(--red); transform: translateY(-2px); box-shadow: var(--glow-red); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.card--link h2 { font-size: 1.7rem; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
    text-align: left; font-family: "Anton", sans-serif; text-transform: uppercase;
    letter-spacing: .06em; font-size: .78rem; color: var(--muted);
    padding: .85rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-3);
}
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table__actions { white-space: nowrap; }

.role {
    display: inline-block; font-size: .7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .06em;
    padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.role--proprietaire { background: var(--gold); color: #0B0E13; border-color: var(--gold); }
.role--admin        { background: transparent; color: var(--lime); border-color: rgba(194,255,69,.5); }
.role--membre       { background: transparent; color: var(--muted); }

.code-box { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.code-box__value {
    font-family: "Anton", sans-serif; font-size: 1.9rem; letter-spacing: .3em;
    color: var(--lime); background: var(--bg);
    border: 1px dashed rgba(194,255,69,.5); border-radius: 10px;
    padding: .5rem 1.1rem; text-shadow: 0 0 18px rgba(194,255,69,.35);
}

/* --- Pied de page ----------------------------------------------------- */
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer__inner { max-width: 960px; margin: 0 auto; padding: 1rem; display: flex; justify-content: space-between; }

/* --- Tablette / desktop ---------------------------------------------- */
@media (min-width: 640px) {
    h1 { font-size: 3rem; }
    .grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Formulaires : selects & grille de champs ------------------------ */
.field select {
    width: 100%; padding: .8rem .85rem; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 1.15rem, calc(100% - 13px) 1.15rem;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.field select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,61,46,.22); }
.field-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.field-row .field { flex: 1 1 6rem; }

.table input, .table select {
    padding: .45rem .55rem; font: inherit; color: var(--text);
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* --- En-tête de section ---------------------------------------------- */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin: 0 0 .25rem;
}
.section-head h2 { margin: 0; }

/* --- Tablette / desktop ---------------------------------------------- */
@media (max-width: 639px) {
    h1 { font-size: 2.1rem; }
}

/* --- Module équipes -------------------------------------------------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .25rem; }
.section-head h2 { margin: 0; }
.field-row { display: flex; gap: .75rem; }
.field-row .field { flex: 1; margin-bottom: 1rem; }
.field-row .field:nth-child(2) { max-width: 5.5rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

select, .table input, .table select {
    font: inherit; color: var(--text); background: var(--bg);
    border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem;
}
.field select { width: 100%; padding: .8rem .85rem; border-radius: 10px; }
select:focus, .table input:focus, .table select:focus {
    outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,61,46,.22);
}

/* --- Partage d'invitation (QR + lien) -------------------------------- */
.invite-share { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.qrbox { background: #fff; padding: 10px; border-radius: 12px; line-height: 0; }
.qrbox img, .qrbox canvas { display: block; }
.invite-share__col { flex: 1; min-width: 200px; }
.invite-link {
    display: block; word-break: break-all; background: var(--bg);
    border: 1px solid var(--line); border-radius: 8px; padding: .5rem .65rem;
    font-size: .8rem; color: var(--lime);
}

/* --- Compétition : classement & confrontations ----------------------- */
.table tr.is-me td { background: rgba(194,255,69,.10); }
.match-row { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.match-row:last-child { border-bottom: none; }
.match-row__team { flex: 1; min-width: 0; }
.match-row__team--h { text-align: right; }
.match-row__score {
    min-width: 70px; text-align: center; font-family: "Anton", sans-serif; letter-spacing: .03em;
    background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: .15rem .4rem; font-size: .85rem;
}
.match-row--me { font-weight: 700; }
.match-row--me .match-row__score { border-color: var(--lime); color: var(--lime); }

/* --- Calendrier & présences ------------------------------------------ */
.pres { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .2rem; }
.pres-btn {
    font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--bg-3);
    color: var(--text); border-radius: 8px; padding: .4rem .8rem; font-size: .85rem;
}
.pres-btn:hover { border-color: var(--text); }
.pres-btn--present.is-on  { background: var(--lime); color: #0B0E13; border-color: var(--lime); }
.pres-btn--absent.is-on   { background: var(--red);  color: #fff;     border-color: var(--red); }
.pres-btn--peut_etre.is-on{ background: var(--gold); color: #0B0E13; border-color: var(--gold); }

.ev-badge {
    display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; padding: .15rem .55rem; border-radius: 999px;
    border: 1px solid var(--line); color: var(--muted);
}
.ev-badge--match { color: var(--red); border-color: rgba(255,61,46,.45); }
.ev-badge--entrainement { color: var(--lime); border-color: rgba(194,255,69,.45); }

.score-pill {
    display: inline-block; font-family: "Anton", sans-serif; padding: .1rem .55rem;
    border-radius: 6px; border: 1px solid var(--line); white-space: nowrap;
}
.score-pill--win  { color: var(--lime); border-color: var(--lime); }
.score-pill--loss { color: var(--red);  border-color: rgba(255,61,46,.6); }
.score-pill--draw { color: var(--gold); border-color: var(--gold); }

/* --- Messagerie ------------------------------------------------------ */
.badge-unread {
    background: var(--red); color: #fff; font-weight: 800; font-size: .75rem;
    border-radius: 999px; padding: .1rem .5rem; min-width: 22px; text-align: center;
}
.chat { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.msg {
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
    padding: .6rem .8rem; max-width: 85%; align-self: flex-start;
}
.msg--me { align-self: flex-end; background: rgba(194,255,69,.08); border-color: rgba(194,255,69,.3); }
.msg__meta { font-size: .72rem; color: var(--muted); margin-bottom: .2rem; }
.msg__body { white-space: pre-wrap; word-break: break-word; }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; }
.chat-form textarea {
    flex: 1; font: inherit; color: var(--text); background: var(--bg);
    border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; resize: vertical;
}
.chat-form textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,61,46,.22); }
.chat-form .btn { width: auto; }

/* --- Cotisations ----------------------------------------------------- */
.progress { height: 8px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--lime), var(--gold)); }
.st {
    display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; padding: .15rem .55rem; border-radius: 999px;
    border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.st--paye      { background: var(--lime); color: #0B0E13; border-color: var(--lime); }
.st--partiel   { color: var(--gold); border-color: var(--gold); }
.st--en_retard { background: var(--red); color: #fff; border-color: var(--red); }
.st--en_attente{ color: var(--muted); }

/* --- Accessibilité : mouvement réduit -------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
