/* ============================================
   CETEMOH - Design System (sans Bootstrap)
   Site public
   ============================================ */

:root {
    /* Palette Skyline Arctique : 5 tons blue/navy */
    --sky-900: #0f172a;
    --blue-900: #1e3a8a;
    --blue-600: #2563eb;
    --blue-400: #60a5fa;
    --sky-100: #e0f2fe;

    /* Palette : 1 accent bleu profond + neutres harmonieux */
    --primary: #0f3d5e;
    --primary-dark: #0a2c44;
    --primary-light: #2563eb;
    --accent: #d97706;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0ea5e9;

    /* Dégradé signature Skyline Arctique (zones hero/bannières/en-têtes) */
    --grad-skyline: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #60a5fa 100%);
    --grad-skyline-deep: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #2563eb 100%);

    /* Neutres */
    --bg: #f6f7f9;
    --bg-white: #ffffff;
    --text: #1a2332;
    --text-muted: #5b6b7c;

    /* Bordures & surfaces */
    --border: #e2e8f0;
    --border-soft: #eef1f5;

    /* Rayons & ombres (douces, diffuses) */
    --radius: 10px;
    --radius-lg: 18px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 24px 48px rgba(16, 24, 40, 0.12);

    --ring: rgba(37, 99, 235, 0.28);

    /* Typographie : pile systeme moderne (SF Pro / Inter / Roboto) */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 70px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='96' viewBox='0 0 84 96'%3E%3Cpath d='M42 2l36 21v42L42 86 6 65V23z' fill='none' stroke='%2394a3b8' stroke-width='.7' opacity='.18'/%3E%3Cpath d='M0 50l36 21v42L0 134l-36-21V71z' fill='none' stroke='%2394a3b8' stroke-width='.7' opacity='.18'/%3E%3Cpath d='M84 50l36 21v42L84 134l-36-21V71z' fill='none' stroke='%2394a3b8' stroke-width='.7' opacity='.18'/%3E%3C/svg%3E");
    background-size: 84px 96px;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--blue-600);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--blue-900);
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-sm {
    max-width: 800px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col {
    flex: 1;
    padding: 0 0.75rem;
}

.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 0.75rem; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 0.75rem; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 0.75rem; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; padding: 0 0.75rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 0.75rem; }

/* Eviter que le min-content d'un enfant (tableau, image large) n'etire la
   grille et ne force le scroll horizontal de la page. */
.row > [class*="col-"] {
    min-width: 0;
}

main {
    flex: 1;
}

.section {
    padding: 4rem 0;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--blue-900);
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 56px;
    height: 4px;
    margin: 0.85rem auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.me-1 { margin-right: 0.5rem; }

/* --- Navbar --- */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blue-900);
}

.navbar-brand img {
    height: 45px;
    width: auto;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.navbar-nav a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    font-weight: 500;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: var(--blue-900);
    color: #fff;
}

.nav-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
}

.nav-avatar:hover,
.nav-avatar.active {
    background: transparent !important;
    color: var(--primary) !important;
}

.nav-avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.nav-avatar-name {
    font-size: 0.9rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: var(--transition);
}

/* --- Hero --- */
.hero {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.94), rgba(15, 23, 42, 0.9)),
                url('../images/campus/canaan.jpg') center/cover no-repeat;
    color: #fff;
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero .lead {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.campus-badges {
    margin-top: 2.5rem;
}

.campus-badges p {
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.4rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    font-family: inherit;
    line-height: 1.4;
}

.btn {
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn:focus-visible,
.form-control:focus-visible,
.navbar-nav a:focus-visible,
.pagination a:focus-visible,
.slideshow-arrow:focus-visible,
.slideshow-dot:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ring);
}

.btn-primary {
    background: var(--blue-600);
    color: #fff;
    border-color: var(--blue-600);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.btn-primary:hover {
    background: var(--blue-900);
    border-color: var(--blue-900);
    color: #fff;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-outline:hover {
    background: #fff;
    color: var(--blue-900);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--text-muted);
    color: #fff;
    border-color: var(--text-muted);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.btn-secondary:hover {
    background: #5a6b7e;
    border-color: #5a6b7e;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #a93226;
    border-color: #a93226;
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
}

.btn-loading::after {
    content: '';
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-left: 0.6em;
    vertical-align: -0.15em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinnerspin 0.7s linear infinite;
}

@keyframes spinnerspin {
    to { transform: rotate(360deg); }
}

.btn .btn-icon {
    transition: transform var(--transition);
}

.btn:hover:not(.btn-loading) .btn-icon {
    transform: translateX(2px);
}

/* --- Cards --- */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.2);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--border);
}

/* Visuel de secours propre quand une actualite/evenement n'a pas d'image.
   Utilise un simple degradé doux + pictogramme centré, sans emoji inline. */
.card-img-fallback {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-skyline);
    color: rgba(255, 255, 255, 0.9);
    font-size: 2.5rem;
    line-height: 1;
}

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--blue-900);
    margin-bottom: 0.5rem;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.card-text {
    flex: 1;
    margin-bottom: 1rem;
    color: var(--text);
}

/* --- Badge --- */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.badge-primary {
    background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
    color: #fff;
}

.badge-campus {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: background var(--transition);
}

.badge-campus:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-white);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:hover {
    border-color: #cfd9e3;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--ring);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* --- Micro-interactions --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple-anim 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-anim {
    to { transform: scale(4); opacity: 0; }
}

.btn {
    position: relative;
    overflow: hidden;
}

/* --- Boite de confirmation douce --- */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 24, 46, 0.45);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 1rem;
}

.confirm-modal.open {
    opacity: 1;
    visibility: visible;
}

.confirm-modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: translateY(8px) scale(0.97);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal.open .confirm-modal-box {
    transform: none;
}

.confirm-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #fee2e2;
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
}

.confirm-modal-title {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.confirm-modal-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* --- Bouton de fermeture d'alerte --- */
.alert-close {
    float: right;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 0.2rem;
}

.alert-close:hover {
    opacity: 1;
}

/* --- Toasts (site public) --- */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3200;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(380px, calc(100vw - 2rem));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-ferme {
    transform: translateX(120%);
    opacity: 0;
}

.toast-succes { border-left-color: var(--success); }
.toast-avertissement { border-left-color: var(--warning); }
.toast-erreur {
    background: linear-gradient(135deg, var(--danger) 0%, #e11d48 100%);
    color: #fff;
    border-left: none;
}

.toast-icon {
    font-size: 1.1rem;
    line-height: 1.3;
    flex-shrink: 0;
}

.toast-texte {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.35;
}

.toast-fermer {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
}

.toast-erreur .toast-fermer,
.toast-erreur .toast-icon {
    color: rgba(255, 255, 255, 0.9);
}

/* --- Alerts --- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* --- Footer --- */
.footer {
    background: var(--sky-900);
    color: #ccc;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #ccc;
}

.footer a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

/* --- Pages intro / bannière --- */
.page-header {
    background: var(--grad-skyline-deep);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 14px rgba(10, 25, 50, 0.5);
}

.page-header p {
    text-shadow: 0 1px 10px rgba(10, 25, 50, 0.45);
}

/* Bannière illustrée : image + voile dégradé pour garder le texte lisible */
.page-header--img {
    position: relative;
    background-color: var(--blue-900);
    background-size: cover;
    background-position: center;
    padding: 4.25rem 0;
}

.page-header--img::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13, 27, 55, 0.68), rgba(30, 58, 138, 0.5));
    pointer-events: none;
}

.page-header--img .container {
    position: relative;
    z-index: 1;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 500;
}

.pagination a:hover {
    background: var(--blue-900);
    color: #fff;
    border-color: var(--blue-900);
}

.pagination .active {
    background: var(--blue-900);
    color: #fff;
    border-color: var(--blue-900);
}

/* --- Article detail --- */
.article-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.article-content h1 {
    color: var(--blue-900);
    margin-bottom: 0.5rem;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* --- Login page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--grad-skyline-deep);
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.login-card h2 {
    text-align: center;
    color: var(--blue-900);
    margin-bottom: 1.5rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-900);
}

/* --- Slideshow --- */
.slideshow {
    position: relative;
    overflow: hidden;
}

/* --- Hero slideshow --- */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.02);
    transition: transform 8s ease;
}

.hero-slide.active img {
    transform: scale(1.1);
}

.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72) 0%, rgba(15, 23, 42, 0.42) 50%, rgba(15, 23, 42, 0.68) 100%);
    z-index: 1;
}

.hero-slide .slide-caption {
    position: absolute;
    z-index: 2;
    bottom: 1.5rem;
    right: 2rem;
    color: #fff;
    text-align: right;
    padding: 0.75rem 1.25rem;
    background: rgba(15, 23, 42, 0.72);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
    max-width: 320px;
}

.hero-slide .slide-caption strong {
    display: block;
    font-size: 1.05rem;
}

.hero-slide .slide-caption span {
    font-size: 0.85rem;
    opacity: 0.9;
}

.hero-content {
    position: relative;
    z-index: 3;
}

.hero-arrows {
    position: absolute;
    z-index: 4;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    padding: 0 1.25rem;
}

.slideshow-arrow {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    backdrop-filter: blur(3px);
    line-height: 1;
}

.slideshow-arrow:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}

.slideshow-dots {
    position: absolute;
    z-index: 4;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.55rem;
    pointer-events: none;
}

.slideshow-dot {
    pointer-events: auto;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition), transform var(--transition);
}

.slideshow-dot.active {
    background: #fff;
    transform: scale(1.25);
}

/* --- Event / news slideshow (cards) --- */
.event-slideshow {
    max-width: 900px;
    margin: 0 auto;
}

.event-slideshow .slide {
    display: none;
    padding: 0 0.5rem;
    justify-content: center;
}

.event-slideshow .slide.active {
    display: flex;
    animation: slideFadeIn 0.6s ease;
}

.event-slideshow .card {
    max-width: 380px;
    width: 100%;
}

.event-slideshow .slideshow-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 58, 138, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.event-slideshow .slideshow-arrow:hover {
    background: var(--blue-900);
}

.event-slideshow .slideshow-arrow.prev { left: -0.5rem; }
.event-slideshow .slideshow-arrow.next { right: -0.5rem; }

.event-slideshow .slideshow-dots {
    position: static;
    transform: none;
    justify-content: center;
    margin-top: 1.5rem;
}

.event-slideshow .slideshow-dot {
    background: var(--border);
    width: 12px;
    height: 12px;
}

.event-slideshow .slideshow-dot.active {
    background: var(--blue-600);
}

@keyframes slideFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Reveal on scroll --- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

/* --- Entrance animation for page sections --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* --- Respect reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .col-3 { flex: 0 0 50%; max-width: 50%; }
    .col-4 { flex: 0 0 50%; max-width: 50%; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .navbar-toggle { display: block; }

    .navbar-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    .navbar-nav.open { display: flex; }

    .navbar-nav a {
        width: 100%;
        text-align: center;
    }

    .hero h1 { font-size: 2rem; }
    .hero { padding: 4rem 0; }

    .hero-slide .slide-caption {
        bottom: 3.5rem;
        right: 0.75rem;
        max-width: 260px;
        font-size: 0.85rem;
    }

    .hero-arrows { padding: 0 0.5rem; }
    .slideshow-arrow { width: 36px; height: 36px; font-size: 1rem; }

    .event-slideshow .slideshow-arrow.prev { left: 0; }
    .event-slideshow .slideshow-arrow.next { right: 0; }

    .col-3, .col-4, .col-6, .col-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1rem;
    }

    .login-card {
        padding: 1.75rem 1.25rem;
    }

    .page-header--img {
        padding: 2.75rem 0;
    }

    .article-content {
        padding: 1.25rem;
    }

    .footer-grid { grid-template-columns: 1fr; }
    .section { padding: 2.5rem 0; }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.15rem;
    }

    .hero h1 { font-size: 1.65rem; }
    .hero .lead { font-size: 1rem; }
    .hero { padding: 3rem 0; }

    .page-header h1 { font-size: 1.6rem; }
    .section-title { margin-bottom: 1.75rem; }

    .theme-toggle-fixed {
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* ============================================
   Mode sombre
   Active par <html data-theme="dark">
   ============================================ */

/* --- Bouton bascule de theme --- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
    font-size: 1.05rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover {
    transform: rotate(20deg) scale(1.06);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.theme-toggle:active {
    transform: scale(0.92);
}

.theme-toggle-icon {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] .theme-toggle-icon {
    transform: rotate(360deg);
}

/* Variante flottante (page de connexion, etc.) */
.theme-toggle-fixed {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 4000;
    box-shadow: var(--shadow-md);
}

/* --- Tokens sombres --- */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1722;
    --bg-white: #16202e;
    --text: #e5edf5;
    --text-muted: #93a4b8;
    --border: #2a3648;
    --border-soft: #1f2a3a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
    --ring: rgba(52, 152, 219, 0.45);
    background: var(--bg);
    color: var(--text);
}

html[data-theme="dark"] body {
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='96' viewBox='0 0 84 96'%3E%3Cpath d='M42 2l36 21v42L42 86 6 65V23z' fill='none' stroke='%23475569' stroke-width='.7' opacity='.16'/%3E%3Cpath d='M0 50l36 21v42L0 134l-36-21V71z' fill='none' stroke='%23475569' stroke-width='.7' opacity='.16'/%3E%3Cpath d='M84 50l36 21v42L84 134l-36-21V71z' fill='none' stroke='%23475569' stroke-width='.7' opacity='.16'/%3E%3C/svg%3E");
    background-size: 84px 96px;
    color: var(--text);
}

html[data-theme="dark"] a {
    color: #7fb6e8;
}

html[data-theme="dark"] a:hover {
    color: #a8d1f3;
}

/* Navbar */
html[data-theme="dark"] .navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-soft);
}

html[data-theme="dark"] .navbar-brand {
    color: var(--text);
}

html[data-theme="dark"] .navbar-nav a {
    color: var(--text);
}

html[data-theme="dark"] .navbar-toggle span {
    background: var(--text);
}

/* Cards, articles, contenus */
html[data-theme="dark"] .card,
html[data-theme="dark"] .article-content {
    background: var(--bg-white);
    border-color: var(--border-soft);
    color: var(--text);
}

html[data-theme="dark"] .card-title {
    color: var(--primary-light);
}

html[data-theme="dark"] .card-text {
    color: var(--text);
}

/* Boutons */
html[data-theme="dark"] .btn-outline {
    color: var(--text);
    border-color: var(--border);
}

html[data-theme="dark"] .btn-outline:hover {
    background: var(--bg-white);
    color: var(--primary-light);
}

html[data-theme="dark"] .btn-secondary {
    background: #334052;
    color: #e5edf5;
}

/* Formulaires */
html[data-theme="dark"] .form-control {
    background: #0f1722;
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .form-control:hover {
    border-color: #334052;
}

html[data-theme="dark"] .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--ring);
}

html[data-theme="dark"] select.form-control option {
    background: #16202e;
    color: var(--text);
}

/* Alerts */
html[data-theme="dark"] .alert-success {
    background: #12301f;
    color: #a5e7c3;
    border-color: #1f4a33;
}

html[data-theme="dark"] .alert-danger {
    background: #3a1620;
    color: #f2b8c4;
    border-color: #5a2330;
}

html[data-theme="dark"] .alert-info {
    background: #122c3a;
    color: #a8d8ea;
    border-color: #1f4a5c;
}

/* Footer */
html[data-theme="dark"] .footer {
    background: #101724;
}

html[data-theme="dark"] .page-header {
    background: var(--grad-skyline-deep);
}

/* Pagination */
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .pagination span {
    background: var(--bg-white);
    border-color: var(--border);
    color: var(--text);
}

html[data-theme="dark"] .pagination a:hover {
    background: var(--primary-light);
    color: #fff;
    border-color: var(--primary-light);
}

/* Toasts */
html[data-theme="dark"] .toast {
    background: var(--bg-white);
    color: var(--text);
}

html[data-theme="dark"] .toast-erreur {
    background: linear-gradient(135deg, var(--danger) 0%, #e11d48 100%);
    color: #fff;
}

/* Transitions fluides du theme */
html[data-theme="dark"] body,
html[data-theme="dark"] .card,
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .navbar {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Affichage / masquage du mot de passe */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition), background var(--transition);
}

.password-toggle:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .password-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.password-toggle .pw-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.password-toggle .pw-icon-hide {
    display: none;
}

.password-toggle.pw-visible .pw-icon-show {
    display: none;
}

.password-toggle.pw-visible .pw-icon-hide {
    display: block;
}
