*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

:root {
    --bg-color: #f6f7fb;
    --surface-color: #ffffff;
    --surface-muted: #f0f4ff;
    --text-color: #1d2433;
    --text-muted: #6b7280;
    --primary: #1f5bd6;
    --primary-600: #1b46a1;
    --accent: #10b981;
    --border-color: #e2e8f0;
    --brand-gradient: linear-gradient(135deg, #0f172a 0%, #1b3a8a 60%, #1b5e7a 100%);
    --brand-soft: rgba(31, 91, 214, 0.12);
    --brand-outline: rgba(31, 91, 214, 0.25);
    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.14);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-display: 'Sora', 'Inter', 'Segoe UI', sans-serif;
}

body.dark-mode {
    --bg-color: #0f172a;
    --surface-color: #111827;
    --surface-muted: #182235;
    --text-color: #e5e7eb;
    --text-muted: #9ca3af;
    --primary: #7aa2ff;
    --primary-600: #5a7be0;
    --accent: #34d399;
    --border-color: #273043;
    --brand-gradient: linear-gradient(135deg, #0b1224 0%, #1a2f6b 60%, #14506b 100%);
    --brand-soft: rgba(122, 162, 255, 0.16);
    --brand-outline: rgba(122, 162, 255, 0.28);
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.35);
    --shadow-md: 0 22px 50px rgba(15, 23, 42, 0.45);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(31, 91, 214, 0.12), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(16, 185, 129, 0.12), transparent 40%),
        repeating-linear-gradient(135deg,
            rgba(15, 23, 42, 0.06),
            rgba(15, 23, 42, 0.06) 1px,
            transparent 1px,
            transparent 5px),
        linear-gradient(180deg, rgba(31, 91, 214, 0.03), rgba(16, 185, 129, 0.02));
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg,
            rgba(15, 23, 42, 0.05),
            rgba(15, 23, 42, 0.05) 1px,
            transparent 1px,
            transparent 3px);
    mix-blend-mode: multiply;
    opacity: 0.35;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

main.main-content {
    background-color: var(--bg-color);
}

header {
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.25), transparent 55%),
        var(--brand-gradient);
    color: #fff;
    position: relative;
    overflow: hidden;
}

header::after {
    content: "";
    position: absolute;
    top: -20%;
    right: -30%;
    width: 65%;
    height: 140%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 70%);
    pointer-events: none;
    opacity: 0.6;
}

.navbar {
    background: transparent;
    padding: 1.5rem 0;
}

.navbar-brand {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    color: var(--accent);
}

.brand-name {
    display: inline-flex;
    align-items: center;
}

.brand-logo-image {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    margin-left: 0.5rem;
}

.nav-link:hover {
    color: #fff;
}

.theme-toggle-container {
    position: absolute;
    right: 24px;
    top: 24px;
    z-index: 2;
}

#theme-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #fff;
    font-size: 1.2rem;
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hero {
    padding: 4rem 0 6rem;
}

.hero-content {
    max-width: 720px;
    text-align: left;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
    padding-left: 1.5rem;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    font-weight: 700;
    font-family: var(--font-display);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
}

.hero-signature {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    transition: box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #2a8bf2);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), #1e6bd6);
    border-color: var(--primary-600);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--brand-soft);
    color: var(--primary-600);
}

.btn-secondary {
    background: var(--surface-muted);
    border-color: var(--surface-muted);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--surface-color);
    border-color: var(--surface-color);
}

.section {
    padding: 4.5rem 0;
}

.section-muted {
    background: linear-gradient(180deg, rgba(31, 91, 214, 0.05), rgba(16, 185, 129, 0.04));
}

.section-heading {
    max-width: 720px;
    margin: 0 auto 2.5rem;
    text-align: center;
}

.section-heading h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.section-heading h2::after {
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin: 0.75rem auto 0;
    background: var(--brand-outline);
    border-radius: 999px;
}

.section-lead {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 2px;
    background: var(--primary);
    border-radius: 999px;
}

.stats-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.signature-strip {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.signature-pill {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.signature-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
    margin-right: 0.45rem;
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: left;
}

.stat-card span {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-card p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.service-card,
.formation-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-card.featured {
    border: 2px solid var(--brand-outline);
    box-shadow: var(--shadow-md);
}

.service-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.service-meta {
    color: var(--text-muted);
    font-weight: 500;
}

.formation-card h3,
.service-card h3 {
    font-size: 1.35rem;
    font-weight: 600;
}

.formation-card p,
.service-card p {
    color: var(--text-muted);
}

.site-footer {
    background: #0f172a;
    color: #cbd5f5;
    padding: 2.5rem 0;
}

.footer-brand {
    max-width: 280px;
}

.footer-logo {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
}

.footer-tagline {
    color: rgba(203, 213, 245, 0.8);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.footer-logo-image {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.footer-content a {
    color: #cbd5f5;
    margin-right: 1rem;
    font-weight: 500;
}

.footer-content a:hover {
    color: #fff;
}

.contact-info a {
    color: #fff;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-family: var(--font-display);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge-soft {
    background: var(--brand-soft);
    color: var(--primary);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
}

.auth-section {
    display: flex;
    align-items: center;
}

.auth-card {
    max-width: 520px;
    margin: 0 auto;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.auth-header {
    margin-bottom: 2rem;
    text-align: left;
}

.auth-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.auth-subtitle {
    color: var(--text-muted);
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    font-size: 0.95rem;
}

.auth-links a {
    color: var(--primary);
    font-weight: 500;
}

.form-stack {
    display: grid;
    gap: 1.2rem;
}

.form-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.form-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.table-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-pill.is-success {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.status-pill.is-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.dashboard-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.dashboard-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--brand-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.session-list .session-item {
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    background: var(--surface-muted);
}

form .form-control,
form .form-select,
form textarea,
form input {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
}

form .form-label {
    font-weight: 600;
    color: var(--text-color);
}

form .form-check-input {
    border-color: var(--border-color);
}

form .form-check-label {
    color: var(--text-muted);
}

.modal-content {
    background-color: var(--surface-color);
    color: var(--text-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.modal-header,
.modal-footer {
    border-color: var(--border-color);
}

.table th,
.table td {
    background-color: var(--surface-color);
    color: var(--text-color);
}

@media (max-width: 768px) {
    .hero-content {
        text-align: center;
        margin: 0 auto;
    }

    .hero-actions {
        justify-content: center;
    }

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