/* ============================================================
   G.I. (Groupes d'Intérêts) — Design System
   Thème sombre, sobre et moderne
   ============================================================ */

/* ---- Variables & Thèmes ---- */
:root {
    /* Palette principale */
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-input: #1a1a2e;
    --bg-hover: #1f1f35;

    /* Texte */
    --text-primary: #e8e8f0;
    --text-secondary: #9090a8;
    --text-muted: #606078;

    /* Accents */
    --accent-primary: #6d28d9;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(109, 40, 217, 0.3);
    --accent-gradient: linear-gradient(135deg, #6d28d9, #8b5cf6);

    /* États */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Bordures */
    --border-primary: #1e1e32;
    --border-hover: #2a2a45;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 0 20px var(--accent-glow);

    /* Typographie */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Rayons */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #a78bfa;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Container ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Header / Navigation ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
}

.logo:hover {
    color: var(--text-primary);
}

.logo-icon {
    font-size: 24px;
    color: var(--accent-secondary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-user {
    color: var(--accent-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ---- Boutons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1;
}

.btn:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px var(--accent-glow);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-outline:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    background: rgba(109, 40, 217, 0.05);
}

.btn-full {
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ---- Page d'authentification (login/register) ---- */
.auth-page,
.dashboard-page {
    padding-top: 64px;
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(ellipse at 50% 0%, rgba(109, 40, 217, 0.08) 0%, transparent 60%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}

.auth-logo:hover {
    color: var(--text-primary);
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-success {
    text-align: center;
    padding: 20px 0;
}

.auth-success h2 {
    margin: 16px 0 8px;
    font-size: 20px;
}

.auth-success p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
}

.success-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.success-icon.error {
    background: var(--error-bg);
    color: var(--error);
}

/* ---- Alertes ---- */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.alert p + p {
    margin-top: 4px;
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* ---- Formulaire ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    transition: all var(--transition-fast);
    outline: none;
}

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

.form-group input:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 30px var(--bg-input) inset !important;
    transition: background-color 9999s ease-in-out 0s;
}

/* ---- Password wrapper ---- */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.password-toggle:hover {
    opacity: 1;
}

.eye-icon {
    font-size: 16px;
}

/* ---- Password requirements ---- */
.password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.req {
    font-size: 11px;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-fast);
}

.req.valid {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
    background: var(--success-bg);
}

.req.invalid {
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.3);
    background: var(--error-bg);
}

/* ---- Auth footer ---- */
.auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-footer-text a {
    color: var(--accent-secondary);
    font-weight: 600;
}

/* ============================================================
   PAGE D'ACCUEIL (Home)
   ============================================================ */
.home-page {
    background: var(--bg-primary);
}

/* ---- Hero ---- */
.hero {
    padding: 140px 0 100px;
    position: relative;
    overflow: hidden;
}

.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(1px 1px at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 70%, rgba(109, 40, 217, 0.1) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 80%, rgba(109, 40, 217, 0.08) 0%, transparent 100%);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-glow);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, #6d28d9, #a78bfa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---- Hero Stats ---- */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 800px;
    margin: 80px auto 0;
    position: relative;
    z-index: 1;
}

.stat-card {
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Features Section ---- */
.features {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

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

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    transition: all var(--transition-base);
}

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

.feature-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ---- Dashboard ---- */
.dashboard-header {
    padding: 40px 0;
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding-bottom: 80px;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-primary);
}

.card-icon {
    font-size: 20px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

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

.card-body p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-primary);
}

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

.info-label {
    font-size: 13px;
    color: var(--text-muted);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

.security-list {
    list-style: none;
    margin-top: 12px;
}

.security-list li {
    font-size: 13px;
    color: var(--success);
    padding: 4px 0;
}

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--border-primary);
    padding: 32px 0;
    position: relative;
    z-index: 1;
}

.footer-content {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 13px;
}

/* ---- Animations ---- */
.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in-delayed {
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.fade-in-more {
    animation: fadeInUp 0.6s ease 0.4s forwards;
    opacity: 0;
}

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

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Tablettes */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 48px;
    }

    .features {
        padding: 60px 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .dashboard-header {
        padding: 24px 0;
    }

    .dashboard-header h1 {
        font-size: 24px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .nav {
        height: 56px;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-user {
        display: none;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }
}

/* Très petits écrans */
@media (max-width: 400px) {
    .auth-card {
        padding: 20px 16px;
    }

    .hero-title {
        font-size: 28px;
    }
}

/* ---- Pages internes (Documentation, Liste G.I.) ---- */
.page-section {
    padding: 140px 0 80px;
    position: relative;
    z-index: 1;
    min-height: 60vh;
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.doc-content,
.gi-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    transition: all var(--transition-base);
}

.doc-card:hover {
    border-color: var(--accent-secondary);
    box-shadow: var(--shadow-accent);
}

.doc-card h2,
.doc-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.doc-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.doc-card a {
    color: var(--accent-secondary);
    font-weight: 500;
}

.doc-card a:hover {
    color: #a78bfa;
}

/* ---- Responsive pages internes ---- */
@media (max-width: 768px) {
    .page-section {
        padding: 100px 0 60px;
    }

    .page-header {
        margin-bottom: 32px;
    }

    .page-header h1 {
        font-size: 28px;
    }
}
