/* =========================================================
   Tunis Bourse Academy — Home page
   ========================================================= */

:root {
  --tba-primary: #004337;
  --tba-primary-dark: #002e26;
  --tba-accent: #eb8f00;
  --tba-accent-light: #FFC745;
  --tba-dark: #303030;
  --tba-card: #e0e0e0;
  --tba-text: #1a1a1a;
  --tba-text-on-dark: #ffffff;
  --tba-radius: 4px;
  --tba-row: 1170px;
  --tba-font: 'Ubuntu', 'Helvetica Neue', Arial, sans-serif;
}

.tba-home {
  font-family: var(--tba-font);
  color: var(--tba-text);
  background: #ffffff;
}

.tba-row {
  width: 100%;
  max-width: var(--tba-row);
  margin: 0 auto;
  padding: 0 30px;
  box-sizing: border-box;
}

.tba-home a { color: var(--tba-accent); text-decoration: none; }
.tba-home a:hover { text-decoration: none; }

.tba-home a.tba-video-card {
    background-color: #305540;
    color : #f18d01 !important;
    font-family: Ubuntu;
    font-size: 16px;
    text-align: center;
    font-weight: 600;
}
/* ----- Hero ---------------------------------------------- */
.content-wrapper.main-container {
	padding: 0px;
    margin: 0px;
}

.tba-hero {
  position: relative;
  min-height: 432px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  color: var(--tba-text-on-dark);
  padding: 0px;
  display: flex;
  align-items: flex-start;
}

.tba-hero-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 67, 55, .35);
  pointer-events: none;
}

.tba-hero .tba-row { 
	position: relative;
	z-index: 1;
	margin-left: 0px;
    padding-left: 0px;
    padding-right: 0px;
    max-width: 1170px;
    margin: 0 auto;
    zoom: 1;
}

.tba-hero-title {
    text-align: center;
    color: white;
    line-height: 30px;
    font-size: 22px;
    font-weight: 700;
    font-family: 'Ubuntu', Arial, Helvetica, sans-serif;
    margin-top: .75em;
    margin-bottom: .7em;
  text-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.tba-hero-card {
	padding: 45px;
    line-height: 30px;
    font-size: 14px;
    font-weight: 400;
    margin-top: 0px;
    margin-bottom: 20px;
    position: relative;
    float: left;
    width: 52%;
  max-width: 720px;
  margin: 0 auto;
      background: transparent;
  padding: 35px 45px;
  border-radius: var(--tba-radius);
}

.tba-hero-card p { padding-bottom: 35px; margin: 0 0 20px; }

.tba-accordion-toggle {
    appearance: none;
    background: transparent;
    color: #eb8f00;
    border: 0;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    border-radius: var(--tba-radius);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .2s;
    box-shadow: none;
}
#tba-accordion-toggle.tba-accordion-toggle:focus {
	box-shadow:none;
}
#tba-accordion-toggle.tba-accordion-toggle:hover {
    background-image: none;
    background-color: transparent;
    color: #eb8f00;
}
.tba-accordion-toggle .tba-plus {
    border: 2px solid #eb8f00;
    border-radius: 25px;
    color: #eb8f00;
    float: left;
    font-size: 32px;
    line-height: 24px;
    margin-right: 10px;
    margin-top: -1px;
    padding-left: 4px;
    width: 21px;
    font-family: 'Ubuntu', Arial, Helvetica, sans-serif;
    font-weight: 400;
}

/* ----- Accordion ----------------------------------------- */

.tba-accordion-section { background: var(--tba-dark); color: #fff; }
.tba-accordion-content {
  padding: 40px 0;
  font-size: 15px;
  line-height: 1.8;
}
.tba-accordion-content p { margin: 0 0 16px; }
.tba-accordion-content.is-closed { display: none; }

/* ----- Audiences ----------------------------------------- */

.tba-audiences {
  padding: 100px 0;
  background: #f8f8f8;
}

.tba-audience-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
}

.tba-audience-card {
  background: var(--tba-card);
  padding: 30px 25px;
  border-radius: var(--tba-radius);
  text-align: left;
  color: var(--tba-text) !important;
  transition: background .25s, transform .25s;
  display: block;
}

.tba-audience-card:hover {
  background: var(--tba-accent);
  color: #fff !important;
  transform: translateY(-4px);
  text-decoration: none;
}

.tba-audience-card img {
  display: block;
  width: 118px; height: auto;
  margin: 0 0 15px;
}

.tba-audience-card h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--tba-accent);
  margin: 0 0 10px;
  transition: color .25s;
}

.tba-audience-card:hover h2 { color: #fff; }

.tba-audience-card p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ----- Videos -------------------------------------------- */

.tba-videos {
  position: relative;
  padding: 110px 0 100px;
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  color: #fff;
  text-align: center;
}

.tba-videos-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  pointer-events: none;
}
.tba-videos .tba-row { position: relative; z-index: 1; }

.tba-videos-title {
	color: white;
    text-align: center;
	font-weight: 700;
	font-family: 'Ubuntu', Arial, Helvetica, sans-serif;
	margin-top: 0em;
    margin-bottom: .35em;
	margin: 0 0 20px;
  font-size: 22px;
  letter-spacing: .5px;
}
.tba-videos-subtitle {
  font-size: 14px;
  font-weight: 400;
  margin: 0 0 35px;
}

.tba-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0px;
  margin-bottom: 30px;
}

.tba-video-card {
  display: block;
  color: #fff !important;
  text-align: center;
}
.tba-video-card img {
  display: block;
  width: 100%; height: auto;
  border-radius: 0px;
  margin-bottom: 12px;
  transition: transform .25s, box-shadow .25s;
}
.tba-video-card:hover img {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.tba-video-label {
    display: block;
    font-size: 16px;
    font-weight: 400;
    padding: 0 50px;
    line-height: 30px;
}

.tba-video-grid[data-lang="ar"] .tba-video-label {
  direction: rtl;
  font-size: 16px;
}

#tba-lang-toggle.tba-lang-toggle {
  appearance: none;
  background-color: #00bd9d;
  background-image: none;
  box-shadow: none;
  border: none;
  color: #fff;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 0px;
  transition: background .2s, color .2s;
}

#tba-lang-toggle.tba-lang-toggle:focus {
	box-shadow:none;
}

#tba-lang-toggle.tba-lang-toggle:hover {
    background-image: none;
    background-color: #00bd9d;
    color: #ffffff;
}

/* ----- Header / Footer (global) -------------------------- */

.tba-header {
  background: #ffffff;
  border-bottom: 1px solid #eaeaea;
  position: relative;
  z-index: 50;
}

/* Sticky nav bar */
.tba-header-nav.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #004337 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  animation: tba-slideDown 0.25s ease;
}
.tba-header-nav.is-sticky .tba-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tba-sticky-logo {
  display: none;
}
.tba-header-nav.is-sticky .tba-sticky-logo {
  display: block;
}
.tba-header-nav.is-sticky .tba-sticky-logo img {
  max-height: 38px;
  width: auto;
}
.tba-header-nav.is-sticky .tba-menu {
  margin-left: auto;
}
.tba-header-nav.is-sticky .tba-menu li a {
  color: #fff !important;
  padding: 14px 18px;
}
.tba-header-nav.is-sticky .tba-menu li a:hover {
  color: var(--tba-accent-light) !important;
  background: transparent;
}
@keyframes tba-slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
/* Compense la hauteur du nav fixe pour eviter le saut de contenu */
body.tba-nav-sticky-active {
  padding-top: var(--tba-nav-height, 52px);
}

.tba-header-top {
  border-top: 3px solid var(--tba-accent-light);
  border-bottom: 1px solid var(--tba-primary);
  background: var(--tba-primary);
  background-image: url(/static/tba/images/image11.jpg);
}

.tba-header-top .tba-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}

.tba-logo img {
  display: block;
  max-height: 60px;
  width: auto;
}

.tba-user-actions { display: flex; gap: 10px; align-items: center; }

/* ---- INSCRIPTION / CONNEXION grey boxes (unauthenticated) ---- */
.tba-header-top .log-in, .tba-header-top .register {
	background-color: #6a6a6a;
    font-family: Ubuntu;
    width: 157px;
    height: 38px;
    text-align: center;
    display: inline-block;
    font-size: 14px;
    line-height: 38px;
    color: #FFF;
    text-decoration: none;
}

/* ---- MON TABLEAU DE BORD / DÉCONNEXION — same grey-box style (authenticated) ---- */
.tba-user-actions .tba-btn-ghost {
    background-color: #6a6a6a;
    font-family: 'Ubuntu', Arial, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 38px;
    padding: 0 14px;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
    letter-spacing: .3px;
}
.tba-user-actions .tba-btn-ghost:hover,
.tba-user-actions .tba-btn-ghost:focus {
    background-color: #555555;
    color: #ffffff !important;
    text-decoration: none !important;
}

.sstba-btn {
  display: inline-block;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  border-radius: var(--tba-radius);
  text-decoration: none !important;
  transition: background .2s, color .2s, transform .2s;
}
.sstba-btn-primary { background: var(--tba-accent); color: #fff; }
.sstba-btn-primary:hover { background: var(--tba-accent-light); color: var(--tba-primary); }
.sstba-btn-secondary { background: transparent; color: #fff; border: 1px solid #fff; }
.sstba-btn-secondary:hover { background: #fff; color: var(--tba-primary); }
.sstba-btn-ghost { background: transparent; color: #fff; }
.sstba-btn-ghost:hover { color: var(--tba-accent-light); }

/* ---- Bouton menu mobile (hamburger) ----
   Le LMS donne à tout <button> un dégradé bleu, une bordure, une ombre
   interne et, au survol / au focus, d'autres dégradés et ombres
   (button:hover:not(:disabled), spécificité 0,2,1) : on les neutralise
   ici avec une spécificité plus forte (.tba-header … = 0,3,0). */
.tba-mobile-toggle {
  display: none;
  cursor: pointer;
}
.tba-header .tba-mobile-toggle,
.tba-header .tba-mobile-toggle:hover,
.tba-header .tba-mobile-toggle:focus,
.tba-header .tba-mobile-toggle:active {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: var(--tba-radius);
  background: transparent;
  background-image: none;
  box-shadow: none;
  text-shadow: none;
}
.tba-header .tba-mobile-toggle:hover,
.tba-header .tba-mobile-toggle[aria-expanded="true"] {
  background-color: rgba(255,255,255,.12);
}
.tba-header .tba-mobile-toggle:focus-visible {
  outline: 2px solid var(--tba-accent-light);
  outline-offset: 2px;
}
.tba-mobile-toggle span {
  display: block; width: 22px; height: 2px;
  background: #fff; margin: 5px auto;
  transition: transform .2s ease, opacity .2s ease;
}
/* Menu ouvert : les 3 traits deviennent une croix */
.tba-mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tba-mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.tba-mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.tba-header-nav {
  background: #fff;
  border-bottom: 1px solid #eaeaea;
}
.tba-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
}
.tba-menu li a {
  display: block;
  padding: 16px 22px;
  color: var(--tba-primary) !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-decoration: none !important;
  transition: color .2s, background .2s;
}
.tba-menu li a:hover { color: var(--tba-accent) !important; background: #f5f5f5; }

.tba-footer {
  background: var(--tba-primary);
  color: #fff;
  padding: 35px 0;
  margin-top: 1px;
}
/* Logo Bourse à gauche, menu centré sur la page (3e colonne vide depuis le retrait du logo KAS) */
.tba-footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
}
.tba-footer .tba-footer-partner img { max-height: 165px; width: auto; display: block; }

.tba-footer-menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 18px;
  font-size: 13px;
}
.tba-footer-menu a {
  color: #fff !important; text-decoration: none !important;
}
.tba-footer-menu a:hover { color: var(--tba-accent-light) !important; }

/* =========================================================
   TBA — Course navigation tabs (LMS, Bootstrap variant)
   Aligns Course / Progress / Dates / Teams / Browse tabs
   with the MFE design: amber underline for active tab.
   HTML: <nav class="navbar course-tabs"> / <li class="nav-item active"> / <a class="nav-link">
   ========================================================= */

nav.course-tabs {
    background: #ffffff !important;
    border-bottom: 2px solid #e5e7eb !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04) !important;
}

nav.course-tabs .navbar-nav {
    gap: 0 !important;
}

nav.course-tabs .nav-link {
    color: #6b7280 !important;
    font-weight: 500 !important;
    font-family: 'Ubuntu', 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 14px !important;
    letter-spacing: .3px !important;
    border-bottom: 3px solid transparent !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    padding: 14px 20px !important;
    margin-bottom: -2px !important;
    background-color: transparent !important;
    text-decoration: none !important;
    transition: color 0.15s ease, border-bottom-color 0.15s ease !important;
    white-space: nowrap !important;
}

nav.course-tabs .nav-item.active .nav-link,
nav.course-tabs .nav-item .nav-link.active {
    color: #004337 !important;
    border-bottom: 3px solid #eb8f00 !important;
    font-weight: 700 !important;
    background-color: transparent !important;
}

nav.course-tabs .nav-item:not(.active) .nav-link:hover,
nav.course-tabs .nav-item:not(.active) .nav-link:focus {
    color: #eb8f00 !important;
    border-bottom-color: rgba(235, 143, 0, 0.40) !important;
    background-color: transparent !important;
    text-decoration: none !important;
}

/* ----- Responsive ---------------------------------------- */

@media (max-width: 992px) {
  .tba-audience-grid { grid-template-columns: repeat(2, 1fr); }
  .tba-video-grid { grid-template-columns: 1fr; }
  .tba-footer-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

@media (max-width: 768px) {
  /* En-tête tablette : logo réduit | boutons | bouton menu, sur une ligne */
  .tba-header .tba-row { padding-left: 16px; padding-right: 16px; }
  .tba-header-top .tba-row { gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .tba-logo { min-width: 0; margin-right: auto; }
  .tba-logo img { max-height: 44px; max-width: 100%; }
  .tba-mobile-toggle { display: block; flex: 0 0 auto; }

  /* Menu : replié sous l'en-tête, ouvert par le bouton menu */
  .tba-header-nav { display: none; }
  .tba-header-nav.is-open { display: block; }
  .tba-menu { flex-direction: column; }
  .tba-menu li a { padding: 14px 16px; border-bottom: 1px solid #eee; }
  /* Pas de barre collante sur mobile : le bouton menu reste dans
     l'en-tête (qui défile), un menu fixé en haut ne pourrait plus être
     refermé et cacherait la page. */
  .tba-header-nav.is-sticky { position: static; box-shadow: none; animation: none; background: #fff !important; }
  .tba-header-nav.is-sticky .tba-row { display: block; }
  .tba-header-nav.is-sticky .tba-sticky-logo { display: none; }
  .tba-header-nav.is-sticky .tba-menu li a { color: var(--tba-primary) !important; padding: 14px 16px; }
  .tba-header-nav.is-sticky .tba-menu li a:hover { color: var(--tba-accent) !important; background: #f5f5f5; }
  body.tba-nav-sticky-active { padding-top: 0; }
  .tba-hero { min-height: 380px; padding: 50px 0; }
  .tba-hero-card { padding: 25px 20px; }
  .tba-audience-grid { grid-template-columns: 1fr; }
  .tba-audiences { padding: 50px 0; }
}

@media (max-width: 600px) {
  /* En-tête téléphone : logo + bouton menu sur la 1re ligne, les 2
     boutons (INSCRIPTION / CONNEXION, ou tableau de bord / déconnexion)
     se partagent la 2e ligne. Sur une seule ligne, l'en-tête faisait
     ~700 px : le navigateur élargissait toute la page (défilement
     horizontal, page dézoomée, bouton menu hors de l'écran). */
  .tba-header-top .tba-row { flex-wrap: wrap; }
  .tba-logo { order: 1; }
  .tba-mobile-toggle { order: 2; }
  .tba-user-actions { order: 3; flex: 1 1 100%; align-items: stretch; }
  .tba-user-actions .tba-btn { flex: 1 1 0; min-width: 0; padding: 0; }
  .tba-header-top .log-in, .tba-header-top .register { display: block; width: auto; }
  .tba-user-actions .tba-btn-ghost {
    height: auto; min-height: 38px;
    padding: 6px 8px;
    font-size: 13px; line-height: 1.2;
  }
}