/**
 * ================================================================
 * GRC FORGE - DESIGN SYSTEM UNIFIÉ
 * ================================================================
 * Version: 2.0.0 - Light Premium Edition
 * 
 * Système de design cohérent pour toute la plateforme :
 * - Landing page (index.php)
 * - Application (dashboard, modules, etc.)
 * - Pages d'authentification
 * 
 * Philosophie : Light mode premium, sidebar dark, Poppins font
 * Palette : edu_meeting (#f5a425 gold, #1f272b dark) + logo blue
 * ================================================================
 */

/* All CSS custom properties are now in tokens.css (single source of truth). */
@import url('tokens.css');

/* ========================================
   RESET & BASE
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHIE
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-3xl); }
h4 { font-size: var(--font-size-2xl); }
h5 { font-size: var(--font-size-xl); }
h6 { font-size: var(--font-size-lg); }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--accent-blue-dark);
}

/* ========================================
   BOUTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: var(--transition-all);
    text-decoration: none;
    white-space: nowrap;
}

/* Bouton primaire (orange) */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-orange-dark) 0%, #c2410c 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Bouton secondaire */
.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--border-primary);
    border-color: var(--accent-orange);
    box-shadow: var(--glass-shadow);
}

/* Bouton outline */
.btn-outline {
    background: transparent;
    color: var(--accent-orange);
    border: 2px solid var(--accent-orange);
}

.btn-outline:hover {
    background: var(--accent-orange);
    color: white;
}

/* Bouton ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
}

/* Variantes de couleur */
.btn-success {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-dark) 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    color: white;
}

.btn-purple {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple-dark) 100%);
    color: white;
}

/* Tailles */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
}

/* ========================================
   CARDS (Light)
   ======================================== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--glass-shadow);
    transition: var(--transition-all);
}

.card:hover {
    box-shadow: var(--glass-shadow-hover);
    transform: translateY(-4px);
    border-color: var(--border-accent);
}

.card-solid {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-secondary);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    background: var(--grc-sidebar-bg);
    border-right: none;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.65);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    margin-bottom: 0.25rem;
    transition: var(--transition-base);
    cursor: pointer;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    border-left-color: var(--accent-orange);
}

.sidebar-item.active {
    background: rgba(245, 164, 37, 0.15);
    color: #ffffff;
    border-left-color: var(--accent-orange);
}

/* ========================================
   INPUTS & FORMS
   ======================================== */
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.input::placeholder {
    color: var(--text-muted);
}

textarea.input {
    resize: vertical;
    min-height: 100px;
}

.label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-orange {
    background: rgba(245, 164, 37, 0.12);
    color: var(--accent-orange-dark);
    border: 1px solid var(--accent-orange);
}

.badge-green {
    background: rgba(57, 203, 127, 0.12);
    color: var(--accent-green-dark);
    border: 1px solid var(--accent-green);
}

.badge-blue {
    background: rgba(30, 108, 183, 0.10);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.badge-purple {
    background: rgba(116, 96, 238, 0.10);
    color: var(--accent-purple);
    border: 1px solid var(--accent-purple);
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--border-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-orange-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-bar-green {
    background: linear-gradient(90deg, var(--accent-green) 0%, #4ade80 100%);
}

.progress-bar-blue {
    background: linear-gradient(90deg, var(--accent-blue) 0%, #60a5fa 100%);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-orange { color: var(--accent-orange); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.bg-glass { background: var(--bg-secondary); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--border-primary); }
.border-accent { border: 1px solid var(--accent-orange); }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }
    
    .card {
        padding: var(--spacing-lg);
    }

    .btn {
        padding: 0.65rem 1.25rem;
        font-size: var(--font-size-sm);
    }
}

@media (max-width: 480px) {
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }

    .card {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: var(--font-size-sm);
        width: 100%;
    }
}


/* ========================================
   MICRO-INTERACTION PATTERNS
   Reusable interaction primitives for
   progressive disclosure, panels & stagger.
   ======================================== */

/* ── Pattern 1: grc-reveal (Progressive Disclosure) ──
   Usage: <div class="grc-reveal">
            <button class="grc-reveal-trigger">Show more</button>
            <div class="grc-reveal-content">…hidden content…</div>
          </div>
   Toggle .open on .grc-reveal via JS click on trigger.
   ───────────────────────────────────────────────────── */
.grc-reveal-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s ease;
}
.grc-reveal.open .grc-reveal-content {
    max-height: 2000px;
    opacity: 1;
}
.grc-reveal-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-blue);
    background: none;
    border: none;
    padding: 6px 0;
    transition: color 0.2s, gap 0.2s;
}
.grc-reveal-trigger:hover {
    color: var(--accent-blue-dark);
    gap: 10px;
}
.grc-reveal-trigger .grc-reveal-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}
.grc-reveal.open .grc-reveal-trigger .grc-reveal-icon {
    transform: rotate(180deg);
}

/* ── Pattern 2: grc-slide-panel (Drawer / Side Panel) ──
   Usage: <div class="grc-slide-panel grc-slide-panel--right">…</div>
   Toggle .active via JS. Comes from right by default.
   ──────────────────────────────────────────────────────── */
.grc-slide-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(420px, 90vw);
    background: var(--bg-secondary);
    box-shadow: -8px 0 40px rgba(1,102,163,0.12);
    z-index: 1100;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.25s ease;
    overflow-y: auto;
    padding: 24px;
}
.grc-slide-panel--right { right: 0; }
.grc-slide-panel--left  { left: 0; transform: translateX(-100%); }
.grc-slide-panel.active {
    transform: translateX(0);
    opacity: 1;
}
.grc-slide-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.grc-slide-panel-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Pattern 3: grc-stagger (Scroll-triggered fade-in) ──
   Usage: Add .grc-stagger to any element. JS adds .grc-visible
   when it enters the viewport. Stagger delay via CSS variable
   --stagger-delay or nth-child.
   ────────────────────────────────────────────────────────── */
.grc-stagger {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease-out,
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: var(--stagger-delay, 0ms);
}
.grc-stagger.grc-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Automatic stagger delays for grid children */
.grc-stagger-parent > .grc-stagger:nth-child(1) { --stagger-delay: 0ms; }
.grc-stagger-parent > .grc-stagger:nth-child(2) { --stagger-delay: 80ms; }
.grc-stagger-parent > .grc-stagger:nth-child(3) { --stagger-delay: 160ms; }
.grc-stagger-parent > .grc-stagger:nth-child(4) { --stagger-delay: 240ms; }
.grc-stagger-parent > .grc-stagger:nth-child(5) { --stagger-delay: 320ms; }
.grc-stagger-parent > .grc-stagger:nth-child(6) { --stagger-delay: 400ms; }

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .grc-stagger {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .grc-reveal-content {
        transition: none;
    }
    .grc-slide-panel {
        transition: none;
    }
}
