/* ============================================================
   BASE — Variables, Reset, Typographie, Éléments communs
   ============================================================ */

/* --- Variables --- */
:root {
    --primary: #3a56d4;
    --primary-dark: #1e2a45;
    --secondary: #e74c4c;
    --text-dark: #222;
    --text-light: #f8f9fa;
    --text-muted: #6c757d;
    --bg-light: #ffffff;
    --bg-dark: #f8f9fa;
    --bg-card: #f8f9fa;
    --bg-card-dark: #f0f0f0;
    --border-color: #dee2e6;
    --success: #28a745;

    --font-family: "Poppins", sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height: 1.6;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --section-spacing: 5rem;

    --container-width: 1200px;
    --border-radius-sm: 0.25rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-md: 0 8px 12px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --bg-card-transparent: rgba(248, 249, 250, 0.65);
    --bg-navbar: rgba(255, 255, 255, 0.75);
}

/* --- Mode sombre (classe .light-mode = dark UI) --- */
.light-mode {
    --primary: #6d8dff;
    --primary-dark: #384766;
    --secondary: #ff8585;
    --text-dark: #f8f9fa;
    --text-light: #121212;
    --text-muted: #adb5bd;
    --bg-light: #121212;
    --bg-dark: #0a0a0a;
    --bg-card: #1e1e1e;
    --bg-card-dark: #2d2d2d;
    --border-color: #2d2d2d;
    --bg-card-transparent: rgba(10, 10, 10, 0.65);
    --bg-navbar: rgba(18, 18, 18, 0.75);
}

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

html {
    font-size: 1rem;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    color-scheme: light;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-dark);
    background-color: var(--bg-light);
    overflow-x: hidden;
    transition: var(--transition);
    opacity: 1;
}

body.loaded {
    opacity: 1;
}

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

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary);
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: var(--font-family);
    border: none;
    background: none;
}

p {
    text-align: justify;
}

/* --- Utilitaires --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* --- Sections --- */
.section {
    padding: var(--section-spacing) 0;
    position: relative;
}

.section-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-2xl);
    position: relative;
    display: inline-block;
    color: var(--primary);
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 3px;
    background-color: var(--secondary);
    transition: var(--transition);
}

.section:hover .section-title::after {
    width: 100%;
}

.section-title i {
    margin-left: var(--spacing-sm);
    color: var(--primary);
}

.section-intro {
    font-size: var(--font-size-lg);
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--spacing-2xl);
    line-height: 1.7;
    font-weight: var(--font-weight-semibold);
}

/* --- Boutons --- */
.btn {
    display: inline-block;
    padding: 1rem 0.75rem;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-medium);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--box-shadow);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}

/* --- Accessibilité --- */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
    outline: 2px solid var(--secondary);
    border-radius: 5px;
    outline-offset: 2px;
}

/* --- Animations réduites --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Breakpoints base --- */
@media (max-width: 992px) {
    :root {
        --section-spacing: 4rem;
    }
}

@media (max-width: 768px) {
    :root {
        --section-spacing: 3rem;
        --font-size-3xl: 2rem;
        --font-size-2xl: 1.75rem;
        --font-size-xl: 1.25rem;
    }
}

@media (max-width: 480px) {
    :root {
        --section-spacing: 2rem;
        --font-size-base: 0.875rem;
    }
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}
