/* ============================================================
   TCV Noscours — Palette sobre : navy + ambre chaud
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --navy:       #1e3a5f;
    --navy-dk:    #142a47;
    --navy-lt:    #eef2f7;
    --amber:      #b45309;
    --amber-lt:   #fef3c7;
    --text:       #1a1a2e;
    --text-soft:  #4a5568;
    --muted:      #9aa3b0;
    --border:     #e4e7ec;
    --bg:         #f7f8fa;
    --white:      #ffffff;
    --radius:     10px;
    --shadow:     0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.05);
    --shadow-lg:  0 4px 6px rgba(0,0,0,.06), 0 10px 28px rgba(0,0,0,.09);
    --orange-dk:  #92400e;
    --slate:      #475569;
}

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

body {
    font-family: 'Poppins', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    font-size: 14px;
}

/* ── Header compact ────────────────────────────────────────── */

.site-header {
    background: var(--navy);
    padding: .7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-header__brand {
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}

.site-header__brand em {
    font-style: normal;
    color: #a8c4e0;
    font-weight: 500;
}

.site-header__season {
    font-size: .72rem;
    color: #a8c4e0;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Barre de filtres ──────────────────────────────────────── */

.filter-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: .55rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.filter-bar__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}

.filter-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 .2rem;
}

/* Bouton dropdown */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    transition: all .12s;
    white-space: nowrap;
    line-height: 1;
}

.filter-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
    background: var(--navy-lt);
}

.filter-btn.active {
    border-color: var(--navy);
    color: var(--white);
    background: var(--navy);
}

.filter-btn svg {
    width: 11px; height: 11px;
    flex-shrink: 0;
    transition: transform .12s;
    opacity: .6;
}
.filter-btn.open svg { transform: rotate(180deg); }

/* Panneau dropdown */
.filter-dropdown { position: relative; }

.filter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .3rem;
    min-width: 140px;
    z-index: 50;
}
.filter-panel.open { display: block; }

.filter-option {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .6rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    transition: background .1s;
    white-space: nowrap;
    user-select: none;
}
.filter-option:hover { background: var(--bg); }
.filter-option.selected { color: var(--navy); font-weight: 700; background: var(--navy-lt); }
.filter-option input { accent-color: var(--navy); flex-shrink: 0; }

.filter-birth__input {
    padding: .3rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-soft);
    background: var(--white);
    width: 110px;
    transition: border-color .12s;
    line-height: 1;
    height: 30px;
}
.filter-birth__input:focus {
    outline: none;
    border-color: var(--navy);
    color: var(--text);
}
.filter-birth__input::placeholder { color: var(--muted); font-weight: 400; }

.results-count {
    margin-left: auto;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
}

/* ── Grille ────────────────────────────────────────────────── */

.groups-grid {
    max-width: 1100px;
    margin: 1.25rem auto;
    padding: 0 1.5rem 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: .9rem;
}

/* ── Carte ─────────────────────────────────────────────────── */

.group-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform .16s, box-shadow .16s;
    overflow: hidden;
}
.group-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Trait coloré en haut */
.group-card::before {
    content: '';
    display: block;
    height: 3px;
    background: var(--navy);
    flex-shrink: 0;
}
.group-card--padel::before  { background: var(--amber); }
.group-card--both::before   { background: linear-gradient(90deg, var(--navy) 50%, var(--amber) 100%); }

.group-card__head {
    padding: .9rem 1rem .5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.group-card__body {
    padding: 0 1rem .75rem;
    flex: 1;
}

.group-card__name {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.group-card__sub {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .2rem;
    font-weight: 500;
}

.group-card__meta {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-top: .55rem;
}

.group-card__desc {
    font-size: .73rem;
    color: var(--muted);
    margin-top: .35rem;
    line-height: 1.5;
}

.group-card__footer {
    padding: .75rem 1rem .9rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.group-card__spots-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: .73rem;
    font-weight: 600;
    margin-bottom: .4rem;
}

/* Jauge */
.spots-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
    margin-bottom: .75rem;
}
.spots-bar__fill { height: 100%; border-radius: 2px; transition: width .3s; }
.spots-bar__fill--ok     { background: var(--navy); }
.spots-bar__fill--almost { background: var(--amber); }
.spots-bar__fill--full   { background: #dc2626; }

/* ── Badges ────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    font-size: .63rem;
    font-weight: 700;
    padding: .18rem .5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-tennis { background: var(--navy-lt);  color: var(--navy); }
.badge-padel  { background: var(--amber-lt); color: var(--amber); }

.level-badge {
    display: inline-block;
    font-size: .63rem;
    font-weight: 700;
    padding: .18rem .5rem;
    border-radius: 4px;
    letter-spacing: .03em;
    border: 1px solid transparent;
}
.level-baby-tennis { background: #f5f0ff; color: #6d28d9; border-color: #ede9fe; }
.level-mini-tennis { background: var(--navy-lt); color: var(--navy-dk); border-color: #c9d9ec; }
.level-rouge       { background: #fff0f0; color: #b91c1c; border-color: #fecaca; }
.level-orange      { background: var(--amber-lt); color: var(--amber); border-color: #fde68a; }
.level-vert        { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.level-jaune       { background: #fefce8; color: #854d0e; border-color: #fef08a; }
.level-adulte      { background: #f8fafc; color: #475569; border-color: var(--border); }

/* ── Boutons inscription ───────────────────────────────────── */

.btn-register {
    display: block;
    width: 100%;
    text-align: center;
    padding: .55rem 1rem;
    border-radius: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .14s;
    border: none;
    cursor: pointer;
    letter-spacing: .01em;
}
.btn-register--tennis {
    background: var(--navy);
    color: #fff;
}
.btn-register--tennis:hover  { background: var(--navy-dk); box-shadow: 0 3px 10px rgba(30,58,95,.25); }
.btn-register--padel  {
    background: var(--amber);
    color: #fff;
}
.btn-register--padel:hover   { background: #92400e; box-shadow: 0 3px 10px rgba(180,83,9,.25); }
.btn-register--both   {
    background: var(--navy);
    color: #fff;
}
.btn-register--both:hover    { background: var(--navy-dk); box-shadow: 0 3px 10px rgba(30,58,95,.25); }
.btn-register--full   {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    font-weight: 600;
}

/* ── Modal inscription ─────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .65rem;
}

.modal-badges { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .95rem;
    color: var(--muted);
    line-height: 1;
    padding: .2rem .4rem;
    border-radius: 4px;
    flex-shrink: 0;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: .15rem;
}

.modal-schedule {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: .9rem;
}

.modal-notice {
    padding: .55rem .8rem;
    border-radius: 7px;
    font-size: .78rem;
    font-weight: 500;
    margin-bottom: .9rem;
    line-height: 1.4;
}
.modal-notice--wait  { background: var(--amber-lt); color: var(--amber); border: 1px solid #fde68a; }
.modal-notice--error { background: #fff1f1; color: #b91c1c; border: 1px solid #fecaca; }

.modal-success {
    text-align: center;
    padding: 1.25rem .5rem;
    font-size: .88rem;
    color: #166534;
    font-weight: 600;
    line-height: 1.5;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    margin-bottom: .9rem;
}

.modal-fields { display: flex; flex-direction: column; gap: .7rem; margin-bottom: .9rem; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.field-group { display: flex; flex-direction: column; gap: .28rem; }

.field-group label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-soft);
}
.req { color: #ef4444; }

.field-group input {
    padding: .42rem .65rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-family: 'Poppins', sans-serif;
    font-size: .82rem;
    color: var(--text);
    background: var(--white);
    transition: border-color .12s, box-shadow .12s;
}
.field-group input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(30,58,95,.08);
}

.modal-actions {
    display: flex;
    gap: .65rem;
    align-items: center;
}

.modal-cancel {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: .8rem;
    color: var(--muted);
    font-weight: 500;
}
.modal-cancel:hover { color: var(--text); }

@media (max-width: 480px) {
    .field-row { grid-template-columns: 1fr; }
    .modal-box { padding: 1.25rem; max-height: 95vh; }
}

/* ── Admin (style vert inchangé) ───────────────────────────── */

.admin-nav-bg  { background: #094f2d; }
.tcv-header-bg { background: linear-gradient(135deg, #0d6e3f 0%, #094f2d 100%); }

.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}

.focus\:border-tcv:focus { border-color: #0d6e3f; }
.focus\:ring-tcv\/30:focus { --tw-ring-color: rgba(13,110,63,.3); }

.status-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
}
.status-pending   { background: #fef9c3; color: #854d0e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-waitlist  { background: #fff7ed; color: #c2410c; }
.status-cancelled { background: #f1f5f9; color: #64748b; }

[x-cloak] { display: none !important; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    .site-header { padding: .6rem 1rem; }
    .filter-bar  { padding: .5rem 1rem; }
    .groups-grid { padding: 0 1rem 2rem; gap: .75rem; }
    .filter-sep  { display: none; }
}
