/* INRAE — Identité visuelle SaaS (charte avril 2024)
 * Couleurs institutionnelles:
 * - Vert émeraude     #00a3a6
 * - Vert foncé        #008c8e
 * - Vert clair        #66c1bf
 * - Bleu profond      #275662
 * Complémentaires:
 * - Vert pâle         #9dc544
 * - Violet            #423089
 * - Corail            #ed6e6c
 * - Grège             #c4c0b3
 * - Bleu ciel         #9ed6e3
 * - Gris              #797870
 */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Raleway', 'Avenir Next Pro', Calibri, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f6f8;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: #275662;
    font-weight: 700;
    letter-spacing: -0.01em;
}

a {
    color: #008c8e;
    text-decoration: none;
}

a:hover {
    color: #275662;
    text-decoration: underline;
}

img, video, iframe, figure {
    max-width: 100%;
}

::selection {
    background: rgba(0, 163, 166, 0.2);
}

/* ===========================
   VARIABLES
   =========================== */

:root {
    --inrae-vert: #00a3a6;
    --inrae-vert-fonce: #008c8e;
    --inrae-vert-clair: #66c1bf;
    --inrae-vert-pale: #9dc544;
    --inrae-bleu-profond: #275662;
    --inrae-violet: #423089;
    --inrae-corail: #ed6e6c;
    --inrae-grege: #c4c0b3;
    --inrae-bleu-ciel: #9ed6e3;
    --inrae-gris: #797870;
    --inrae-bg: #f4f6f8;
}

/* ===========================
   LAYOUT
   =========================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8, .col-md-3, .col-md-12 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    flex: 1 0 0%;
}

.col-12, .col-md-12 { width: 100%; flex: 0 0 100%; }
.col-6 { width: 50%; flex: 0 0 50%; }
.col-4 { width: 33.333333%; flex: 0 0 33.333333%; }
.col-3 { width: 25%; flex: 0 0 25%; }

@media (min-width: 768px) {
    .col-md-3 { width: 25%; flex: 0 0 25%; }
    .col-md-12 { width: 100%; flex: 0 0 100%; }
}

@media (min-width: 1024px) {
    .col-lg-3 { width: 25%; flex: 0 0 25%; }
    .col-lg-4 { width: 33.333333%; flex: 0 0 33.333333%; }
    .col-lg-6 { width: 50%; flex: 0 0 50%; }
    .col-lg-8 { width: 66.666667%; flex: 0 0 66.666667%; }
}

/* ===========================
   TITRES
   =========================== */

.page-title {
    text-align: center;
    margin: 1rem 0 2.5rem;
    color: #275662;
    font-weight: 800;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
}

.page-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #00a3a6, #66c1bf);
    border-radius: 2px;
    margin: 1rem auto 0;
}

/* ===========================
   NAVIGATION
   =========================== */

#mainNav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 228, 230, 0.8);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

#mainNav .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #475569;
    transition: all 0.2s ease;
    text-decoration: none;
}

#mainNav .nav-link:hover {
    background: rgba(0, 163, 166, 0.08);
    color: #008c8e;
    text-decoration: none;
}

/* ===========================
   BOUTONS
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.625rem;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #00a3a6, #008c8e);
    color: #fff;
    border-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #008c8e, #00797b);
    color: #fff;
}

.btn-outline-primary {
    background: #fff;
    border-color: #e2e4e6;
    color: #275662;
}

.btn-outline-primary:hover {
    border-color: #00a3a6;
    color: #00a3a6;
    background: rgba(0, 163, 166, 0.04);
}

.btn-secondary {
    background: #423089;
    color: #fff;
}

.btn-secondary:hover {
    background: #31246b;
    color: #fff;
}

.btn-success {
    background: #9dc544;
    color: #fff;
}

.btn-success:hover {
    background: #859f38;
    color: #fff;
}

.btn-danger {
    background: #ed6e6c;
    color: #fff;
}

.btn-danger:hover {
    background: #c45553;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #475569;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(0, 163, 166, 0.06);
    color: #008c8e;
}

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

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

/* ===========================
   DROPDOWNS
   =========================== */

[data-dropdown] {
    position: relative;
}

[data-dropdown] .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e2e4e6;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    padding: 0.5rem 0;
    z-index: 50;
    animation: fadeIn 0.15s ease;
}

[data-dropdown]:hover .dropdown-menu,
[data-dropdown]:focus-within .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    color: #334155;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s;
    text-decoration: none;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(0, 163, 166, 0.08);
    color: #008c8e;
    text-decoration: none;
}

/* ===========================
   ALERTES
   =========================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(0, 163, 166, 0.08);
    border-color: rgba(0, 163, 166, 0.2);
    color: #275662;
}

.alert-danger {
    background: rgba(237, 110, 108, 0.08);
    border-color: rgba(237, 110, 108, 0.25);
    color: #9c2b2a;
}

.alert-dark {
    background: #f1f2f3;
    border-color: #c4c0b3;
    color: #797870;
}

.alert-info {
    background: rgba(158, 214, 227, 0.15);
    border-color: rgba(158, 214, 227, 0.3);
    color: #275662;
}

.alert::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.alert-success::before { content: '\f058'; color: #00a3a6; }
.alert-danger::before { content: '\f06a'; color: #ed6e6c; }
.alert-info::before { content: '\f05a'; color: #275662; }
.alert-dark::before { content: '\f129'; color: #797870; }

/* ===========================
   FORMULAIRES
   =========================== */

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.625rem;
    font-size: 0.95rem;
    color: #0f172a;
    background: #fff;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:hover,
.form-select:hover {
    border-color: #9ed6e3;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: #66c1bf;
    box-shadow: 0 0 0 4px rgba(0, 163, 166, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:disabled,
.form-select:disabled {
    background: #f3f4f6;
    color: #6b7280;
}

/* ===========================
   TABLES
   =========================== */

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    border-radius: 0.75rem;
    overflow: hidden;
}

.table th,
.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #eef0f2;
}

.table thead th {
    background: #275662;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: none;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.table tbody tr:hover {
    background: rgba(0, 163, 166, 0.04);
}

/* ===========================
   CARTES PROJET
   =========================== */

.card-container {
    display: block;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.card-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
    border-color: #d5e8ea;
}

.card-container .main {
    display: flex;
    flex-wrap: wrap;
}

.card-container .main-header {
    width: 100%;
    max-width: 280px;
    min-height: 220px;
    background-color: #00a3a6;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .card-container .main-header {
        width: 38%;
    }
}

.card-container .main-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.25) 100%);
    z-index: 1;
    pointer-events: none;
}

.card-container .main-header figure {
    width: 100%;
    height: 100%;
    min-height: 220px;
    margin: 0;
    padding: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

.card-container:hover .main-header figure {
    transform: scale(1.05);
}

.card-container .main-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.75rem;
    min-width: 0;
}

.card-container .titre {
    font-size: 1.4rem;
    font-weight: 800;
    color: #275662;
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.card-container .meta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    background: rgba(0, 163, 166, 0.08);
    color: #008c8e;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card-container .main-body p {
    color: #64748b;
    margin-bottom: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.card-corner {
    position: absolute;
    width: 96px;
    height: 96px;
    border-radius: 24px;
    right: -72px;
    bottom: -72px;
    z-index: 2;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 16px;
}

.card-corner svg {
    color: #fff;
}

.card-container:hover .card-corner {
    right: -18px;
    bottom: -18px;
}

/* ===========================
   PETITES CARTES VIDÉOS
   =========================== */

.small-card {
    display: block;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    color: #275662;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.small-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
    border-color: #d5e8ea;
}

.small-card .thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.small-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.small-card:hover .thumb img {
    transform: scale(1.06);
}

.small-card .thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 70%, rgba(0,0,0,0.35) 100%);
}

.small-card .play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.small-card .play-icon span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #00a3a6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.small-card:hover .play-icon span {
    background: #00a3a6;
    color: #fff;
    transform: scale(1.08);
}

.small-card p {
    padding: 0.9rem;
    margin: 0;
    font-weight: 700;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.35;
}

/* ===========================
   HERO
   =========================== */

.hero {
    position: relative;
    padding: 3rem 0 2.5rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: #275662;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.hero p {
    color: #64748b;
    font-size: 1.1rem;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===========================
   PANNEAUX
   =========================== */

.panel {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    padding: 1.75rem;
}

/* ===========================
   VIDÉO
   =========================== */

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.video-player iframe,
.video-player video,
.video-player > * {
    width: 100%;
    height: 100%;
    border: 0;
}

.description-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.description-card h1,
.description-card h2,
.description-card h3,
.description-card h4 {
    color: #275662;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.description-card p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.description-card ul,
.description-card ol {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
    color: #475569;
}

.description-card li {
    margin-bottom: 0.35rem;
}

.description-card a {
    color: #008c8e;
    text-decoration: underline;
    font-weight: 600;
}

.description-card a:hover {
    color: #275662;
}

.description-card img {
    border-radius: 0.75rem;
    margin: 1rem 0;
}

/* ===========================
   AUTH
   =========================== */

.auth-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-card .brand {
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    background: rgba(0, 163, 166, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-card .brand img {
    height: 56px;
    width: auto;
}

/* ===========================
   PAGINATION LEGACY
   =========================== */

.dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.85rem;
    margin-right: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background: #fff;
    transition: all 0.15s;
}

.dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background: rgba(0, 163, 166, 0.08);
    color: #008c8e;
}

.dataTables_paginate .paginate_button.current {
    background: #00a3a6;
    color: #fff;
}

.dataTables_paginate .paginate_button.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* ===========================
   UTILITAIRES FALLBACK
   =========================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-weight-normal { font-weight: 400; }
.font-weight-bold { font-weight: 700; }
.font-weight-semibold { font-weight: 600; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.img-fluid { max-width: 100%; height: auto; }
.embed-responsive { position: relative; width: 100%; padding-bottom: 56.25%; }
.embed-responsive > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
