/* rEvo — Check recycleur
   Style inspiré de plongee-issambres.fr : bandeau/nav noir, grand
   aplat marine, titres serif, corps de texte sans-serif, touche
   d'accent or/jaune (couleur de marque rEvo). */

:root {
    --navy:        #0b1c2c;
    --navy-light:  #16293d;
    --navy-lighter:#22394f;
    --gold:        #f2b705;
    --gold-dark:   #c99202;
    --white:       #ffffff;
    --bg:          #f3f5f7;
    --text:        #1c2530;
    --text-muted:  #5c6b7a;
    --border:      #dfe4ea;
    --success:     #1c7a44;
    --success-bg:  #e6f4ec;
    --danger:      #b3261e;
    --danger-bg:   #fbe9e7;
    --radius:      10px;
    --font-display: "Noto Serif", Georgia, serif;
    --font-body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--navy); }
label { font-weight: 600; font-size: .9rem; }

/* ---------------------------------------------------------------- */
/* Shell connecté (sidebar + contenu)                                */
/* ---------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
}
.sidebar-brand {
    padding: 0 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 12px;
}
/* Nom du club : long, il s'affiche sur deux lignes sans déborder */
.brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    color: var(--gold);
    display: block;
    max-width: 13em;          /* force un retour à la ligne vers le milieu du nom */
    text-wrap: balance;       /* deux lignes de longueur proche */
    overflow-wrap: break-word;
    margin-bottom: 6px;
}
.brand-logo { display: block; width: 96px; height: auto; margin-bottom: 12px; }
.brand-sub { display: block; font-size: .78rem; color: rgba(255,255,255,.65); letter-spacing: .04em; text-transform: uppercase; }

.sidebar-nav { display: flex; flex-direction: column; flex: 1; padding: 0 12px; }
.sidebar-nav a {
    display: block;
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: .93rem;
    margin-bottom: 2px;
}
.sidebar-nav a:hover { background: var(--navy-light); color: var(--white); }
.sidebar-nav a.active { background: var(--gold); color: var(--navy); font-weight: 600; }
.sidebar-section {
    margin: 16px 0 4px;
    padding: 0 12px;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.4);
}
.sidebar-user {
    padding: 14px 22px 0;
    font-size: .8rem;
    color: rgba(255,255,255,.6);
    border-top: 1px solid rgba(255,255,255,.12);
    margin-top: 12px;
}

.content { flex: 1; padding: 32px 40px; max-width: 1100px; }

/* ---------------------------------------------------------------- */
/* Shell invité (login / inscription)                                */
/* ---------------------------------------------------------------- */
.guest-shell { background: var(--navy); }
.guest-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.auth-card .brand-logo { width: 120px; margin: 0 auto 16px; padding: 14px; box-sizing: border-box; background: var(--navy); border-radius: 50%; }
.auth-card .brand { text-align: center; }
.auth-card .brand-mark { color: var(--navy); font-size: 1.45rem; max-width: 14em; margin: 0 auto 6px; }
.auth-card .brand-sub { color: var(--text-muted); }
.auth-card h1 { margin-top: 18px; }
.auth-links { margin-top: 18px; font-size: .88rem; text-align: center; color: var(--text-muted); }
.auth-links a { color: var(--navy); font-weight: 600; }

/* ---------------------------------------------------------------- */
/* Cartes / blocs                                                    */
/* ---------------------------------------------------------------- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    min-width: 160px;
    flex: 1;
}
.stat-tile .stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--navy); }
.stat-tile .stat-label { font-size: .82rem; color: var(--text-muted); }
.stat-tile.alert .stat-value { color: var(--gold-dark); }

/* ---------------------------------------------------------------- */
/* Formulaires                                                       */
/* ---------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=tel], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .95rem;
    font-family: var(--font-body);
    background: var(--white);
    color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
textarea { min-height: 80px; resize: vertical; }

.checkbox-line { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; }
.checkbox-line input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.checkbox-line .item-aide { display: block; font-size: .8rem; color: var(--text-muted); font-weight: 400; margin-top: 2px; }

.subfields { display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.subfield { display: flex; flex-direction: column; gap: 4px; min-width: 100px; }
.subfield label { font-size: .78rem; font-weight: 500; color: var(--text-muted); }

.btn {
    display: inline-block;
    background: var(--navy);
    color: var(--white);
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-body);
}
.btn:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); color: var(--navy); }
.btn-outline { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------------------------------------------------------------- */
/* Tableaux                                                           */
/* ---------------------------------------------------------------- */
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.data-table th { color: var(--text-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.data-table tr:hover td { background: var(--bg); }

/* Checklist section headers inside the check form/view */
.section-block { margin-bottom: 28px; }
.section-title {
    background: var(--navy);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin-bottom: 10px;
}
.item-row { border-bottom: 1px solid var(--border); padding: 10px 0; }
.item-row:last-child { border-bottom: none; }
.item-value { font-weight: 600; }
.item-value.done { color: var(--success); }
.item-value.pending { color: var(--text-muted); font-weight: 400; }

/* ---------------------------------------------------------------- */
/* Badges / statuts                                                  */
/* ---------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.badge-pending { background: #fdf1d6; color: #92660a; }
.badge-active  { background: var(--success-bg); color: var(--success); }
.badge-refused { background: var(--danger-bg); color: var(--danger); }
.badge-gold    { background: #fdf1d6; color: #92660a; }

/* Rôles d'un compte (administration des comptes) */
.roles-form { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.roles-form label { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; white-space: nowrap; }

/* ---------------------------------------------------------------- */
/* Flash messages                                                    */
/* ---------------------------------------------------------------- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .92rem; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error   { background: var(--danger-bg); color: var(--danger); }

/* ---------------------------------------------------------------- */
/* Divers                                                             */
/* ---------------------------------------------------------------- */
.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.filter-bar { display: flex; gap: 12px; align-items: end; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar .form-group { margin-bottom: 0; min-width: 160px; }

@media (max-width: 800px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; }
    .content { padding: 20px; }
    .form-row { flex-direction: column; }
    /* Bandeau en haut sur mobile : logo à gauche, nom du club à droite */
    .sidebar-brand .brand { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
    .sidebar-brand .brand-logo { grid-row: 1 / span 2; width: 64px; margin-bottom: 0; }
    .sidebar-brand .brand-mark { margin-bottom: 2px; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
    .auth-card .brand-mark { font-size: 1.2rem; }
}
