/* ==========================================================================
   aeyo_friday — template du portail client « Mon portail GERESO »
   DA : gereso.com (Open Sans 800, rouge #D00C2D, boutons pilule, header blanc
   + barre lavande, footer granite, cartes radius 16px, arc convexe).
   Chargée APRÈS uikit-gereso.css (UIkit 2 + styles GERESO historiques) et
   legacy-uikit.css : les classes du shell sont préfixées « af- » pour ne pas
   hériter des anciennes règles de yoo_monday (.tm-navbar, .hd-container-fluid…).
   ========================================================================== */

/* -------------------------------------------------------------- Tokens */
:root {
  --gs-primary: #D00C2D;
  --gs-primary-hover: #B5001E;
  --gs-primary-dark: #7F0013;
  --gs-primary-bright: #F3143A;
  --gs-primary-soft: #FCE8EB;
  --gs-gradient-primary: linear-gradient(50.6deg, #D00C2D -0.93%, #F3143A 159.98%);
  --gs-text: #090909;
  --gs-text-muted: #636463;
  --gs-text-subtle: #6D6F71;
  --gs-placeholder: #9CA3AF;
  --gs-border: #C5C5C5;
  --gs-border-light: #E9E9E9;
  --gs-bg: #FFFFFF;
  --gs-bg-soft: #EDEFF8;
  --gs-bg-page: #F7F8FC;
  --gs-label-bg: #DCDFE6; /* bandeaux de titre de section (plus soutenu que --gs-bg-soft, lisible sur --gs-bg-page) */
  --gs-footer-bg: #514D4D;
  --gs-postfooter-bg: #3E3C3B;
  --gs-success: #6FCF97;
  --gs-success-strong: #028A62;
  --gs-warning: #F0920A;
  --gs-error: #B5001E;
  --gs-info: #296D78;
  --gs-font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gs-radius-sm: .5rem;
  --gs-radius-md: .75rem;
  --gs-radius-lg: 1rem;
  --gs-radius-pill: 9999px;
  --gs-shadow-card: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --gs-shadow-panel: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  --gs-shadow-header: 0 8px 40px #8600060D;
  --gs-container-max: 1280px;

  --af-gutter: 1rem;
  --af-header-h: 72px;
  --af-focus: 0 0 0 3px rgb(208 12 45 / .25);
  --af-ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 1025px) {
  :root {
    --af-gutter: 60px;
    --af-header-h: 96px;
  }
}

/* -------------------------------------------------------------- Base */
html {
  font: 400 16px/1.5 var(--gs-font);
  color: var(--gs-text);
  background: var(--gs-bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.aeyo {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--gs-font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gs-text);
  background: var(--gs-bg-page);
  -webkit-font-smoothing: antialiased;
}

/* L'ancien CSS bloquait le défilement des pages « page-login » (overflow: hidden). */
body.aeyo.page-login {
  overflow: auto;
}

html.af-offcanvas-open,
html.af-offcanvas-open body {
  overflow: hidden;
}

/* Règles de base en :where() (spécificité minimale) : les classes des composants maison (uk-button-*, bandeaux...)
   doivent toujours pouvoir les surcharger. */
:where(body.aeyo) :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--gs-font);
  font-weight: 800;
  color: var(--gs-text);
  text-transform: none;
  letter-spacing: normal;
}

body.aeyo h1 { font-size: 2.5rem; line-height: 1.1; }
body.aeyo h2 { font-size: 2rem; line-height: 1.2; }
body.aeyo h3 { font-size: 1.5rem; line-height: 2rem; }
body.aeyo h4 { font-size: 1.125rem; line-height: 1.75rem; }

@media (max-width: 1024px) {
  body.aeyo h1 { font-size: 2rem; }
  body.aeyo h2 { font-size: 1.625rem; }
  body.aeyo h3 { font-size: 1.25rem; line-height: 1.75rem; }
}

:where(body.aeyo) a {
  color: var(--gs-primary);
  text-decoration: none;
  transition: color .15s;
}

:where(body.aeyo) a:where(:hover, :focus) {
  color: var(--gs-primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.aeyo :focus-visible {
  outline: 2px solid var(--gs-primary);
  outline-offset: 2px;
}

body.aeyo img {
  max-width: 100%;
  height: auto;
}

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.af-skip {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 2000;
  padding: .75rem 1.25rem;
  border-radius: var(--gs-radius-pill);
  background: var(--gs-primary);
  color: #fff !important;
  font-weight: 700;
}

.af-skip:focus {
  top: 1rem;
}

.af-container {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--gs-container-max) + 2 * var(--af-gutter));
  margin-inline: auto;
  padding-inline: var(--af-gutter);
}

/* Le contenu reste dans .uk-container (styles des composants maison), élargi à la nouvelle grille. */
.uk-container.af-page,
.uk-container.af-container {
  max-width: calc(var(--gs-container-max) + 2 * var(--af-gutter));
  padding-inline: var(--af-gutter);
}

@media (max-width: 1024px) {
  .af-desktop-only { display: none !important; }
}

@media (min-width: 1025px) {
  .af-mobile-only { display: none !important; }
}

/* Masquage posé par le plugin swcustomscripts sur un lien de menu : on masque l'entrée entière. */
.af-nav li:has(> .uk-hidden) {
  display: none;
}

/* -------------------------------------------------------------- Boutons (charte) */
.af-btn,
body.aeyo a.af-btn,
body.aeyo .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  box-sizing: border-box;
  min-height: 44px;
  padding: 12px 24px;
  border: 1px solid var(--gs-primary);
  border-radius: var(--gs-radius-pill);
  background: var(--gs-bg);
  color: var(--gs-primary);
  font: 700 .875rem/1.2 var(--gs-font);
  text-transform: none;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
}

.af-btn:hover,
body.aeyo .btn:hover {
  background: var(--gs-primary-soft);
  color: var(--gs-primary-hover);
  border-color: var(--gs-primary-hover);
}

.af-btn--primary,
body.aeyo a.af-btn--primary,
body.aeyo .btn-primary {
  background: var(--gs-primary);
  color: #fff;
}

.af-btn--primary:hover,
.af-btn--primary:focus,
body.aeyo a.af-btn--primary:hover,
body.aeyo a.af-btn--primary:focus,
body.aeyo .btn-primary:hover,
body.aeyo .btn-primary:focus {
  background: var(--gs-primary-hover);
  border-color: var(--gs-primary-hover);
  color: #fff;
}

.af-btn--small {
  min-height: 36px;
  padding: 8px 16px;
  font-size: .8125rem;
}

.af-btn:focus-visible,
body.aeyo .btn:focus-visible {
  outline: none;
  box-shadow: var(--af-focus);
}

body.aeyo .btn-secondary {
  border-color: var(--gs-border);
  color: var(--gs-text);
}

body.aeyo .w-100 {
  width: 100%;
}

/* -------------------------------------------------------------- Champs Joomla (com_users…) */
body.aeyo .form-control,
body.aeyo .form-select,
body.aeyo .af-login-form input[type="text"],
body.aeyo .af-login-form input[type="email"],
body.aeyo .af-login-form input[type="password"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 56px;
  padding: 0 1rem;
  border: 1px solid var(--gs-border);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-bg);
  color: var(--gs-text);
  font: 400 1rem/1.5 var(--gs-font);
  transition: border-color .15s, box-shadow .15s;
}

body.aeyo .form-control::placeholder,
body.aeyo .af-login-form input::placeholder {
  color: var(--gs-placeholder);
  opacity: 1;
}

body.aeyo .form-control:focus,
body.aeyo .form-select:focus,
body.aeyo .af-login-form input:focus {
  outline: none;
  border-color: var(--gs-text-muted);
  box-shadow: 0 0 0 3px rgb(99 100 99 / .15);
}

body.aeyo .form-control.invalid,
body.aeyo .invalid .form-control,
body.aeyo input.invalid {
  border-color: var(--gs-error);
}

body.aeyo label.invalid,
body.aeyo .form-control-feedback,
body.aeyo .invalid-feedback {
  color: var(--gs-error);
  font-size: .875rem;
}

body.aeyo .control-group {
  margin-bottom: 1rem;
}

body.aeyo .control-label label {
  display: inline-block;
  margin-bottom: .375rem;
  font-weight: 600;
  font-size: .875rem;
  color: var(--gs-text);
}

body.aeyo .input-group {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

body.aeyo .input-group > .form-control {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

body.aeyo .input-group > .btn,
body.aeyo .input-group > .input-password-toggle {
  min-height: 0;
  height: 56px;
  padding: 0 1rem;
  border: 1px solid var(--gs-border);
  border-left: 0;
  border-radius: 0 var(--gs-radius-sm) var(--gs-radius-sm) 0;
  background: var(--gs-bg-soft);
  color: var(--gs-text-muted);
}

body.aeyo .input-group > .btn:hover {
  background: var(--gs-border-light);
  color: var(--gs-text);
}

body.aeyo .form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
}

body.aeyo .form-check-input {
  accent-color: var(--gs-primary);
  width: 18px;
  height: 18px;
}

/* -------------------------------------------------------------- Messages système (joomla-alert) */
#system-message-container {
  margin-bottom: 1.5rem;
}

#system-message-container:empty {
  display: none;
}

body.aeyo joomla-alert,
body.aeyo .alert {
  position: relative;
  display: block;
  margin: 0 0 1rem;
  padding: 1rem 3rem 1rem 1.25rem;
  border: 0;
  border-left: 4px solid var(--gs-info);
  border-radius: var(--gs-radius-md);
  background: #E8F1F2;
  color: var(--gs-text);
  font-size: .9375rem;
  box-shadow: none;
}

body.aeyo joomla-alert[type="success"],
body.aeyo .alert-success { border-left-color: var(--gs-success-strong); background: #E6F5EE; }
body.aeyo joomla-alert[type="warning"],
body.aeyo .alert-warning { border-left-color: var(--gs-warning); background: #FEF3E2; }
body.aeyo joomla-alert[type="danger"],
body.aeyo joomla-alert[type="error"],
body.aeyo .alert-danger,
body.aeyo .alert-error { border-left-color: var(--gs-error); background: var(--gs-primary-soft); }

body.aeyo joomla-alert .alert-heading {
  margin: 0 0 .25rem;
  font-weight: 700;
}

body.aeyo joomla-alert .alert-heading .visually-hidden + span,
body.aeyo joomla-alert .alert-message {
  margin: 0;
}

body.aeyo joomla-alert .joomla-alert--close,
body.aeyo joomla-alert .joomla-alert-button--close {
  position: absolute;
  top: .5rem;
  right: .75rem;
  padding: .25rem .5rem;
  border: 0;
  background: transparent;
  color: var(--gs-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

/* -------------------------------------------------------------- Barre d'outils (toolbar-l / toolbar-r) */
.af-toolbar {
  background: var(--gs-postfooter-bg);
  color: #fff;
  font-size: .8125rem;
}

.af-toolbar__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .375rem;
}

.af-toolbar p { margin: 0; }

@media (max-width: 1024px) {
  .af-toolbar { display: none; }
}

/* -------------------------------------------------------------- En-tête */
.af-header {
  position: relative;
  z-index: 100;
  background: var(--gs-bg);
  box-shadow: var(--gs-shadow-header);
}

/* Bandeau utilitaire lavande (module « headerbar » : « Mon portail GERESO ») */
.af-utilitybar {
  background: var(--gs-bg-soft);
  color: var(--gs-text-muted);
  font-size: .75rem;
  line-height: 1.5;
}

.af-utilitybar__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  min-height: 28px;
}

.af-utilitybar p {
  margin: 0;
  padding: .25rem 0;
  font-weight: 600;
  color: var(--gs-text-muted);
}

/* Barre principale : logo / outils. Classe « tm-headerbar-default » conservée (Ctrl+double-clic = mode admin). */
.af-headerbar {
  background: var(--gs-bg);
}

.af-headerbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--af-header-h);
}

.af-headerbar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.af-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--gs-text) !important;
  text-decoration: none !important;
}

.af-logo > div,
.af-logo p {
  margin: 0;
}

.af-logo img {
  max-height: 56px;
  width: auto !important;
}

/* « MON PORTAIL » du module logo : séparé par un filet, en capitales d'origine mais avec la typo de la charte. */
.af-logo h1 {
  margin: 0 0 0 .25rem !important;
  padding-left: 1.25rem;
  border-left: 2px solid var(--gs-border-light);
  color: var(--gs-text) !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  line-height: 2.5rem;
  letter-spacing: .04em !important;
  white-space: nowrap;
}

.af-logo--small img {
  max-height: 36px !important;
}

.af-logo--small > div {
  gap: 12px !important;
}

@media (max-width: 1024px) {
  .af-logo--large { display: none !important; }
}

@media (min-width: 1025px) {
  .af-logo--small { display: none !important; }
}

.af-logo--error {
  gap: 1rem;
}

.af-logo__title {
  padding-left: 1rem;
  border-left: 2px solid var(--gs-border-light);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.af-admin-flag {
  color: var(--gs-text-subtle);
  font-size: .75rem;
}

.af-admin-link {
  color: #1D4ED8 !important;
  font-size: .8125rem;
  font-style: italic;
}

.af-headerbar__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

/* Bloc utilisateur (mod_login « user ») */
.af-userbox {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0;
  padding: .375rem .375rem .375rem .5rem;
  border: 1px solid var(--gs-border-light);
  border-radius: var(--gs-radius-pill);
  background: var(--gs-bg);
}

.af-userbox__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gs-bg-soft);
  color: var(--gs-text-muted);
  font-size: 1rem;
  line-height: 1;
}

.af-userbox__greeting {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gs-text);
  white-space: nowrap;
}

.af-userbox__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gs-primary);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}

.af-userbox__logout:hover,
.af-userbox__logout:focus-visible {
  background: var(--gs-primary-hover);
  transform: translateX(1px);
}

/* Burger (mobile) */
.af-burger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--gs-border-light);
  border-radius: 50%;
  background: var(--gs-bg);
  cursor: pointer;
}

.af-burger__bars,
.af-burger__bars::before,
.af-burger__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--gs-text);
  content: "";
}

.af-burger__bars { position: relative; }
.af-burger__bars::before { position: absolute; top: -6px; }
.af-burger__bars::after { position: absolute; top: 6px; }

.af-burger:hover .af-burger__bars,
.af-burger:hover .af-burger__bars::before,
.af-burger:hover .af-burger__bars::after {
  background: var(--gs-primary);
}

/* -------------------------------------------------------------- Menu principal (barre bureau) */
.af-menubar {
  border-top: 1px solid var(--gs-border-light);
  background: var(--gs-bg);
}

.af-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.af-nav--bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: .25rem;
}

.af-nav--bar > li {
  position: relative;
  display: flex;
  align-items: center;
}

.af-nav__link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border: 0;
  background: transparent;
  font: 600 .9375rem/1.3 var(--gs-font);
  color: var(--gs-text) !important;
  text-decoration: none !important;
  cursor: pointer;
}

.af-nav--bar > li > .af-nav__link {
  position: relative;
  min-height: 56px;
  padding: 0 .875rem;
}

.af-nav--bar > li > .af-nav__link::after {
  position: absolute;
  right: .875rem;
  bottom: 0;
  left: .875rem;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--gs-primary);
  transform: scaleX(0);
  transition: transform .2s var(--af-ease);
  content: "";
}

.af-nav--bar > li:hover > .af-nav__link,
.af-nav--bar > li.is-open > .af-nav__link,
.af-nav--bar > li.active > .af-nav__link {
  color: var(--gs-primary) !important;
}

.af-nav--bar > li:hover > .af-nav__link::after,
.af-nav--bar > li.active > .af-nav__link::after,
.af-nav--bar > li.is-open > .af-nav__link::after {
  transform: scaleX(1);
}

/* Pastille d'icône (classes uk-icon-* de l'élément de menu) */
.af-nav__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gs-primary-soft);
  color: var(--gs-primary);
  font-size: 15px;
  line-height: 1;
}

.af-nav--bar > li.active .af-nav__icon,
.af-nav--bar > li:hover .af-nav__icon {
  background: var(--gs-primary);
  color: #fff;
}

/* Premier élément (« Accueil ») : icône seule, comme yoo_monday. */
.af-nav--bar > li.af-nav__item--icon:first-child > .af-nav__link .af-nav__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.af-nav__chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: .125rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s var(--af-ease);
}

li.is-open > .af-nav__toggle .af-nav__chevron,
li.is-open > .af-nav__subtoggle .af-nav__chevron {
  transform: translateY(1px) rotate(-135deg);
}

.af-nav__subtoggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: -.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gs-text-muted);
  cursor: pointer;
}

/* Sous-menu déroulant (carte) */
.af-nav--bar .af-nav__sub {
  position: absolute;
  top: calc(100% - 4px);
  left: 0;
  z-index: 50;
  min-width: 280px;
  max-width: 420px;
  margin: 0;
  padding: .5rem;
  list-style: none;
  border-radius: var(--gs-radius-md);
  background: var(--gs-bg);
  box-shadow: var(--gs-shadow-panel);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s var(--af-ease), visibility 0s .18s;
}

.af-nav--bar > li:hover > .af-nav__sub,
.af-nav--bar > li:focus-within > .af-nav__sub,
.af-nav--bar > li.is-open > .af-nav__sub {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .18s, transform .18s var(--af-ease), visibility 0s;
}

/* box-sizing : sans lui (UIkit 2 laisse content-box), width:100% + padding faisait déborder le fond de survol
   de 28px à droite du panneau. Le fond reste ainsi inscrit dans le padding (.5rem) du panneau, rayon < rayon du panneau. */
.af-nav--bar .af-nav__sub > li {
  margin: 0;
}

.af-nav--bar .af-nav__sub .af-nav__link {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  padding: .625rem .875rem;
  border-radius: var(--gs-radius-sm);
  font-weight: 600;
  font-size: .875rem;
}

.af-nav--bar .af-nav__sub .af-nav__link:hover,
.af-nav--bar .af-nav__sub li.active > .af-nav__link {
  background: var(--gs-bg-soft);
  color: var(--gs-primary) !important;
}

/* -------------------------------------------------------------- Sous-en-tête (pos-left : bascule Responsable / Stagiaire) */
.af-subheader {
  border-top: 1px solid var(--gs-border-light);
  background: var(--gs-bg);
}

.af-pos-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-block: .625rem;
}

.af-pos-left #switch_res_sta,
.af-pos-left .uk-subnav-pill {
  display: inline-flex;
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: var(--gs-radius-pill);
  background: var(--gs-bg-soft);
}

.af-pos-left #switch_res_sta > li,
.af-pos-left .uk-subnav-pill > li {
  margin: 0;
  padding: 0;
}

.af-pos-left #switch_res_sta > li > a,
.af-pos-left .uk-subnav-pill > li > a {
  display: inline-block;
  width: auto;
  margin: 0;
  padding: .5rem 1.125rem;
  border-radius: var(--gs-radius-pill) !important;
  background: transparent;
  color: var(--gs-text-muted);
  font-size: .8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}

.af-pos-left #switch_res_sta > li > a.active,
.af-pos-left .uk-subnav-pill > li.uk-active > a {
  background: var(--gs-primary);
  color: #fff;
  box-shadow: 0 4px 10px rgb(208 12 45 / .25);
}

/* -------------------------------------------------------------- Page (gabarit général) */
.af-page {
  flex: 1 0 auto;
  padding-block: 2rem 3rem;
}

.af-page > * + * {
  margin-top: 1.5rem;
}

.af-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  /* Disposition « parallel » de yoo_monday : modules d'une position côte à côte, largeurs égales. */
  .af-grid {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }
}

.af-main {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1025px) {
  .af-main--sidebars {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-columns: var(--af-sidebar-width, 300px);
    grid-auto-flow: column;
  }
}

.af-main__content {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
  align-content: start;
}

.af-content {
  min-width: 0;
}

/* Tableaux larges des composants : le contenu défile horizontalement au lieu d'élargir toute la page. */
@media (max-width: 1024px) {
  .af-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.af-sidebar {
  display: grid;
  gap: 1.5rem;
  align-content: start;
}

/* Modules en carte (chrome « panel ») */
.af-module {
  box-sizing: border-box;
  min-width: 0;
}

body.aeyo .af-module--box {
  padding: 1.5rem;
  border: 1px solid var(--gs-border-light);
  border-radius: var(--gs-radius-lg);
  background: var(--gs-bg);
  box-shadow: var(--gs-shadow-card);
}

body.aeyo .af-module__title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 800;
  color: var(--gs-text);
}

/* Fil d'Ariane (mod_breadcrumbs Joomla 6) */
.af-breadcrumbs {
  margin-bottom: 1rem;
  font-size: .8125rem;
}

.af-breadcrumbs ol,
.af-breadcrumbs ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.af-breadcrumbs li + li::before {
  margin-right: .5rem;
  color: var(--gs-border);
  content: "/";
}

.af-breadcrumbs a { color: var(--gs-text-muted) !important; }
.af-breadcrumbs .active,
.af-breadcrumbs li:last-child { color: var(--gs-text); font-weight: 600; }

/* -------------------------------------------------------------- Pied de page */
.af-block-footer {
  padding-block: 2.5rem;
  background: var(--gs-bg-soft);
}

.af-footer {
  position: relative;
  flex-shrink: 0;
  margin-top: 3rem;
  background: var(--gs-footer-bg);
  color: rgb(255 255 255 / .85);
  font-size: .875rem;
}

/* Signature gereso.com : arc convexe qui coiffe le pied de page. */
.af-footer__arc {
  position: absolute;
  right: 0;
  bottom: calc(100% - 1px);
  left: 0;
  height: 32px;
  overflow: hidden;
  pointer-events: none;
}

.af-footer__arc::before {
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 200%;
  border-radius: 50%;
  background: var(--gs-footer-bg);
  content: "";
}

.af-footer__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
  padding-block: 1.25rem;
}

.af-footer p {
  margin: 0;
  color: inherit;
}

.af-footer a {
  color: #fff !important;
  font-weight: 600;
}

.af-footer__right {
  text-align: right;
}

.af-totop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / .4);
  border-radius: 50%;
  color: #fff !important;
  text-decoration: none !important;
  transition: background-color .15s, border-color .15s;
}

.af-totop::before {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
  content: "";
}

.af-totop:hover {
  border-color: var(--gs-primary);
  background: var(--gs-primary);
}

@media (max-width: 767px) {
  .af-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .af-footer__right {
    text-align: center;
  }
}

/* -------------------------------------------------------------- Menu mobile (offcanvas) */
.af-offcanvas {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.af-offcanvas[hidden] {
  display: none;
}

.af-offcanvas__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(9 9 9 / .45);
  opacity: 0;
  transition: opacity .25s;
}

.af-offcanvas__bar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;
  width: min(360px, 88vw);
  padding: 1rem 1rem 2rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--gs-bg);
  box-shadow: var(--gs-shadow-panel);
  transform: translateX(100%);
  transition: transform .25s var(--af-ease);
  outline: none;
}

.af-offcanvas.is-open .af-offcanvas__backdrop { opacity: 1; }
.af-offcanvas.is-open .af-offcanvas__bar { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .af-offcanvas__bar,
  .af-offcanvas__backdrop { transition: none; }
}

.af-offcanvas__close {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gs-bg-soft);
  color: var(--gs-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.af-offcanvas__close:hover {
  background: var(--gs-primary);
  color: #fff;
}

/* Profil mobile (mod_login en position offcanvas) */
.af-userbox-mobile {
  display: grid;
  justify-items: center;
  gap: .5rem;
  margin: 0;
  padding: 1.25rem 1rem;
  border-radius: var(--gs-radius-lg);
  background: var(--gs-bg-soft);
  text-align: center;
}

.af-userbox-mobile__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gs-bg);
  color: var(--gs-primary);
  font-size: 1.5rem;
  box-shadow: var(--gs-shadow-card);
}

.af-userbox-mobile__greeting {
  font-weight: 700;
}

.af-nav--offcanvas > li {
  border-bottom: 1px solid var(--gs-border-light);
}

.af-nav--offcanvas li {
  position: relative;
}

.af-nav--offcanvas .af-nav__link {
  display: flex;
  width: 100%;
  min-height: 52px;
  padding: .5rem .25rem;
  text-align: left;
  font-size: 1rem;
}

.af-nav--offcanvas li.active > .af-nav__link {
  color: var(--gs-primary) !important;
}

.af-nav--offcanvas .af-nav__toggle {
  justify-content: flex-start;
}

.af-nav--offcanvas .af-nav__toggle .af-nav__chevron {
  margin-left: auto;
  margin-right: 12px;
}

.af-nav--offcanvas .af-nav__subtoggle {
  position: absolute;
  top: 10px;
  right: 0;
  margin: 0;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--gs-text);
}

.af-nav--offcanvas .af-nav__sub {
  display: none;
  margin: 0 0 .75rem;
  padding: 0 0 0 .75rem;
  list-style: none;
  border-left: 2px solid var(--gs-primary-soft);
}

.af-nav--offcanvas li.is-open > .af-nav__sub {
  display: block;
}

.af-nav--offcanvas .af-nav__sub .af-nav__link {
  min-height: 44px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--gs-text-muted) !important;
}

.af-nav--offcanvas .af-nav__sub li.active > .af-nav__link {
  color: var(--gs-primary) !important;
  font-weight: 700;
}

/* -------------------------------------------------------------- Gabarit B : page de connexion */
.af-login {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 29px);
  background: var(--gs-bg);
}

@media (min-width: 768px) {
  .af-login {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.af-login__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem var(--af-gutter);
}

.af-login__inner {
  width: 100%;
  max-width: 440px;
}

/* Module « Page connexion » (180) : logo + « Mon Portail formation » */
.af-login .block-logo {
  margin-bottom: 2rem;
}

.af-login .block-logo .uk-grid {
  display: grid;
  gap: 1.25rem;
  margin: 0;
}

.af-login .block-logo .uk-grid > * {
  width: auto;
  padding: 0;
}

.af-login .block-logo img {
  display: block;
  max-height: 72px;
  width: auto;
}

.af-login .block-logo h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 800;
}

.af-login .block-logo h2::after {
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 1rem;
  border-radius: 4px;
  background: var(--gs-gradient-primary);
  content: "";
}

/* Titre « Connectez-vous ! » : pas de bandeau. L'identifiant (#tm-content) passe devant le bandeau gris des
   titres de section de legacy-uikit.css (« body.aeyo [id^="tm-"] h3.uk-panel-title », spécificité 0,3,2). */
.af-login-form__title,
body.aeyo .af-login-form .uk-panel-title,
body.aeyo #tm-content .af-login-form .uk-panel-title {
  padding: 0;
  border-radius: 0;
  background: none;
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 800;
  color: var(--gs-text);
}

.af-login-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.af-login-form .control-group {
  margin-bottom: 1rem;
}

.af-login-form .link-forget-user {
  margin: -.25rem 0 1.5rem;
  padding: 0;
  list-style: none;
  text-align: right;
  font-size: .875rem;
}

.af-login-form .link-forget-user a {
  color: var(--gs-text-muted) !important;
  font-weight: 600;
}

.af-login-form .link-forget-user a:hover {
  color: var(--gs-primary) !important;
}

.af-login-form__submit .btn,
.af-login-form__submit .af-btn {
  width: 100%;
  min-height: 52px;
  font-size: 1rem;
}

.af-offline__message {
  margin-bottom: 1.5rem;
  color: var(--gs-text-muted);
}

/* Visuel (module mod_sw_bg_login en pos-right), bord gauche en arc convexe */
.af-login__visual {
  position: relative;
  display: none;
  min-height: 100%;
  overflow: hidden;
  background: var(--gs-bg); /* blanc, comme le panneau du formulaire : seule la courbe de l'image se détache */
}

@media (min-width: 768px) {
  .af-login__visual { display: block; }
}

.af-login__visual > *,
.af-login__visual .moduletable {
  height: 100%;
}

.af-login__visual .bg_random {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: .75rem;
  padding: 3rem;
  background-color: var(--gs-footer-bg);
  background-position: center;
  background-size: cover;
  clip-path: ellipse(100% 140% at 100% 50%);
}

.af-login__visual .bg_random h1:empty,
.af-login__visual .bg_random p:empty {
  display: none;
}

.af-login__visual .bg_random h1 {
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 16px rgb(0 0 0 / .35);
}

/* -------------------------------------------------------------- Page d'erreur */
.af-error {
  display: flex;
  justify-content: center;
}

.af-error__card {
  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  padding: 2.5rem;
  border-radius: var(--gs-radius-lg);
  background: var(--gs-bg);
  box-shadow: var(--gs-shadow-panel);
  text-align: center;
}

.af-error__code {
  margin: 0;
  background: var(--gs-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
}

.af-error__message {
  color: var(--gs-text-muted);
}

.af-error__debug {
  margin-top: 2rem;
  overflow-x: auto;
  text-align: left;
  font-size: .8125rem;
}

/* -------------------------------------------------------------- Rendu tmpl=component */
.af-component {
  padding-block: 1rem;
}

body.af-layout-component {
  background: var(--gs-bg);
}

/* -------------------------------------------------------------- Impression */
@media print {
  .af-header,
  .af-footer,
  .af-offcanvas,
  .af-skip { display: none !important; }

  body.aeyo { background: #fff; }
}
