/* =====================================================
   Portail membre Ichor — thème aligné sur le site vitrine
   (nuit & or, goutte et titre en rouge vin)
   ===================================================== */

:root {
    --ichor-bg:           #0d0b09;   /* --ink du site */
    --ichor-surface:      #14110d;   /* --ink-2 */
    --ichor-surface-2:    #1d1813;   /* --ink-3 */
    --ichor-border:       rgba(212, 160, 23, 0.18);  /* --line */
    --ichor-blood:        #7b2d3b;   /* rouge vin du titre ICHOR */
    --ichor-blood-bright: #9c3a4b;
    --ichor-gold:         #d4a017;   /* --gold */
    --ichor-gold-soft:    #e8c766;
    --ichor-bone:         #efe7d8;   /* --paper */
    --ichor-muted:        #b9ac96;   /* --paper-dim */
    --sidebar-width:      260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Spectral', serif;
    background-color: var(--ichor-bg);
    color: var(--ichor-bone);
    min-height: 100vh;
    margin: 0;
}

h1, h2, h3, h4, h5, h6, .display-font {
    font-family: 'Cinzel', serif;
    color: var(--ichor-bone);
    letter-spacing: 0.5px;
}

a { color: var(--ichor-gold-soft); text-decoration: none; }
a:hover { color: var(--ichor-gold); }

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #14110d 0%, #0d0b09 100%);
    border-right: 1px solid var(--ichor-border);
    padding: 24px 16px;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar .brand {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ichor-border);
}
.sidebar .brand h1 {
    font-size: 1.15rem;
    margin: 0;
    color: var(--ichor-blood-bright);
    text-transform: uppercase;
    letter-spacing: 3px;
}
.sidebar .brand small {
    color: var(--ichor-muted);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.sidebar .nav-link {
    color: rgba(239, 231, 216, 0.75);
    padding: 10px 14px;
    margin-bottom: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar .nav-link i { width: 18px; text-align: center; }
.sidebar .nav-link:hover {
    background: rgba(212, 160, 23, 0.08);
    color: var(--ichor-bone);
    border-left-color: var(--ichor-gold);
}
.sidebar .nav-link.active {
    background: rgba(212, 160, 23, 0.14);
    color: var(--ichor-bone);
    border-left-color: var(--ichor-gold);
    font-weight: 600;
}

.sidebar hr { border-color: var(--ichor-border); margin: 14px 0; }

/* === MAIN === */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
}

.top-bar {
    background: var(--ichor-surface);
    border: 1px solid var(--ichor-border);
    border-top: 3px solid var(--ichor-gold);
    border-radius: 10px;
    padding: 16px 22px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-bar h4 { margin: 0; font-size: 1.3rem; }
.top-bar small { color: var(--ichor-muted); }

.user-info { display: flex; align-items: center; gap: 14px; }
.user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ichor-blood), var(--ichor-blood-bright));
    color: var(--ichor-bone);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    font-family: 'Cinzel', serif;
}
.user-name { font-weight: 600; color: var(--ichor-bone); font-size: 0.92rem; }
.user-role { color: var(--ichor-muted); font-size: 0.78rem; }

/* === CARDS === */
.card {
    background: var(--ichor-surface);
    border: 1px solid var(--ichor-border);
    border-radius: 10px;
    color: var(--ichor-bone);
}
.card-header {
    background: var(--ichor-surface-2);
    border-bottom: 1px solid var(--ichor-border);
    color: var(--ichor-gold-soft);
    font-family: 'Cinzel', serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 12px 18px;
}
.card-body { padding: 18px; }

/* === STAT CARDS === */
.stat-card {
    background: var(--ichor-surface);
    border: 1px solid var(--ichor-border);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--ichor-gold), transparent);
    opacity: 0.5;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--ichor-gold);
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.15);
}
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ichor-blood), var(--ichor-blood-bright));
    color: var(--ichor-bone);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}
.stat-icon.gold {
    background: linear-gradient(135deg, var(--ichor-gold), #a87f12);
    color: var(--ichor-bg);
}
.stat-icon.bone {
    background: linear-gradient(135deg, #3a3128, #221c15);
    color: var(--ichor-bone);
}
.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ichor-bone);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    color: var(--ichor-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* === BUTTONS === */
.btn-primary {
    background: linear-gradient(135deg, var(--ichor-gold), #b8890f);
    border: none;
    color: var(--ichor-bg);
    font-weight: 600;
    letter-spacing: 0.5px;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--ichor-gold-soft), var(--ichor-gold));
    color: var(--ichor-bg);
}
.btn-outline-primary {
    border-color: var(--ichor-gold);
    color: var(--ichor-gold-soft);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--ichor-gold);
    color: var(--ichor-bg);
    border-color: var(--ichor-gold);
}
.btn-secondary {
    background: var(--ichor-surface-2);
    border: 1px solid var(--ichor-border);
    color: var(--ichor-bone);
}
.btn-secondary:hover {
    background: rgba(212, 160, 23, 0.15);
    color: var(--ichor-bone);
}

/* === FORMS === */
.form-control, .form-select {
    background: var(--ichor-bg);
    border: 1px solid rgba(239, 231, 216, 0.25);
    color: var(--ichor-bone);
}
.form-control:focus, .form-select:focus {
    background: var(--ichor-bg);
    border-color: var(--ichor-gold);
    color: var(--ichor-bone);
    box-shadow: 0 0 0 0.2rem rgba(212, 160, 23, 0.2);
}
.form-control::placeholder { color: rgba(185, 172, 150, 0.55); }
.form-label { color: var(--ichor-bone); font-weight: 500; }
.form-text { color: var(--ichor-muted); }
.input-group-text {
    background: var(--ichor-surface-2);
    border-color: rgba(239, 231, 216, 0.25);
    color: var(--ichor-gold-soft);
}

/* === TABLES === */
.table { color: var(--ichor-bone); border-color: var(--ichor-border); }
.table thead th {
    background: var(--ichor-surface-2);
    color: var(--ichor-gold-soft);
    border-bottom: 1px solid var(--ichor-border);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.table tbody tr { border-color: var(--ichor-border); }
.table-hover tbody tr:hover { background: rgba(212, 160, 23, 0.06); }
.table > :not(caption) > * > * {
    background: transparent;
    color: var(--ichor-bone);
    border-color: var(--ichor-border);
}

/* === ALERTS === */
.alert {
    border-radius: 8px;
    border-width: 1px;
    background: var(--ichor-surface);
    color: var(--ichor-bone);
    border-color: var(--ichor-border);
}
.alert-success {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.4);
    color: #a5d6a7;
}
.alert-danger {
    background: rgba(123, 45, 59, 0.25);
    border-color: var(--ichor-blood-bright);
    color: #e8a5ae;
}
.alert-warning {
    background: rgba(212, 160, 23, 0.12);
    border-color: var(--ichor-gold);
    color: var(--ichor-gold-soft);
}
.alert-info {
    background: rgba(70, 130, 180, 0.12);
    border-color: rgba(70, 130, 180, 0.4);
    color: #9bc9e8;
}

/* === BADGES === */
.badge {
    font-family: 'Spectral', serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 4px 9px;
}

/* === AUTH (pages connexion / création de compte) === */
body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(123, 45, 59, 0.2), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 160, 23, 0.08), transparent 60%),
        linear-gradient(135deg, #0d0b09 0%, #14110d 100%);
    padding: 30px 16px;
}
.auth-shell { max-width: 460px; width: 100%; }
.auth-card {
    background: var(--ichor-surface);
    border: 1px solid var(--ichor-border);
    border-top: 3px solid var(--ichor-blood);
    border-radius: 12px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.auth-brand {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ichor-border);
}
.auth-brand h1 {
    color: var(--ichor-blood-bright);
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
}
.auth-brand small {
    color: var(--ichor-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-top: 6px;
}
.auth-page .btn-primary {
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.88rem;
    width: 100%;
}
.form-check-input { background-color: var(--ichor-bg); border-color: rgba(239, 231, 216, 0.35); }
.form-check-input:checked { background-color: var(--ichor-gold); border-color: var(--ichor-gold); }
.auth-footer {
    text-align: center;
    margin-top: 18px;
    color: var(--ichor-muted);
    font-size: 0.82rem;
}

/* Champ pot de miel (anti-robots) */
.hp-field { position: absolute; left: -9999px; top: auto; }

/* === MOBILE === */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 1100;
    background: var(--ichor-gold);
    border: none;
    color: var(--ichor-bg);
    padding: 9px 12px;
    border-radius: 6px;
}
@media (max-width: 992px) {
    .mobile-menu-btn { display: block; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 20px; }
    .top-bar { padding-left: 70px; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
    }
    .sidebar-overlay.show { display: block; }
}

/* === DIVERS === */
hr { border-color: var(--ichor-border); }
.text-muted { color: var(--ichor-muted) !important; }
.text-gold { color: var(--ichor-gold-soft); }
.text-blood { color: var(--ichor-blood-bright); }

/* Déconnexion : le bouton du formulaire POST se présente comme un nav-link */
.logout-form { margin: 0; }
.logout-btn {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

/* Libellé de section du sidebar (bloc Maître de jeu) */
.sidebar .nav-label {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ichor-gold);
  opacity: 0.75;
  padding: 0.15rem 1.25rem 0.35rem;
}
