/* Typographie globale AB-Naturel alignée sur la page Accueil. */
@import url("https://fonts.googleapis.com/css2?family=Muli:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&display=swap");

:root {
  --ab-font-sans: "Muli", "Segoe UI", Arial, sans-serif;
  --bs-body-font-family: var(--ab-font-sans);
  --font-family-base: var(--ab-font-sans);
  --font-family-title: var(--ab-font-sans);
  --ab-type-h1: clamp(22px, 1.75vw, 28px);
  --ab-type-h2: clamp(19px, 1.45vw, 24px);
  --ab-type-h3: clamp(17px, 1.2vw, 20px);
  --ab-type-body: 16px;
  --ab-type-small: 14px;
  --ab-type-heading-color: #101828;
  --ab-type-body-color: #344054;
  --ab-type-small-color: #667085;
}

html,
body {
  font-family: var(--ab-font-sans) !important;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Les anciens écrans définissaient parfois Poppins, Roboto ou Arial localement.
   Cette règle les harmonise sans toucher aux fontes d'icônes ni au code. */
body :where(*):not(i):not(svg):not(path):not(iconify-icon):not(code):not(pre):not(kbd):not(samp):not(.material-icons):not(.material-symbols-outlined):not([class^="fa"]):not([class*=" fa-"]):not([class^="ri-"]):not([class*=" ri-"]):not([class^="bi-"]):not([class*=" bi-"]):not([class^="icofont-"]):not([class*=" icofont-"]):not([class*="flaticon"]) {
  font-family: var(--ab-font-sans) !important;
}

button,
input,
select,
textarea,
optgroup,
table,
.btn,
.form-control,
.form-select,
.input-group-text,
.dropdown-menu,
.modal,
.popover,
.tooltip {
  font-family: var(--ab-font-sans) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.page-title,
.card-title,
.modal-title {
  font-family: var(--ab-font-sans) !important;
  font-weight: 700;
  letter-spacing: -0.018em;
}

p,
li,
label,
td,
th,
small,
.text-sm,
.form-text,
.dropdown-item,
.nav-link {
  font-family: var(--ab-font-sans);
}

strong,
b,
.fw-bold,
.font-bold {
  font-weight: 700 !important;
}

code,
pre,
kbd,
samp {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important;
}

/*
 * Échelle sémantique unique du projet.
 * La répétition volontaire de la classe augmente la priorité face aux anciens
 * styles de pages. Les couleurs locales restent possibles sur les fonds foncés.
 */
@media screen {
  body.ab-typography :where(h1, h2, h3, .h1, .h2, .h3) {
    color: var(--ab-type-heading-color);
  }

  body.ab-typography :where(p) {
    color: var(--ab-type-body-color);
  }

  body.ab-typography :where(small) {
    color: var(--ab-type-small-color);
  }

  html body.ab-typography.ab-typography.ab-typography :is(h1, .h1) {
    max-width: 100%;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: var(--ab-type-h1) !important;
    font-weight: 800 !important;
    line-height: 1.18 !important;
    letter-spacing: -.025em !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  html body.ab-typography.ab-typography.ab-typography :is(h2, .h2) {
    max-width: 100%;
    margin-top: 0;
    margin-bottom: .875rem;
    font-size: var(--ab-type-h2) !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -.02em !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  html body.ab-typography.ab-typography.ab-typography :is(h3, .h3) {
    max-width: 100%;
    margin-top: 0;
    margin-bottom: .75rem;
    font-size: var(--ab-type-h3) !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    letter-spacing: -.012em !important;
    overflow-wrap: anywhere;
    text-wrap: balance;
  }

  html body.ab-typography.ab-typography.ab-typography p {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: var(--ab-type-body) !important;
    font-weight: 400 !important;
    line-height: 1.7 !important;
    overflow-wrap: anywhere;
  }

  html body.ab-typography.ab-typography.ab-typography small {
    font-size: var(--ab-type-small) !important;
    font-weight: 400;
    line-height: 1.5 !important;
    overflow-wrap: anywhere;
  }

  body.ab-typography .slider_text_inner h2,
  body.ab-typography .section_title.white .section_main_title h2,
  body.ab-typography .home-process .section_main_title h2 {
    color: #fff;
  }

  body.ab-typography .section_main_title h2 span {
    color: #0c5adb;
  }

  /* Contraste fiable dans les bandeaux foncés des espaces connectés. */
  body.ab-typography :is(
    .support-hero,
    .quiz-admin .selected-head,
    .submission-dashboard .hero,
    .work-followup .hero,
    .quiz-overview .intro-card,
    .records-overview .hero
  ) :is(h1, h2, h3, h4, p, small) {
    color: #ffffff !important;
  }

  body.ab-typography :is(input, textarea, select) {
    color: #17243a;
  }

  body.ab-typography :is(input, textarea)::placeholder {
    color: #667085;
    opacity: 1;
  }
}

@media screen and (max-width: 575.98px) {
  :root {
    --ab-type-h1: 22px;
    --ab-type-h2: 19px;
    --ab-type-h3: 17px;
    --ab-type-body: 15px;
    --ab-type-small: 13px;
  }

  html body.ab-typography.ab-typography.ab-typography :is(h1, h2, h3, .h1, .h2, .h3) {
    max-width: 100%;
    word-break: normal;
    hyphens: auto;
  }
}

/*
 * Séparation visuelle des zones fonctionnelles.
 * Chaque panneau reste indépendant : fond blanc, contour net, ombre courte
 * et en-tête clairement détaché, conformément au modèle Edudash.
 */
:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body {
  background-color: #edf2f7 !important;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  :is(
    .admin-card,
    .card,
    .panel,
    .side-card,
    .data-card,
    .filter-card,
    .student-section-card,
    .table-container,
    .tabs-container,
    .catalog-tools,
    .teacher-group,
    .report-card
  ) {
  border: 1px solid #cbd5e1 !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .065) !important;
  overflow: hidden;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  :is(
    .admin-card,
    .panel,
    .side-card,
    .data-card,
    .filter-card,
    .student-section-card,
    .table-container,
    .tabs-container,
    .catalog-tools,
    .teacher-group,
    .report-card
  ) {
  background-color: #ffffff;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  :is(
    .admin-card-header,
    .card-header,
    .panel-head,
    .data-head,
    .student-section-head,
    .table-header,
    .course-header,
    .teacher-head,
    .report-head
  ) {
  min-height: 64px;
  border-bottom: 1px solid #c4ceda !important;
  background-color: #ffffff;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  :is(
    .admin-card-header,
    .card-header,
    .panel-head,
    .data-head,
    .student-section-head,
    .table-header,
    .course-header,
    .teacher-head,
    .report-head
  )
  :is(h2, h3, h4) {
  color: #0f172a !important;
  font-weight: 800 !important;
}

/* Les petites cartes restent distinctes à l'intérieur des grands panneaux. */
:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  :is(
    .student-kpi,
    .home-kpi,
    .course-stat,
    .course-card,
    .class-card,
    .assignment-card,
    .activity-card,
    .resource-card,
    .identity-item,
    .course-report,
    .metric,
    .kpi
  ) {
  border: 1px solid #d3dce6 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .045) !important;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  :is(
    .admin-card,
    .card,
    .panel,
    .side-card,
    .data-card,
    .filter-card,
    .student-section-card,
    .table-container,
    .tabs-container,
    .catalog-tools,
    .teacher-group,
    .report-card
  ):hover {
  border-color: #b4c0cd !important;
}

/*
 * Tableaux communs aux trois espaces.
 * Les lignes foncées séparent clairement chaque donnée tout en conservant
 * une présentation légère et professionnelle.
 */
:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed) {
  border: 1px solid #1f2937 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .045);
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  > :not(caption)
  > *
  > * {
  border-right: 1px solid #344054 !important;
  border-bottom: 1px solid #344054 !important;
  color: #101828 !important;
  vertical-align: middle;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  tr
  > :last-child {
  border-right: 0 !important;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  thead
  th {
  border-bottom-width: 2px !important;
  border-bottom-color: #111827 !important;
  background: #edf2f7 !important;
  color: #0b1220 !important;
  font-weight: 800 !important;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  tbody
  tr:nth-child(even)
  > * {
  background-color: #f8fafc;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  tbody
  tr:hover
  > * {
  background-color: #eef6fc !important;
}

:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  tbody
  tr:last-child
  > *,
:is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  tfoot
  tr:last-child
  > * {
  border-bottom: 0 !important;
}

[data-theme="dark"]
  :is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed) {
  border-color: #cbd5e1 !important;
  background: #172232;
}

[data-theme="dark"]
  :is(body.administrator-admin, body.professor-admin, body.student-admin)
  .dashboard-main-body
  table:not(.calendar-table):not(.table-condensed)
  > :not(caption)
  > *
  > * {
  border-color: #94a3b8 !important;
  color: #f8fafc !important;
}

/* Fond de présentation AB-Naturel, identique dans les espaces connectés. */
:root {
  --ab-presentation-bg:
    radial-gradient(circle at 78% -35%, rgba(21, 92, 203, .62), transparent 42rem),
    linear-gradient(180deg, #02072f 0%, #03134f 52%, #082f78 100%);
  --ab-presentation-line: #249bd5;
  --ab-presentation-shadow: 0 4px 0 rgba(40, 159, 215, .72), 0 18px 38px rgba(1, 9, 49, .28);
}

html body:is(.administrator-admin, .professor-admin, .student-admin).ab-typography
  .dashboard-main-body
  :is(
    .ab-blue-hero,
    .admin-page > .admin-page-head,
    .hero,
    .dashboard-hero__main,
    .home-hero,
    .catalog-hero,
    .course-hero,
    .student-page-intro,
    .support-hero,
    .profile-hero,
    .copy-hero,
    .report-hero,
    .result-hero,
    .intro-card,
    .hero-card,
    .card.intro,
    .card.class-head,
    .top-card,
    .report-toolbar,
    .course-create .intro,
    .exercise-settings .intro,
    .results-detail .intro
  ) {
  position: relative;
  overflow: hidden;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--ab-presentation-line) !important;
  border-radius: 18px !important;
  background: var(--ab-presentation-bg) !important;
  color: #fff !important;
  box-shadow: var(--ab-presentation-shadow) !important;
}

html body:is(.administrator-admin, .professor-admin, .student-admin).ab-typography
  .dashboard-main-body
  :is(
    .ab-blue-hero,
    .admin-page > .admin-page-head,
    .hero,
    .dashboard-hero__main,
    .home-hero,
    .catalog-hero,
    .course-hero,
    .student-page-intro,
    .support-hero,
    .profile-hero,
    .copy-hero,
    .report-hero,
    .result-hero,
    .intro-card,
    .hero-card,
    .card.intro,
    .card.class-head,
    .top-card,
    .report-toolbar,
    .course-create .intro,
    .exercise-settings .intro,
    .results-detail .intro
  )
  :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    small,
    strong,
    .meta,
    .text-muted,
    .text-secondary,
    .text-secondary-light,
    .hero-eyebrow,
    .welcome-kicker,
    .catalog-kicker
  ) {
  color: #fff !important;
}

html body:is(.administrator-admin, .professor-admin, .student-admin).ab-typography
  .dashboard-main-body
  :is(
    .ab-blue-hero,
    .admin-page > .admin-page-head,
    .hero,
    .dashboard-hero__main,
    .home-hero,
    .catalog-hero,
    .course-hero,
    .student-page-intro,
    .support-hero,
    .profile-hero,
    .copy-hero,
    .report-hero,
    .result-hero,
    .intro-card,
    .hero-card,
    .card.intro,
    .card.class-head,
    .top-card,
    .report-toolbar
  )
  :is(.hero-icon, .intro-icon, .activity-icon, .class-icon, .profile-avatar, .support-hero__icon) {
  border: 1px solid rgba(255, 255, 255, .34) !important;
  background: rgba(255, 255, 255, .14) !important;
  color: #fff !important;
}

html body.administrator-admin.ab-typography
  .dashboard-main-body
  .admin-page
  > .admin-page-head
  .btn-primary {
  border-color: #fff !important;
  background: #fff !important;
  color: #073b78 !important;
}

html body.administrator-admin.ab-typography
  .dashboard-main-body
  .admin-page
  > .admin-page-head
  .btn-outline-primary {
  border-color: rgba(255, 255, 255, .68) !important;
  background: rgba(255, 255, 255, .08) !important;
  color: #fff !important;
}

html body.administrator-admin.ab-typography
  .dashboard-main-body
  .admin-page
  > .admin-page-head {
  padding: clamp(20px, 2.4vw, 30px);
}

@media (max-width: 767.98px) {
  html body:is(.administrator-admin, .professor-admin, .student-admin).ab-typography
    .dashboard-main-body
    .admin-page
    > .admin-page-head {
    padding: 18px !important;
  }
}

/* Les pages publiques internes reprennent le même bleu nuit sans modifier l'accueil. */
/* Bandeaux clairs demandés sur les pages de suivi professeur. */
html body.professor-admin.ab-typography
  .dashboard-main-body
  .ab-light-hero {
  border-color: #249bd5 !important;
  background: #fff !important;
  color: #05070b !important;
  box-shadow: 0 4px 0 rgba(62, 167, 216, .68), 0 16px 32px rgba(15, 55, 85, .14) !important;
}

html body.professor-admin.ab-typography
  .dashboard-main-body
  .ab-light-hero
  :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    small,
    strong,
    .meta,
    .text-white,
    .text-white-50,
    .text-muted,
    .text-secondary,
    .text-secondary-light,
    .hero-eyebrow
  ) {
  color: #05070b !important;
  opacity: 1 !important;
}

html body.professor-admin.ab-typography
  .dashboard-main-body
  .ab-light-hero
  :is(.hero-icon, .intro-icon, .profile-avatar) {
  border: 1px solid #9fd6ee !important;
  background: #eaf7fd !important;
  color: #075b91 !important;
}

html body.professor-admin.ab-typography
  .dashboard-main-body
  .ab-light-hero
  :is(.hero-actions a, .btn-outline-light) {
  border-color: #acd7ea !important;
  background: #f7fcff !important;
  color: #064f82 !important;
}

html body.professor-admin.ab-typography
  .dashboard-main-body
  .ab-light-hero
  .btn-light {
  border-color: #acd7ea !important;
  background: #fff !important;
  color: #064f82 !important;
}

html body.elearning-public.ab-typography :is(.page-hero, .breadcumb-area, .breadcumb_area) {
  border-color: var(--ab-presentation-line) !important;
  background: var(--ab-presentation-bg) !important;
  color: #fff !important;
  box-shadow: var(--ab-presentation-shadow) !important;
}

html body.elearning-public.ab-typography
  :is(.page-hero, .breadcumb-area, .breadcumb_area)
  :is(h1, h2, h3, h4, h5, h6, p, small) {
  color: #fff !important;
}

@media print {
  :is(body.administrator-admin, body.professor-admin, body.student-admin)
    .dashboard-main-body
    table:not(.calendar-table):not(.table-condensed),
  :is(body.administrator-admin, body.professor-admin, body.student-admin)
    .dashboard-main-body
    table:not(.calendar-table):not(.table-condensed)
    > :not(caption)
    > *
    > * {
    border-color: #000 !important;
    box-shadow: none !important;
  }
}
