/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: #1a56a0;
    color: white;
    padding: 0 2rem;
}
nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.brand { color: white; text-decoration: none; font-size: 1.2rem; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 1.2rem; }
.nav-links a { color: white; text-decoration: none; font-size: 0.9rem; }
.nav-links span { color: rgba(255,255,255,0.8); font-size: 0.9rem; }

/* Main */
main { flex: 1; padding: 2rem 1rem; }
.container { max-width: 900px; margin: 0 auto; }
h1 { font-size: 1.8rem; margin-bottom: 1.5rem; color: #1a56a0; }
h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.subtitle { color: #555; margin-bottom: 1.5rem; }

/* Footer */
footer {
    background: #1e2d40;
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
}
.footer-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}
.footer-logo { height: 60px; display: block; margin-bottom: .75rem; }
.footer-brand { font-size: 1.1rem; font-weight: 700; color: white; display: block; margin-bottom: .75rem; }
.footer-address { color: rgba(255,255,255,0.65); line-height: 1.7; }
.footer-right { display: flex; flex-direction: column; gap: .6rem; align-items: flex-end; padding-top: .25rem; }
.footer-link { color: rgba(255,255,255,0.85); text-decoration: none; white-space: nowrap; }
.footer-link:hover { color: white; text-decoration: underline; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    padding: .75rem 1rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    transition: opacity 0.2s;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #1a56a0; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-group { display: flex; gap: 0.8rem; margin-top: 1.5rem; }
.actions { margin-bottom: 1.5rem; }

/* Alerts */
.messages { margin-bottom: 1.5rem; }
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Breadcrumb */
.breadcrumb {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.step {
    padding: 0.4rem 1rem;
    background: #e9ecef;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #888;
}
.step.active { background: #1a56a0; color: white; font-weight: 600; }
.step.done { background: #28a745; color: white; }

/* Forms */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; }
.form-control {
    width: 100%;
    max-width: 700px;
    padding: 0.6rem 0.9rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
}
.form-control:focus { outline: none; border-color: #1a56a0; box-shadow: 0 0 0 2px rgba(26,86,160,0.2); }

/* Table */
.table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.table th { background: #1a56a0; color: white; padding: 0.8rem 1rem; text-align: left; font-size: 0.9rem; }
.table td { padding: 0.8rem 1rem; border-bottom: 1px solid #f0f0f0; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8f9fa; }

/* Creneaux grid */
.creneaux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.creneau-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.creneau-card.complet { opacity: 0.6; border-color: #dc3545; }
.creneau-card.reserve { border-color: #17a2b8; }
.creneau-dates { font-size: 0.95rem; line-height: 1.8; }
.creneau-dates div { background: #eef4ff; border-left: 3px solid #1a56a0; border-radius: 4px; padding: 3px 8px; margin-bottom: 3px; color: #1a56a0; font-weight: 600; }
.creneau-horaire { font-size: 1.1rem; font-weight: 700; color: #1a56a0; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* Recap card */
.recap-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    max-width: 500px;
}
.table-recap { width: 100%; }
.table-recap th { padding: 0.5rem 1rem 0.5rem 0; color: #555; font-weight: 500; white-space: nowrap; }
.table-recap td { padding: 0.5rem 0; font-weight: 600; }

/* Login page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
}
.login-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.login-subtitle { color: #888; margin-bottom: 1.5rem; font-size: 0.95rem; }

/* Info bi-hebdomadaire */
.info-biweekly {
    background: #e8f4fd;
    border-left: 3px solid #1a56a0;
    padding: 0.6rem 1rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #1a56a0;
    margin-bottom: 1rem;
}

/* Field errors */
.field-error { color: #dc3545; font-size: 0.85rem; margin-top: 0.25rem; }

/* Empty state */
.empty-msg { color: #888; font-style: italic; padding: 2rem 0; }

/* Table responsive wrapper */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Visibilité desktop/mobile */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* Nav toggle (hamburger) */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 8px;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}
nav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.open .nav-toggle span:nth-child(2) { opacity: 0; }
nav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Cartes réservation mobile */
.resa-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    margin-bottom: 1rem;
    overflow: hidden;
}
.resa-card-header {
    background: #1a56a0;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.7rem 1rem;
}
.resa-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.92rem;
}
.resa-card-row:last-child { border-bottom: none; }
.resa-card-row span:first-child { color: #666; font-weight: 500; flex-shrink: 0; margin-right: 0.5rem; }
.resa-card-row span:last-child { text-align: right; font-weight: 600; color: #222; }
.resa-card-footer {
    padding: 0.7rem 1rem;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
}

/* ===================== RESPONSIVE MOBILE ===================== */
@media (max-width: 768px) {

    /* Visibilité */
    .mobile-only { display: block; }
    .desktop-only { display: none; }

    /* Nav */
    header { padding: 0; }
    nav {
        flex-wrap: wrap;
        height: auto;
        padding: 0.6rem 1rem;
        position: relative;
        gap: 0;
    }
    .brand { padding: 0.4rem 0; font-size: 1.1rem; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        border-top: 1px solid rgba(255,255,255,0.2);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    nav.open .nav-links { display: flex; }
    .nav-links a, .nav-links span {
        font-size: 1rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-links > *:last-child { border-bottom: none; }

    /* Layout */
    main { padding: 1rem 0.75rem; }
    .container { padding: 0; }
    h1 { font-size: 1.3rem; margin-bottom: 1rem; }
    h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }

    /* Recap card */
    .recap-card { padding: 1rem; }
    .table-recap th, .table-recap td { font-size: 0.88rem; padding: 0.4rem 0; }

    /* Boutons */
    .btn { display: block; text-align: center; }
    .btn-group { flex-direction: column; gap: 0.6rem; }
    .actions { display: flex; flex-direction: column; gap: 0.7rem; }

    /* Formulaires filtres */
    .filters-row { flex-direction: column !important; }
    .filters-row .form-group { width: 100%; margin: 0 0 0.75rem 0 !important; }
    .form-control { max-width: 100%; }

    /* Breadcrumb */
    .breadcrumb { gap: 0.25rem; flex-wrap: wrap; }
    .step { font-size: 0.72rem; padding: 0.3rem 0.6rem; }

    /* Tables avec data-label → cartes */
    .table-responsive { overflow-x: unset; }
    .table-responsive .table,
    .table-responsive .table tbody { display: block; width: 100%; }
    .table-responsive .table thead { display: none; }
    .table-responsive .table tr {
        display: block;
        background: white;
        border-radius: 10px;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.10);
        overflow: hidden;
    }
    .table-responsive .table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.55rem 1rem;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.9rem;
        white-space: normal;
    }
    .table-responsive .table td:last-child { border-bottom: none; }
    .table-responsive .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #1a56a0;
        flex-shrink: 0;
        margin-right: 1rem;
    }
    .table-responsive .table td:empty { display: none; }

    /* Creneaux grid */
    .creneaux-grid { grid-template-columns: 1fr; }

    /* Login */
    .login-card { padding: 1.5rem 1rem; margin: 0 0.5rem; }

    /* Info biweekly */
    .info-biweekly { font-size: 0.85rem; }

    /* Sport buttons */
    .sport-grid { flex-direction: column; }
    .sport-grid .btn { text-align: center; }
}
