/* ============= VARIABLES GLOBALES ============= */
:root {
    --primary-color: #312e81;
    /* Muted Deep Indigo */
    --secondary-color: #4c1d95;
    /* Deep Muted Violet */
    --success-color: #059669;
    /* Emerald-600 */
    --warning-color: #d97706;
    /* Amber-600 */
    --danger-color: #dc2626;
    /* Red-600 */
    --dark-color: #334155;
    /* Slate-700 - Muted Text */
    --light-color: #f8fafc;
    /* Slate-50 - Professional Background */
    --border-color: #e2e8f0;
    /* Slate-200 - Subtle Border */
    --card-bg: #ffffff;
    /* White */

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ============= RESET & TYPO ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--dark-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ============= BOUTONS ============= */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.btn:hover {
    color: #cbd5e1 !important;
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    color: #cbd5e1 !important;
}

.btn-secondary {
    background-color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #111827;
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--primary-color);
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-bottom: 1rem;
}

.btn-back:hover {
    color: var(--secondary-color);
}

/* ============= CARTES ============= */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* ============= ENTRÉES DE FORMULAIRE ============= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* ============= BADGES & ÉTIQUETTES ============= */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background-color: var(--light-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ============= CONTENEURS ============= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============= UTILITAIRES ============= */
.section-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.error {
    color: var(--danger-color);
    padding: 1rem;
    background-color: #fee2e2;
    border-left: 4px solid var(--danger-color);
    border-radius: var(--radius-md);
}

.success {
    color: var(--success-color);
    padding: 1rem;
    background-color: #ecfdf5;
    border-left: 4px solid var(--success-color);
    border-radius: var(--radius-md);
}

.warning {
    color: var(--warning-color);
    padding: 1rem;
    background-color: #fffbeb;
    border-left: 4px solid var(--warning-color);
    border-radius: var(--radius-md);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* ============= TUTORIAL IMAGES ============= */
.tutorial-gif {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    display: block;
    margin: 0.5rem auto;
    box-shadow: var(--shadow-sm);
}

.visual-container {
    text-align: center;
    width: 100%;
    margin: 1rem 0;
}
/* markdown-video support */
.markdown-video {
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #000;
}

.markdown-video iframe, 
.markdown-video video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Markdown specific styles */
.markdown h1 {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.markdown h2 {
    margin-top: 1.8rem;
    margin-bottom: 1.2rem;
    font-size: 1.75rem;
    color: var(--secondary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.4rem;
}

.markdown h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--dark-color);
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.3rem;
}

.markdown ul, .markdown ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown li {
    margin-bottom: 0.5rem;
}

.markdown blockquote {
    border-left: 4px solid var(--primary-color);
    background: #f1f5f9;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.markdown img.tutorial-gif {
    margin: 1.5rem auto;
}
