/* CNAM CTF Platform - Styles */

:root {
    /* ===== COULEURS ===== */
    --cnam-red: #A71931;
    --cnam-dark: #32373c;
    --cnam-grey: #f4f4f4;
    --cnam-text: #212529;

    /* ===== TYPOGRAPHIE ===== */

    /* Font Families */
    --font-primary: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-display: 'Roboto Slab', Georgia, 'Times New Roman', serif;
    --font-code: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 2rem;        /* 32px */
    --font-size-4xl: 2.5rem;      /* 40px */

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    background-color: #fff;
    color: var(--cnam-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Header & Nav --- */
.top-bar {
    background-color: #fff;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    border-top: 4px solid var(--cnam-red);
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    color: var(--cnam-red) !important;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.nav-link {
    color: var(--cnam-dark);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-left: 15px;
    transition: color 0.3s;
}

.nav-link:hover, .nav-link.active {
    color: var(--cnam-red) !important;
    text-decoration: underline;
}

/* --- Hero Section --- */
.hero-section {
    background-color: var(--cnam-red);
    color: white;
    padding: 80px 0;
    background: linear-gradient(135deg, #A71931 0%, #851225 100%);
}

.hero-title {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    font-size: 3rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: var(--font-weight-light);
}

/* --- Boutons --- */
.btn-cnam {
    background-color: var(--cnam-dark);
    color: white;
    padding: 10px 25px;
    text-transform: uppercase;
    border-radius: 0;
    border: none;
    font-weight: var(--font-weight-medium);
    transition: all 0.3s;
}

.btn-cnam:hover {
    background-color: var(--cnam-red);
    color: white;
}

.btn-outline-cnam {
    border: 1px solid var(--cnam-red);
    color: var(--cnam-red);
    border-radius: 0;
}

.btn-outline-cnam:hover {
    background-color: var(--cnam-red);
    color: white;
}

/* --- Challenge Cards --- */
.challenge-card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    height: 100%;
    border-top: 3px solid transparent;
}

.challenge-card:hover {
    transform: translateY(-5px);
    border-top: 3px solid var(--cnam-red);
}

.challenge-header {
    background-color: var(--cnam-dark);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-points {
    background-color: var(--cnam-red);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* --- Category Cards --- */
.category-card {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.category-card .card-header {
    background-color: var(--cnam-dark);
    color: white;
    padding: 20px;
    text-align: center;
}

.category-card .card-header i {
    font-size: 3rem;
    margin-bottom: 10px;
}

.category-card .card-body {
    padding: 20px;
}

/* --- Auth Container --- */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    background: white;
    border-top: 5px solid var(--cnam-red);
}

.form-control:focus {
    border-color: var(--cnam-red);
    box-shadow: 0 0 0 0.2rem rgba(167, 25, 49, 0.25);
}

.nav-tabs .nav-link.active {
    border-top: 3px solid var(--cnam-red);
    color: var(--cnam-red) !important;
}

.nav-tabs .nav-link {
    color: var(--cnam-dark);
}

/* --- Footer --- */
footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e7e7e7;
    padding: 40px 0;
    margin-top: auto;
    font-size: 0.9rem;
}

/* --- Page Header --- */
.page-header {
    background-color: var(--cnam-grey);
    padding: 40px 0;
    border-bottom: 3px solid var(--cnam-red);
    margin-bottom: 30px;
}

.page-header h1 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    color: var(--cnam-dark);
}

/* --- Utilities --- */
.hex-decor {
    color: var(--cnam-red);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.text-cnam {
    color: var(--cnam-red) !important;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s;
}

/* --- Breadcrumb --- */
.breadcrumb-item a {
    color: var(--cnam-red);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--cnam-dark);
}

/* --- Challenge Detail Page --- */
.challenge-detail {
    background-color: white;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.challenge-detail-header {
    background: linear-gradient(135deg, var(--cnam-dark) 0%, #1a1d20 100%);
    color: white;
    padding: 30px;
    position: relative;
}

.challenge-detail-header h1 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    margin-bottom: 10px;
}

.challenge-detail-body {
    padding: 30px;
}

.challenge-info-box {
    background-color: var(--cnam-grey);
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--cnam-red);
}

.challenge-info-box h5 {
    color: var(--cnam-dark);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 15px;
}

.challenge-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.challenge-stat {
    text-align: center;
    padding: 15px 25px;
    background-color: var(--cnam-grey);
    border-radius: 4px;
}

.challenge-stat .value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--cnam-red);
}

.challenge-stat .label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
}

.challenge-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.flag-submit-section {
    background-color: var(--cnam-grey);
    padding: 25px;
    border-radius: 4px;
    margin-top: 30px;
}

.flag-submit-section h4 {
    color: var(--cnam-dark);
    margin-bottom: 20px;
}

/* flag-input-group - voir section Flag Form plus bas */

.difficulty-badge {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    border-radius: 4px;
}

.difficulty-easy {
    background-color: #28a745;
    color: white;
}

.difficulty-medium {
    background-color: #ffc107;
    color: #212529;
}

.difficulty-hard {
    background-color: #dc3545;
    color: white;
}

.resource-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.resource-list li:last-child {
    border-bottom: none;
}

.resource-list a {
    color: var(--cnam-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-list a:hover {
    color: var(--cnam-red);
}

.resource-list i {
    color: var(--cnam-red);
}

.hint-accordion .accordion-button:not(.collapsed) {
    background-color: rgba(167, 25, 49, 0.1);
    color: var(--cnam-red);
}

.hint-accordion .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(167, 25, 49, 0.25);
}

.validations-list {
    max-height: 200px;
    overflow-y: auto;
}

.validation-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.validation-item:last-child {
    border-bottom: none;
}

/* --- Category Icon --- */
.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    background-color: var(--cnam-grey);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon i {
    font-size: 2.5rem;
    color: var(--cnam-red);
}

.category-card:hover .category-icon {
    background-color: var(--cnam-red);
}

.category-card:hover .category-icon i {
    color: white;
}

/* --- Category Page Header --- */
.category-banner {
    background: linear-gradient(135deg, var(--cnam-dark) 0%, #1a1d20 100%);
    border-radius: 8px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.category-banner-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-banner-icon i {
    font-size: 2.5rem;
    color: var(--cnam-red);
}

.category-banner-info {
    flex: 1;
    min-width: 200px;
}

.category-banner-title {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    color: white;
    margin: 0;
    font-size: 1.8rem;
}

.category-banner-desc {
    color: rgba(255,255,255,0.7);
    margin: 5px 0 0;
    font-size: 0.95rem;
}

.category-banner-stats {
    display: flex;
    gap: 20px;
}

.cat-stat {
    text-align: center;
    padding: 10px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    min-width: 80px;
}

.cat-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: white;
}

.cat-stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- New Challenge Cards --- */
.challenge-card-new {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.challenge-card-new:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: var(--cnam-red);
}

.challenge-card-new.is-solved {
    border-left: 4px solid #28a745;
}

.solved-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #28a745;
    font-size: 1.4rem;
    z-index: 1;
}

.challenge-card-top {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.diff-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diff-easy {
    background-color: #d4edda;
    color: #155724;
}

.diff-medium {
    background-color: #fff3cd;
    color: #856404;
}

.diff-hard {
    background-color: #f8d7da;
    color: #721c24;
}

.points-badge {
    font-weight: var(--font-weight-bold);
    color: var(--cnam-red);
    font-size: 1rem;
}

.challenge-card-body {
    padding: 20px;
    flex: 1;
}

.challenge-title {
    font-family: var(--font-display);
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-dark);
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.challenge-desc {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.challenge-card-bottom {
    padding: 15px 20px;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.challenge-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: #888;
}

.challenge-meta i {
    color: var(--cnam-red);
    margin-right: 4px;
}

.challenge-btn {
    padding: 8px 16px;
    background: var(--cnam-red);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: var(--font-weight-medium);
    transition: all 0.2s;
}

.challenge-btn:hover {
    background: #851225;
    color: white;
}

.challenge-card-new.is-solved .challenge-btn {
    background: #6c757d;
}

.challenge-card-new.is-solved .challenge-btn:hover {
    background: #5a6268;
}

/* --- Filters Active State --- */
.challenges-filters .btn-outline-secondary.active {
    background-color: var(--cnam-red);
    border-color: var(--cnam-red);
    color: white;
}

/* --- Profile Page --- */
.profile-header {
    background: linear-gradient(135deg, var(--cnam-dark) 0%, #1a1d20 100%);
    border-radius: 8px;
    padding: 40px;
    color: white;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: var(--cnam-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-right: 30px;
    flex-shrink: 0;
}

.profile-info h1 {
    font-family: var(--font-display);
    margin: 0 0 5px;
}

.profile-info .profile-email {
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.profile-stat-card {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.profile-stat-card .stat-value {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    display: block;
}

.profile-stat-card .stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 25px;
    margin-bottom: 20px;
}

.profile-section h3 {
    font-family: var(--font-display);
    color: var(--cnam-dark);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cnam-red);
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--cnam-red);
}

.activity-info {
    flex: 1;
}

.activity-info strong {
    color: var(--cnam-dark);
}

.activity-info small {
    color: #888;
}

.activity-points {
    font-weight: var(--font-weight-bold);
    color: var(--cnam-red);
}

/* ====================================
   CHALLENGES SINGLE-PAGE LAYOUT
   ==================================== */

.challenges-page {
    margin: -1rem;
}

.challenges-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

.challenges-header h1 {
    font-family: var(--font-display);
    margin: 0;
    font-size: 1.5rem;
}

.challenges-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--cnam-red);
    color: var(--cnam-red);
}

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

/* Layout principal */
.challenges-layout {
    display: flex;
    min-height: calc(100vh - 200px);
}

/* Sidebar */
.challenges-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #fafafa;
    border-right: 1px solid #eee;
    overflow-y: auto;
    padding: 15px 0;
}

.sidebar-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.sidebar-empty i {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* Category Groups */
.category-group {
    border-bottom: 1px solid #eee;
}

.category-group:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.category-header:hover {
    background: rgba(0,0,0,0.03);
}

.category-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-header-left .category-icon {
    font-size: 1.1rem;
    width: 28px;
    text-align: center;
}

.category-name {
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-dark);
    font-size: 0.95rem;
}

.category-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-count, .category-progress {
    font-size: 0.8rem;
    color: #888;
    background: #eee;
    padding: 2px 8px;
    border-radius: 10px;
}

.category-progress {
    background: #d4edda;
    color: #155724;
}

.category-arrow {
    font-size: 0.7rem;
    color: #aaa;
    transition: transform 0.2s;
}

.category-group.open .category-arrow {
    transform: rotate(180deg);
}

/* Challenge List */
.challenge-list {
    display: none;
    padding-bottom: 5px;
}

.category-group.open .challenge-list {
    display: block;
}

.challenge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 10px 50px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.challenge-item:hover {
    background: rgba(167, 25, 49, 0.05);
}

.challenge-item.active {
    background: rgba(167, 25, 49, 0.1);
    border-left-color: var(--cnam-red);
}

.challenge-item.solved {
    opacity: 0.7;
}

.challenge-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.challenge-item-title {
    font-size: 0.9rem;
    color: var(--cnam-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.challenge-item-meta {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.diff-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.diff-dot.diff-easy { background: #28a745; }
.diff-dot.diff-medium { background: #ffc107; }
.diff-dot.diff-hard { background: #dc3545; }

.solved-icon {
    color: #28a745;
    font-size: 0.9rem;
    margin-left: 8px;
}

/* Zone principale */
.challenges-main {
    flex: 1;
    padding: 24px;
    background: #f5f5f5;
    overflow-y: auto;
}

.no-challenge-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    color: #999;
    text-align: center;
}

.no-challenge-selected i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ddd;
}

.no-challenge-selected h3 {
    color: #666;
    margin-bottom: 10px;
}

.no-challenge-selected p {
    font-size: 0.95rem;
}

/* Challenge Detail */
.challenge-detail {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    max-width: 900px;
}

.challenge-detail .challenge-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 15px;
    padding: 24px;
    border-bottom: 1px solid #eee;
    background: white;
    border-radius: 8px 8px 0 0;
}

.challenge-detail .challenge-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--cnam-dark);
    margin: 0 0 12px;
}

.challenge-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.challenge-badges .points-badge,
.challenge-badges .solves-badge {
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
}

.challenge-badges .points-badge i,
.challenge-badges .solves-badge i {
    margin-right: 4px;
    color: var(--cnam-red);
}

.category-badge {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: white;
}

.solved-status {
    background: #d4edda;
    color: #155724;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: var(--font-weight-semibold);
    font-size: 0.9rem;
}

.solved-status i {
    margin-right: 5px;
}

.challenge-detail .challenge-description {
    padding: 24px;
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

/* Flag Section */
.flag-section {
    padding: 24px;
}

.flag-section h4 {
    color: var(--cnam-dark);
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.flag-form {
    margin-bottom: 15px;
}

.flag-input-wrapper {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.flag-input-wrapper input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-code);
    transition: border-color 0.2s;
}

.flag-input-wrapper input:focus {
    outline: none;
    border-color: var(--cnam-red);
}

.btn-submit {
    padding: 12px 24px;
    background: var(--cnam-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-submit:hover {
    background: #851225;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.flag-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-top: 10px;
    max-width: 500px;
}

.flag-message:empty {
    display: none;
}

.flag-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flag-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-prompt {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 6px;
    border: 1px solid #ffeeba;
}

.login-prompt a {
    color: #856404;
    font-weight: 600;
}

.solved-section {
    background: #f8f9fa;
}

.solved-message {
    background: #d4edda;
    color: #155724;
    padding: 20px;
    border-radius: 6px;
    text-align: center;
    font-size: 1.1rem;
}

.solved-message i {
    font-size: 1.5rem;
    margin-right: 10px;
    color: #28a745;
}

/* Solvers Section */
.solvers-section {
    padding: 24px;
    border-top: 1px solid #eee;
}

.solvers-section h4 {
    color: var(--cnam-dark);
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.solvers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.solver-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
}

.solver-rank {
    color: #888;
    min-width: 30px;
}

.trophy-1 { color: #FFD700; }
.trophy-2 { color: #C0C0C0; }
.trophy-3 { color: #CD7F32; }

.solver-name {
    flex: 1;
    font-weight: var(--font-weight-medium);
    color: var(--cnam-dark);
}

.solver-date {
    color: #888;
    font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .challenges-layout {
        flex-direction: column;
    }

    .challenges-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        max-height: 50vh;
    }

    .challenges-main {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .category-banner {
        flex-direction: column;
        text-align: center;
    }

    .category-banner-stats {
        width: 100%;
        justify-content: center;
    }

    .profile-header .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .profile-avatar {
        margin: 0 auto 20px;
    }

    .challenges-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .flag-input-wrapper {
        flex-direction: column;
    }

    .btn-submit {
        width: 100%;
    }
}

/* ====================================
   CHALLENGES V2 - ACCORDÉONS PAR THÈME
   ==================================== */

.challenges-page-v2 {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.challenges-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.challenges-top-bar h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin: 0;
    color: var(--cnam-dark);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

/* Category Section */
.category-section {
    margin-bottom: 30px;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--cnam-dark) 0%, #1a1d20 100%);
    border-radius: 8px 8px 0 0;
    border-left: 5px solid var(--cnam-red);
    flex-wrap: wrap;
    gap: 10px;
}

.category-section-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-section-info i {
    font-size: 1.5rem;
}

.category-section-info h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: white;
    margin: 0;
}

.category-section-info .category-desc {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.category-section-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-section-stats .progress-text {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
}

/* Challenges Accordion List */
.challenges-accordion-list {
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

/* Challenge Accordion Item */
.challenge-accordion {
    border-bottom: 1px solid #eee;
}

.challenge-accordion:last-child {
    border-bottom: none;
}

.challenge-accordion.is-solved {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.05) 0%, transparent 100%);
}

/* Accordion Header */
.challenge-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.challenge-accordion-header:hover {
    background: rgba(0,0,0,0.02);
}

.challenge-accordion.open .challenge-accordion-header {
    background: rgba(167, 25, 49, 0.05);
    border-bottom: 1px solid #eee;
}

.challenge-accordion-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accordion-arrow {
    color: #999;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.challenge-accordion.open .accordion-arrow {
    transform: rotate(90deg);
}

.challenge-accordion-title {
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-dark);
    font-size: 1rem;
}

.challenge-accordion-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Difficulty Pills */
.diff-pill {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.diff-pill.diff-easy {
    background: #d4edda;
    color: #155724;
}

.diff-pill.diff-medium {
    background: #fff3cd;
    color: #856404;
}

.diff-pill.diff-hard {
    background: #f8d7da;
    color: #721c24;
}

/* Points & Solves Pills */
.points-pill {
    font-weight: var(--font-weight-bold);
    color: var(--cnam-red);
    font-size: 0.85rem;
}

.solves-pill {
    font-size: 0.8rem;
    color: #888;
}

.solves-pill i {
    margin-right: 3px;
}

.solved-check {
    color: #28a745;
    font-size: 1.1rem;
}

/* Accordion Content */
.challenge-accordion-content {
    display: none;
    padding: 20px;
    background: #fafafa;
    border-top: none;
}

.challenge-accordion.open .challenge-accordion-content {
    display: block;
}

/* Description Box */
.challenge-description-box {
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 16px;
    line-height: 1.7;
    color: #444;
}

/* Flag Submit Box */
.flag-submit-box {
    margin-bottom: 16px;
}

.flag-form-inline {
    display: flex;
    gap: 10px;
    max-width: 500px;
}

.flag-form-inline input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: var(--font-code);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.flag-form-inline input[type="text"]:focus {
    outline: none;
    border-color: var(--cnam-red);
}

.btn-flag-submit {
    padding: 10px 20px;
    background: var(--cnam-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-flag-submit:hover {
    background: #851225;
}

.btn-flag-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.flag-result {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    max-width: 500px;
}

.flag-result:empty {
    display: none;
}

.flag-result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flag-result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Login Required */
.login-required {
    background: #fff3cd;
    color: #856404;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #ffeeba;
}

.login-required i {
    margin-right: 8px;
}

.login-required a {
    color: #856404;
    font-weight: var(--font-weight-semibold);
}

/* Already Solved Box */
.already-solved-box {
    background: #d4edda;
    color: #155724;
    padding: 14px 18px;
    border-radius: 6px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 16px;
}

.already-solved-box i {
    margin-right: 8px;
    color: #28a745;
}

/* First Solvers */
.first-solvers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.solvers-label {
    font-size: 0.8rem;
    color: #888;
    margin-right: 5px;
}

.solver-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    background: #f0f0f0;
    color: #555;
}

.solver-badge.solver-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #333;
}

.solver-badge.solver-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #333;
}

.solver-badge.solver-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: white;
}

.solver-more {
    font-size: 0.75rem;
    color: #888;
}

/* Challenges List Rows */
.challenges-list-rows {
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.challenge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.challenge-row:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.challenge-row:hover {
    background: rgba(167, 25, 49, 0.05);
}

.challenge-row.is-solved {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.08) 0%, transparent 100%);
    border-left: 4px solid #28a745;
}

.challenge-row-title {
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-dark);
    font-size: 0.95rem;
}

.challenge-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Responsive for Challenges V2 */
@media (max-width: 768px) {
    .challenges-page-v2 {
        padding: 16px;
    }

    .challenges-top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .category-section-info {
        flex-wrap: wrap;
    }

    .category-section-info .category-desc {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        margin-top: 5px;
    }

    .challenge-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .challenge-row-meta {
        width: 100%;
    }
}

/* ====================================
   CHALLENGE PAGE - DETAIL VIEW
   ==================================== */

.challenge-page {
    background: #f5f5f5;
    min-height: calc(100vh - 150px);
}

/* Hero Header */
.challenge-hero {
    background: linear-gradient(135deg, var(--cat-color, #A71931) 0%, color-mix(in srgb, var(--cat-color, #A71931) 70%, black) 100%);
    padding: 30px 24px;
    color: white;
}

.challenge-hero.is-solved {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.challenge-hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.challenge-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: white;
}

.back-link i {
    margin-right: 6px;
}

.solved-badge-hero {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.solved-badge-hero i {
    margin-right: 6px;
}

.challenge-hero-main {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.challenge-category-icon {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.challenge-category-icon i {
    font-size: 1.8rem;
    color: white;
}

.challenge-hero-info {
    flex: 1;
}

.challenge-category-name {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    display: block;
    margin-bottom: 5px;
}

.challenge-hero-info h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin: 0;
    font-weight: var(--font-weight-bold);
}

.challenge-hero-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.challenge-hero-stats .stat-item {
    text-align: center;
}

.challenge-hero-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
}

.challenge-hero-stats .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.diff-text-easy { color: #90EE90; }
.diff-text-medium { color: #FFD700; }
.diff-text-hard { color: #FF6B6B; }

/* Content Wrapper */
.challenge-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.challenge-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    overflow: hidden;
}

/* Challenge Cards */
.challenge-page .challenge-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: visible;
    height: auto;
    max-height: none;
    display: block;
}

.challenge-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: var(--cnam-dark);
    color: white;
    font-weight: var(--font-weight-semibold);
}

.challenge-card-header i {
    color: var(--cnam-red);
}

.challenge-page .challenge-card-body {
    padding: 24px;
    padding-bottom: 28px;
    height: auto;
    max-height: none;
    overflow: visible;
    display: block;
}

.challenge-card-body.no-padding {
    padding: 0;
}

.challenge-description-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    padding: 5px 0 10px 0;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

/* Code blocks dans la description */
.challenge-description-text code {
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-code);
    font-size: 0.95em;
    color: #c7254e;
}

.challenge-description-text pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 15px 0;
}

.challenge-description-text pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Liens dans la description */
.challenge-description-text a {
    color: var(--cnam-red);
    text-decoration: underline;
}

.challenge-description-text a:hover {
    color: var(--cnam-dark);
}

/* Flag Card */
.flag-card.is-solved .challenge-card-header {
    background: #28a745;
}

.flag-card.is-solved .challenge-card-header i {
    color: white;
}

/* Solution Card */
.solution-content {
    padding: 10px 0;
    line-height: 1.7;
    color: #333;
}

.solution-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.9rem;
    margin: 15px 0;
}

.solution-content code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-code);
    font-size: 0.9em;
    color: #c7254e;
}

.solution-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Success Box */
.success-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #d4edda;
    border-radius: 6px;
}

.success-icon {
    width: 50px;
    height: 50px;
    background: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.success-icon i {
    color: white;
    font-size: 1.5rem;
}

.success-text strong {
    display: block;
    color: #155724;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.success-text p {
    margin: 0;
    color: #155724;
}

.success-text small {
    color: #1e7e34;
}

/* Flag Form */
.flag-form-new {
    width: 100%;
}

.flag-input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
    width: 100%;
}

.flag-input-group:focus-within {
    border-color: var(--cnam-red);
}

.flag-input-icon {
    padding: 0 15px;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    color: #888;
}

.flag-input-new {
    flex: 1;
    padding: 14px;
    border: none;
    font-size: 1rem;
    font-family: var(--font-code);
    min-width: 0;
}

.flag-input-new:focus {
    outline: none;
}

.flag-btn-new {
    padding: 14px 24px;
    background: var(--cnam-red);
    color: white;
    border: none;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.flag-btn-new:hover {
    background: #851225;
}

.flag-feedback {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.flag-feedback i {
    margin-right: 8px;
}

.flag-feedback.success {
    background: #d4edda;
    color: #155724;
}

.flag-feedback.error {
    background: #f8d7da;
    color: #721c24;
}

/* Login Box */
.login-box {
    text-align: center;
    padding: 30px;
    color: #666;
}

.login-box i {
    font-size: 2rem;
    color: #ddd;
    margin-bottom: 15px;
}

.login-box p {
    margin-bottom: 15px;
}

.login-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--cnam-red);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: var(--font-weight-semibold);
}

.login-btn:hover {
    background: #851225;
    color: white;
}

/* Sidebar */
.challenge-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: start;
}

.challenge-sidebar .challenge-card {
    flex-shrink: 0;
}

/* Solvers List */
.solvers-list-new {
    max-height: 400px;
    overflow-y: auto;
}

.solver-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.solver-row:last-child {
    border-bottom: none;
}

.solver-row.top-1 {
    background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, transparent 100%);
}

.solver-row.top-2 {
    background: linear-gradient(90deg, rgba(192,192,192,0.1) 0%, transparent 100%);
}

.solver-row.top-3 {
    background: linear-gradient(90deg, rgba(205,127,50,0.1) 0%, transparent 100%);
}

.solver-rank-new {
    width: 30px;
    text-align: center;
    margin-right: 12px;
}

.solver-rank-new i {
    color: #FFD700;
    font-size: 1.1rem;
}

.solver-rank-new .rank-num {
    color: #888;
    font-weight: var(--font-weight-semibold);
    font-size: 0.9rem;
}

.solver-info-new {
    flex: 1;
}

.solver-username {
    display: block;
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-dark);
    font-size: 0.9rem;
}

.solver-time {
    font-size: 0.75rem;
    color: #888;
}

/* No Solvers */
.no-solvers {
    text-align: center;
    padding: 30px;
    color: #888;
}

.no-solvers i {
    font-size: 2rem;
    color: #ddd;
    margin-bottom: 10px;
}

.no-solvers p {
    margin: 0;
}

.no-solvers small {
    color: #aaa;
}

/* Navigation */
.challenge-nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: var(--cnam-dark);
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: var(--cnam-red);
    color: var(--cnam-red);
}

.nav-btn.next {
    justify-content: flex-end;
    text-align: right;
}

.nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.nav-btn-text small {
    display: block;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-btn-text span {
    font-weight: var(--font-weight-semibold);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .challenge-content-wrapper {
        grid-template-columns: 1fr;
    }

    .challenge-sidebar {
        order: -1;
    }
}

@media (max-width: 600px) {
    .challenge-hero-main {
        flex-direction: column;
        text-align: center;
    }

    .challenge-hero-stats {
        justify-content: center;
    }

    .flag-input-group {
        flex-direction: column;
    }

    .flag-input-icon {
        display: none;
    }

    .flag-btn-new {
        justify-content: center;
    }

    .challenge-nav {
        flex-direction: column;
    }

    .nav-btn.next {
        justify-content: flex-start;
        text-align: left;
    }
}

/* ====================================
   ADMIN PANEL - DESIGN AMÉLIORÉ
   ==================================== */

/* Header Admin avec onglets */
.admin-header-new {
    background: linear-gradient(135deg, #1a1d20 0%, #2c3e50 100%);
    color: white;
    margin-bottom: 0;
}

.admin-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.admin-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-title i {
    color: var(--cnam-red);
}

/* Navigation par onglets */
.admin-nav {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.admin-nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.admin-nav-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-bottom-color: var(--cnam-red);
}

.admin-nav-link i {
    font-size: 0.85rem;
}

.admin-nav-exit {
    margin-left: auto;
    color: rgba(255,255,255,0.5);
}

.admin-nav-exit:hover {
    color: var(--cnam-red);
}

/* Contenu Admin */
.admin-content {
    background: #f5f6fa;
    min-height: calc(100vh - 200px);
    padding: 24px 0;
}

/* Stats Grid améliorée */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.admin-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.admin-stat-icon.users {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
}

.admin-stat-icon.challenges {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.admin-stat-icon.categories {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
}

.admin-stat-icon.solves {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
}

.admin-stat-info {
    flex: 1;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--cnam-dark);
    line-height: 1;
    margin-bottom: 4px;
}

.admin-stat-label {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cards Admin */
.admin-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
    overflow: hidden;
}

.admin-card-header {
    background: var(--cnam-dark);
    color: white;
    padding: 16px 20px;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card-header i {
    color: var(--cnam-red);
}

.admin-card-body {
    padding: 20px;
}

/* Tables Admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #eee;
}

.admin-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: rgba(167, 25, 49, 0.03);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr.current-user {
    background: rgba(167, 25, 49, 0.05);
}

/* Formulaires Admin */
.admin-form-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.admin-form-header {
    background: linear-gradient(135deg, var(--cnam-red) 0%, #851225 100%);
    color: white;
    padding: 16px 20px;
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-form-body {
    padding: 24px;
}

/* Boutons d'action dans les tables */
.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-actions .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Alertes Admin */
.admin-alert {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.admin-alert.danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.admin-alert.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-header-top {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-nav-link {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .admin-nav-exit {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .admin-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-stat-card {
        padding: 16px;
    }

    .admin-stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .admin-stat-value {
        font-size: 1.5rem;
    }
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.editor-toolbar + textarea,
.editor-toolbar ~ textarea {
    border-radius: 0 0 6px 6px !important;
    border-top: none !important;
}

.editor-toolbar .btn {
    padding: 6px 12px;
    font-weight: var(--font-weight-medium);
    border: 1px solid #adb5bd;
    background: white;
}

.editor-toolbar .btn:hover {
    background: var(--cnam-red);
    color: white;
    border-color: var(--cnam-red);
}

.editor-toolbar .btn i {
    font-size: 14px;
}

/* ====================================
   LEARN / PÉDAGOGIE PAGES
   ==================================== */

/* Page Learn - Hero */
.learn-hero {
    background: linear-gradient(135deg, var(--cnam-red) 0%, #851225 100%);
    color: white;
    padding: 50px 24px;
    text-align: center;
    margin-bottom: 30px;
}

.learn-hero h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.learn-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Grille des catégories */
.learn-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 0 0 40px;
}

.learn-category-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.learn-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    text-decoration: none;
    color: inherit;
}

.learn-category-card-header {
    padding: 24px;
    text-align: center;
    color: white;
}

.learn-category-card-header i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.learn-category-card-header h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0;
}

.learn-category-card-body {
    padding: 20px;
}

.learn-category-card-body p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 15px;
}

.learn-category-stats {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
}

.learn-category-stats i {
    color: var(--cnam-red);
    margin-right: 5px;
}

/* Page Learn Category - Détail */
.learn-category-hero {
    padding: 40px 24px;
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.learn-category-hero h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 10px;
}

.learn-category-hero p {
    opacity: 0.9;
    margin: 0;
}

.learn-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow: hidden;
}

.learn-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--cnam-dark);
    color: white;
    font-weight: var(--font-weight-semibold);
}

.learn-section-header i {
    color: var(--cnam-red);
}

.learn-section-body {
    padding: 24px;
    line-height: 1.8;
    color: #444;
}

.learn-section-body ul {
    margin: 15px 0;
    padding-left: 20px;
}

.learn-section-body li {
    margin-bottom: 8px;
}

/* Ressources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.resource-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    border-left: 3px solid var(--cnam-red);
}

.resource-card:hover {
    background: #eef0f2;
    text-decoration: none;
    color: inherit;
}

.resource-icon {
    width: 40px;
    height: 40px;
    background: var(--cnam-red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.resource-info h4 {
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-dark);
    margin: 0 0 4px;
}

.resource-info .resource-meta {
    font-size: 0.8rem;
    color: #888;
}

.resource-level {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    margin-left: 8px;
}

.resource-level.debutant { background: #d4edda; color: #155724; }
.resource-level.intermediaire { background: #fff3cd; color: #856404; }
.resource-level.avance { background: #f8d7da; color: #721c24; }

/* Bouton "En savoir plus" dans challenges */
.btn-learn-more {
    padding: 6px 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: white;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-learn-more:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    text-decoration: none;
}

/* Liste des challenges dans learn-category */
.challenges-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.challenge-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.challenge-preview-item:hover {
    background: #eef0f2;
    text-decoration: none;
}

.challenge-preview-item .difficulty {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: var(--font-weight-semibold);
}

.challenge-preview-item .difficulty.easy { background: #d4edda; color: #155724; }
.challenge-preview-item .difficulty.medium { background: #fff3cd; color: #856404; }
.challenge-preview-item .difficulty.hard { background: #f8d7da; color: #721c24; }

.challenge-preview-item .points {
    margin-left: auto;
    font-weight: var(--font-weight-semibold);
    color: var(--cnam-red);
}

/* Navigation entre catégories */
.learn-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.learn-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: var(--cnam-dark);
    transition: background 0.2s;
}

.learn-nav a:hover {
    background: #eef0f2;
}

/* ====================================
   CLASSES UTILITAIRES TYPOGRAPHIE
   ==================================== */

/* Font Weights */
.fw-light { font-weight: var(--font-weight-light) !important; }
.fw-normal { font-weight: var(--font-weight-normal) !important; }
.fw-medium { font-weight: var(--font-weight-medium) !important; }
.fw-semibold { font-weight: var(--font-weight-semibold) !important; }
.fw-bold { font-weight: var(--font-weight-bold) !important; }

/* Font Families */
.font-primary { font-family: var(--font-primary) !important; }
.font-display { font-family: var(--font-display) !important; }
.font-code { font-family: var(--font-code) !important; }

/* Font Sizes */
.text-xs { font-size: var(--font-size-xs) !important; }
.text-sm { font-size: var(--font-size-sm) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-xl { font-size: var(--font-size-xl) !important; }
.text-2xl { font-size: var(--font-size-2xl) !important; }
.text-3xl { font-size: var(--font-size-3xl) !important; }
.text-4xl { font-size: var(--font-size-4xl) !important; }

/* Line Heights */
.leading-tight { line-height: var(--line-height-tight) !important; }
.leading-normal { line-height: var(--line-height-normal) !important; }
.leading-relaxed { line-height: var(--line-height-relaxed) !important; }

/* ====================================
   TRACKS & LEARNING PATHS
   ==================================== */

/* Cards de parcours - Liste */
.track-card-new {
    height: 100%;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-top: 3px solid var(--cnam-red);
    border-radius: 8px;
    overflow: hidden;
}

.track-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.track-card-new.completed {
    border-top-color: #28a745;
}

.track-card-header {
    background: linear-gradient(135deg, var(--cnam-dark) 0%, #1a1d20 100%);
    color: white;
    padding: 20px;
}

.track-card-title {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    color: white;
    margin: 0;
    font-size: 1.2rem;
}

.track-card-body {
    padding: 20px;
}

.track-card-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Indicateurs visuels d'étapes */
.track-steps-visual {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step-dot.completed {
    background: #28a745;
    color: white;
}

.step-dot-more {
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
}

.track-rewards {
    background: #fff9e6;
    border-left: 3px solid #ffc107;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Détail du parcours - Navigation sticky */
.track-progress-nav {
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 15px 0;
    margin-bottom: 30px;
    z-index: 100;
}

.progress-nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
}

.progress-nav-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    padding: 5px 0;
}

.progress-nav-steps::-webkit-scrollbar {
    height: 4px;
}

.progress-nav-steps::-webkit-scrollbar-thumb {
    background: var(--cnam-red);
    border-radius: 2px;
}

.progress-nav-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.progress-nav-dot:hover {
    background: var(--cnam-red);
    color: white;
    transform: scale(1.1);
}

.progress-nav-dot.completed {
    background: #28a745;
    color: white;
}

.progress-nav-line {
    width: 20px;
    height: 3px;
    background: #e0e0e0;
    flex-shrink: 0;
}

.progress-nav-line.completed {
    background: #28a745;
}

.progress-nav-info {
    font-size: 0.9rem;
    color: #666;
    margin-left: 20px;
    white-space: nowrap;
}

/* Step cards améliorées */
.step-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.step-card:hover {
    border-color: var(--cnam-red);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.step-card.completed {
    border-color: #28a745;
    background: linear-gradient(135deg, #fff 0%, #f0fff4 100%);
}

.step-card.locked {
    opacity: 0.6;
    background: #f8f9fa;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #e0e0e0;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--cnam-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: var(--font-weight-bold);
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(167, 25, 49, 0.3);
}

.step-card.completed .step-number {
    background: #28a745;
    animation: pulse 0.5s ease;
}

.step-card.locked .step-number {
    background: #6c757d;
}

.step-title {
    flex: 1;
}

.step-title h4 {
    margin: 0 0 5px 0;
    color: var(--cnam-dark);
    font-family: var(--font-display);
    font-weight: var(--font-weight-semibold);
    font-size: 1.3rem;
}

.step-points {
    color: var(--cnam-red);
    font-weight: var(--font-weight-semibold);
    font-size: 1rem;
}

.step-body {
    padding: 25px;
}

.step-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #444;
    margin-bottom: 20px;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive design */
@media (max-width: 768px) {
    .track-card-header {
        padding: 15px;
    }

    .track-card-title {
        font-size: 1.1rem;
    }

    .step-header {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .step-title h4 {
        font-size: 1.1rem;
    }

    .progress-nav-steps {
        overflow-x: auto;
        padding: 10px 0;
    }

    .track-steps-visual {
        justify-content: center;
    }
}

/* Filtres et tri */
.tracks-filters .filter-btn {
    transition: all 0.2s ease;
}

.tracks-filters .filter-btn.active {
    background-color: var(--cnam-red);
    color: white;
    border-color: var(--cnam-red);
}

.tracks-filters .filter-btn:hover:not(.active) {
    background-color: #f8f9fa;
}

/* Styles simplifiés pour les cards de parcours */
.track-card-simple {
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.track-card-simple:hover {
    border-color: var(--cnam-red);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.track-card-simple.track-completed {
    border-color: #28a745;
    background: linear-gradient(135deg, #fff 0%, #f0fff4 100%);
}

.track-card-simple .card-title {
    color: var(--cnam-dark);
    font-weight: 600;
}

.track-bonus {
    background: #fff9e6;
    border-left: 3px solid #ffc107;
    padding: 8px 12px;
    border-radius: 4px;
}

.track-meta .progress-bar {
    background-color: var(--cnam-red);
}

/* ========================================
   INDEX V2 STYLES - Modern Commercial Design
   ======================================== */

/* 1. Hero V2 Section */
.hero-v2 {
    position: relative;
    min-height: 75vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #A71931 0%, #851225 50%, #6B0E1D 100%);
    color: white;
    overflow: hidden;
    padding: 80px 0;
}

.hero-v2-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    z-index: 0;
}

.hex-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(30deg, rgba(255,255,255,.05) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.05) 87.5%, rgba(255,255,255,.05)),
        linear-gradient(150deg, rgba(255,255,255,.05) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.05) 87.5%, rgba(255,255,255,.05)),
        linear-gradient(30deg, rgba(255,255,255,.05) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.05) 87.5%, rgba(255,255,255,.05)),
        linear-gradient(150deg, rgba(255,255,255,.05) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,.05) 87.5%, rgba(255,255,255,.05));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(140px);
    }
}

.hero-v2 .container {
    position: relative;
    z-index: 1;
}

.hero-v2-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-v2-title {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
}

.text-highlight {
    position: relative;
    display: inline-block;
}

.text-highlight::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    z-index: -1;
    border-radius: 4px;
}

.hero-v2-subtitle {
    font-size: 1.25rem;
    line-height: 1.8;
    opacity: 0.95;
    margin-bottom: 32px;
    font-weight: 300;
}

.hero-stats-inline {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-stat i {
    font-size: 1.25rem;
    opacity: 0.8;
}

.hero-stat span {
    font-size: 0.95rem;
    font-weight: 500;
}

.hero-v2-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-v2 {
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-v2-primary {
    background: white;
    color: var(--cnam-red);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.btn-v2-primary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: var(--cnam-red);
}

.btn-v2-secondary {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-v2-secondary:hover {
    background: white;
    color: var(--cnam-red);
    transform: translateY(-2px);
}

.shield-graphic {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

.shield-icon {
    font-size: 6rem;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* 2. Social Proof Section */
.social-proof-section {
    background: #f8f9fa;
    padding: 80px 0;
}

.stat-card-v2 {
    background: white;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.stat-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-card-icon {
    font-size: 2.5rem;
    color: var(--cnam-red);
    margin-bottom: 16px;
}

.stat-card-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--cnam-dark);
    line-height: 1;
    margin-bottom: 8px;
    font-family: var(--font-display);
}

.stat-card-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* 3. Features V2 Section */
.features-v2-section {
    padding: 80px 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-badge {
    display: inline-block;
    background: rgba(167, 25, 49, 0.1);
    color: var(--cnam-red);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cnam-dark);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.feature-card-v2 {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 40px 32px;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
}

.feature-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--cnam-red);
}

.feature-card-highlighted {
    border-color: var(--cnam-red);
    background: linear-gradient(135deg, rgba(167, 25, 49, 0.03) 0%, rgba(167, 25, 49, 0.08) 100%);
}

.feature-badge {
    position: absolute;
    top: -12px;
    right: 32px;
    background: var(--cnam-red);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--cnam-red) 0%, #851225 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.feature-icon-wrapper i {
    font-size: 2rem;
    color: white;
}

.feature-card-v2 h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cnam-dark);
    margin-bottom: 16px;
}

.feature-card-v2 p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 24px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.feature-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #555;
}

.feature-list li i {
    color: #28a745;
    font-size: 1rem;
}

.feature-link {
    color: var(--cnam-red);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s ease;
}

.feature-link:hover {
    gap: 12px;
    color: #851225;
}

/* 4. How It Works Section */
.how-it-works-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 80px 0;
    color: white;
}

.how-it-works-section .section-badge {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.how-it-works-section .section-title {
    color: white;
}

.how-it-works-section .section-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

.step-card-v2 {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 40px 28px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
}

.step-card-v2:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
}

.step-number {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--cnam-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(167, 25, 49, 0.4);
}

.step-icon {
    font-size: 3rem;
    color: var(--cnam-red);
    margin: 16px 0 24px 0;
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.step-text {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

/* 5. Trust & Security Section */
.trust-section {
    background: #f8f9fa;
    padding: 80px 0;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.trust-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--cnam-dark);
    margin-bottom: 32px;
}

.trust-features {
    margin-bottom: 32px;
}

.trust-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.trust-feature-icon {
    width: 48px;
    height: 48px;
    background: var(--cnam-red);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trust-feature-icon i {
    font-size: 1.5rem;
    color: white;
}

.trust-feature-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--cnam-dark);
    margin-bottom: 4px;
}

.trust-feature-content p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

.security-badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.security-badge {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.security-badge:hover {
    border-color: #28a745;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.security-badge i {
    font-size: 2rem;
    color: #28a745;
    margin-bottom: 12px;
}

.security-badge h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cnam-dark);
    margin: 0;
}

/* 6. CTA Final Section */
.cta-section-v2 {
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
    padding: 80px 0;
}

.cta-box {
    background: linear-gradient(135deg, var(--cnam-red) 0%, #851225 100%);
    border-radius: 20px;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    box-shadow: 0 16px 48px rgba(167, 25, 49, 0.25);
}

.cta-content {
    flex: 1;
}

.cta-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.cta-text {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.cta-actions {
    flex-shrink: 0;
}

.btn-cta-large {
    padding: 18px 48px;
    font-size: 1.125rem;
    font-weight: 700;
    background: white;
    color: var(--cnam-red);
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-cta-large:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    color: var(--cnam-red);
}

/* 7. Animation Classes */
.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 8. Responsive Breakpoints */

/* Mobile (< 576px) */
@media (max-width: 575.98px) {
    .hero-v2 {
        min-height: auto;
        padding: 60px 0;
    }

    .hero-v2-title {
        font-size: 2rem;
    }

    .hero-v2-subtitle {
        font-size: 1rem;
    }

    .hero-stats-inline {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .hero-v2-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-v2 {
        width: 100%;
        justify-content: center;
    }

    .shield-graphic {
        width: 80px;
        height: 80px;
    }

    .shield-icon {
        font-size: 4rem;
    }

    .social-proof-section,
    .features-v2-section,
    .how-it-works-section,
    .trust-section,
    .cta-section-v2 {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .stat-card-number {
        font-size: 2.25rem;
    }

    .feature-card-v2,
    .step-card-v2 {
        margin-bottom: 24px;
    }

    .cta-box {
        flex-direction: column;
        padding: 40px 24px;
        text-align: center;
    }

    .cta-title {
        font-size: 1.75rem;
    }

    .cta-text {
        font-size: 1rem;
    }

    .btn-cta-large {
        width: 100%;
        justify-content: center;
    }

    .security-badges-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet (576px - 991px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .hero-v2-title {
        font-size: 2.75rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .cta-box {
        flex-direction: column;
        text-align: center;
        padding: 50px 40px;
    }

    .cta-title {
        font-size: 2rem;
    }
}

/* Desktop adjustments */
@media (min-width: 992px) {
    .feature-card-v2 {
        min-height: 480px;
    }
}

/* ====================================
   RESPONSIVE — AMÉLIORATIONS GLOBALES
   ==================================== */

/* --- Mobile (< 768px) --- */
@media (max-width: 767.98px) {

    /* Navigation */
    .navbar-toggler {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }

    .navbar-nav .nav-link {
        margin-left: 0;
        padding: 10px 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid #f0f0f0;
    }

    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }

    /* Hero section */
    .hero-section {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    /* Page header */
    .page-header {
        padding: 20px 0;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    /* Challenges filters — défilement horizontal */
    .challenges-filters-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .challenges-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .challenges-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 36px;
    }

    /* Challenges page v2 */
    .challenges-page-v2 {
        padding: 12px;
    }

    .challenges-top-bar {
        margin-bottom: 16px;
    }

    .challenges-top-bar h1 {
        font-size: 1.3rem;
    }

    .category-section-header {
        padding: 12px 16px;
    }

    .category-section-info h2 {
        font-size: 1.1rem;
    }

    /* Accordion challenges: compact */
    .challenge-accordion-header {
        padding: 12px 16px;
    }

    .challenge-accordion-right .diff-pill {
        display: none;
    }

    /* Challenge detail page */
    .challenge-hero {
        padding: 20px 16px;
    }

    .challenge-hero-info h1 {
        font-size: 1.3rem;
    }

    .challenge-content-wrapper {
        padding: 12px;
        gap: 16px;
    }

    .challenge-page .challenge-card-body {
        padding: 16px;
    }

    /* Learn / Resources */
    .learn-hero {
        padding: 30px 16px;
    }

    .learn-hero h1 {
        font-size: 1.5rem;
    }

    .learn-hero p {
        font-size: 0.95rem;
    }

    /* Learn sections: scroll horizontal pour les tableaux */
    .learn-section {
        overflow: visible;
    }

    .learn-section-header {
        border-radius: 8px 8px 0 0;
        overflow: hidden;
    }

    .learn-section-body {
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Category banner */
    .category-banner {
        padding: 20px;
        gap: 16px;
    }

    .category-banner-icon {
        width: 56px;
        height: 56px;
    }

    .category-banner-icon i {
        font-size: 1.8rem;
    }

    .category-banner-title {
        font-size: 1.3rem;
    }

    .category-banner-stats {
        gap: 10px;
    }

    .cat-stat {
        padding: 8px 12px;
        min-width: 60px;
    }

    .cat-stat-value {
        font-size: 1.2rem;
    }

    /* Profile */
    .profile-header {
        padding: 20px;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
        margin-right: 16px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-top: 16px;
    }

    /* Footer */
    footer {
        padding: 24px 0;
        text-align: center;
    }

    footer .row > div {
        margin-bottom: 20px;
    }

    footer .row > div:last-child {
        margin-bottom: 0;
    }

    /* Btn touch targets */
    .btn-cnam,
    .btn-outline-cnam {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* --- Tablette (768px – 991px) --- */
@media (min-width: 768px) and (max-width: 991.98px) {

    /* Nav compacte pour tenir sur tablette */
    .nav-link {
        margin-left: 6px;
        font-size: 0.82rem;
        padding-left: 4px;
        padding-right: 4px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-section {
        padding: 50px 0;
    }

    .page-header {
        padding: 28px 0;
    }

    .challenge-content-wrapper {
        padding: 16px;
    }

    .challenges-page-v2 {
        padding: 16px;
    }

    /* Filters container: reduce gap */
    .challenges-filters-container {
        gap: 1rem;
    }
}

/* --- Très petits écrans (< 400px) --- */
@media (max-width: 399.98px) {

    .hero-title {
        font-size: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .challenge-hero-info h1 {
        font-size: 1.1rem;
    }

    .challenge-hero-stats {
        gap: 16px;
    }

    .challenge-hero-stats .stat-value {
        font-size: 1.2rem;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
}
