/* ==========================================================================
   Fatoora A-Jour — skin DNN 10 — facturation électronique
   Charte issue du logo : indigo #005060, dégradé magenta #6FD3C0 → bleu #0F766E
   ========================================================================== */

:root {
  --tl-indigo:      #005060;
  --tl-indigo-900:  #003640;
  --tl-indigo-700:  #0A6672;
  --tl-blue:        #0F766E;
  --tl-blue-dark:   #0B5E57;
  --tl-violet:      #43B3A0;
  --tl-pink:        #6FD3C0;
  --tl-grad:        linear-gradient(135deg, #6FD3C0 0%, #43B3A0 50%, #0F766E 100%);
  --tl-grad-btn:    linear-gradient(135deg, #1B8F86 0%, #0F766E 100%);
  --tl-ink:         #0B2F36;
  --tl-muted:       #4F6B70;
  --tl-line:        #DAEBE8;
  --tl-bg:          #FFFFFF;
  --tl-bg-soft:     #F0F8F7;
  --tl-radius:      14px;
  --tl-shadow:      0 10px 30px rgba(0, 80, 96, .10);
  --tl-font:        "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --tl-gutter:      clamp(16px, 3vw, 56px);
  --tl-header-h:    76px;
}

/* ---------- Base ---------- */
.tl-page { font-family: var(--tl-font); color: var(--tl-ink); background: var(--tl-bg); line-height: 1.6; -webkit-font-smoothing: antialiased; width: 100%; }
.tl-page *, .tl-page *::before, .tl-page *::after { box-sizing: border-box; }
.tl-page img { max-width: 100%; height: auto; }
.tl-page a { color: var(--tl-blue); text-decoration: none; }
.tl-page a:hover, .tl-page a:focus { color: var(--tl-blue-dark); text-decoration: underline; }
.tl-page h1, .tl-page h2, .tl-page h3, .tl-page h4 { color: var(--tl-indigo); line-height: 1.2; margin: 0 0 .6em; font-weight: 800; }
.tl-page h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.tl-page h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.tl-page h3 { font-size: 1.25rem; }
.tl-page p  { margin: 0 0 1em; }

/* Conteneur PLEIN LARGEUR par défaut (100 %) ; marges latérales fluides.
   Pour une zone centrée, ajouter la classe  tl-wrap--boxed  sur un module HTML ou une section. */
.tl-wrap { width: 100%; max-width: none; margin: 0; padding-left: var(--tl-gutter); padding-right: var(--tl-gutter); }
.tl-wrap--boxed { max-width: 1320px; margin-left: auto; margin-right: auto; }
.tl-grid { display: grid; gap: 24px; }
.tl-grid--3 { grid-template-columns: repeat(3, 1fr); }
.tl-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Panes vides masqués (sauf en mode édition, pour pouvoir y déposer des modules) */
body:not(.dnnEditState) .tl-page .DNNEmptyPane { display: none; }
body:not(.dnnEditState) .tl-page :is(.tl-cta, .tl-band, .tl-hero, .tl-section):has(> .DNNEmptyPane:only-child) { display: none; }

/* ---------- Boutons ---------- */
.tl-btn, .tl-page a.tl-btn { display: inline-block; padding: .85em 1.7em; border-radius: 999px; font-weight: 700; background: var(--tl-grad-btn); color: #fff; border: 2px solid transparent; transition: filter .2s, transform .2s, box-shadow .2s; text-decoration: none; cursor: pointer; box-shadow: 0 8px 20px rgba(15, 118, 110, .25); }
.tl-btn:hover, .tl-page a.tl-btn:hover { filter: brightness(1.08); color: #fff; text-decoration: none; transform: translateY(-1px); }
.tl-btn--ghost, .tl-page a.tl-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); box-shadow: none; }
.tl-btn--ghost:hover, .tl-page a.tl-btn--ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.tl-btn--outline, .tl-page a.tl-btn--outline { background: transparent; color: var(--tl-indigo); border-color: var(--tl-indigo); box-shadow: none; }
.tl-btn--sm, .tl-page a.tl-btn--sm { padding: .55em 1.2em; font-size: .9rem; }

/* ---------- Barre supérieure ---------- */
.tl-topbar { background: var(--tl-indigo-900); color: #BFE3DD; font-size: .82rem; }
.tl-topbar__in { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 16px; }
.tl-topbar__tools { display: flex; align-items: center; gap: 16px; }
.tl-page .tl-topbar a, .tl-page .tl-topbar .tl-link { color: #BFE3DD; }
.tl-page .tl-topbar a:hover { color: #fff; text-decoration: none; }
.tl-lang { margin-left: 8px; }

/* ---------- En-tête ---------- */
.tl-header { position: sticky; top: 0; z-index: 900; background: #fff; border-bottom: 1px solid var(--tl-line); transition: box-shadow .2s; }
.tl-header.is-stuck { box-shadow: var(--tl-shadow); }
.tl-header__in { display: flex; align-items: stretch; gap: 28px; min-height: var(--tl-header-h); }
.tl-logo { display: flex; align-items: center; flex: 0 0 auto; }
.tl-logo a { display: flex; align-items: center; }
.tl-logo img { height: 46px; width: auto; display: block; }
.tl-search { display: flex; align-items: center; font-size: .9rem; margin-left: auto; }
.tl-search input[type="text"] { border: 1px solid var(--tl-line); border-radius: 999px; padding: 8px 14px; font: inherit; background: var(--tl-bg-soft); }
.tl-header__cta { display: flex; align-items: center; }

.tl-burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; margin-left: auto; align-self: center; }
.tl-burger span { display: block; width: 24px; height: 2px; background: var(--tl-indigo); margin: 5px 0; transition: transform .2s, opacity .2s; }

/* ---------- Navigation + MÉGA MENU ---------- */
.tl-nav { flex: 1 1 auto; display: flex; }
.tl-nav ul { list-style: none; margin: 0; padding: 0; }
.tl-nav > ul { display: flex; align-items: stretch; gap: 2px; }
.tl-nav > ul > li { display: flex; align-items: center; }      /* li statique : le panneau se cale sur l'en-tête */
.tl-page .tl-nav__link, .tl-page .tl-nav > ul > li > a { display: flex; align-items: center; height: var(--tl-header-h); padding: 0 14px; color: var(--tl-indigo); font-weight: 700; font-size: .95rem; white-space: nowrap; position: relative; }
.tl-page .tl-nav > ul > li > a:hover, .tl-page .tl-nav > ul > li.active > a, .tl-page .tl-nav > ul > li.open > a { color: var(--tl-blue); text-decoration: none; }
.tl-page .tl-nav > ul > li > a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 14px; height: 3px; border-radius: 3px; background: var(--tl-grad); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.tl-page .tl-nav > ul > li:hover > a::after, .tl-page .tl-nav > ul > li.active > a::after, .tl-page .tl-nav > ul > li.is-open > a::after { transform: scaleX(1); }

/* Bouton chevron (accessibilité clavier + mobile) */
.tl-nav__toggle { width: 22px; height: 28px; margin-left: -8px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.tl-nav__toggle::before { content: ""; position: absolute; left: 6px; top: 8px; width: 7px; height: 7px; border-right: 2px solid var(--tl-indigo); border-bottom: 2px solid var(--tl-indigo); transform: rotate(45deg); transition: transform .2s; }
.tl-nav li.is-open > .tl-nav__toggle::before { transform: rotate(-135deg); top: 11px; }

/* Panneau méga menu (pleine largeur de la fenêtre) */
.tl-mega { background: #fff; }
.tl-mega__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 40px; }
.tl-mega__col { min-width: 0; }
.tl-mega__title { margin: 0 0 10px; padding-bottom: 10px; position: relative; font-weight: 800; font-size: .95rem; letter-spacing: .01em; color: var(--tl-indigo); }
.tl-mega__title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; border-radius: 3px; background: var(--tl-grad); }
.tl-page .tl-mega__title a, .tl-mega__title span { color: var(--tl-indigo); }
.tl-page .tl-mega__title a:hover { color: var(--tl-blue); text-decoration: none; }
.tl-mega__list li { margin: 0; }
.tl-page .tl-mega__list a, .tl-mega__list span { display: block; padding: 6px 0; color: var(--tl-muted); font-size: .92rem; font-weight: 500; transition: color .15s, padding-left .15s; }
.tl-page .tl-mega__list a:hover { color: var(--tl-blue); padding-left: 6px; text-decoration: none; }
.tl-mega__list li.active > a { color: var(--tl-blue); font-weight: 700; }

@media (min-width: 1100px) {
  .tl-mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 950; padding: 30px var(--tl-gutter) 36px;
             border-top: 3px solid transparent; border-image: var(--tl-grad) 1;
             box-shadow: 0 28px 50px rgba(0, 80, 96, .16); max-height: calc(100vh - 150px); overflow-y: auto;
             visibility: hidden; opacity: 0; transform: translateY(8px);
             transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s; }
  .tl-nav li:hover > .tl-mega, .tl-nav li:focus-within > .tl-mega, .tl-nav li.is-open > .tl-mega
    { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .tl-nav__toggle { pointer-events: none; }   /* au survol sur ordinateur ; reste focusable au clavier */
}

/* ---------- Héro ---------- */
.tl-hero { color: #E2F3F0; padding: 84px 0 96px; position: relative; overflow: hidden;
  background: radial-gradient(900px 520px at 88% -10%, rgba(111,211,192,.38), transparent 60%),
              radial-gradient(760px 520px at 100% 105%, rgba(15,118,110,.50), transparent 60%),
              linear-gradient(135deg, var(--tl-indigo) 0%, var(--tl-indigo-900) 100%); }
.tl-hero__in { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.tl-page .tl-hero h1, .tl-page .tl-hero h2 { color: #fff; }
.tl-hero p { font-size: 1.12rem; color: #C4E5DF; max-width: 62ch; }
.tl-hero__visual img { border-radius: var(--tl-radius); box-shadow: 0 22px 60px rgba(0,0,0,.40); }

/* ---------- Chiffres clés ---------- */
.tl-band { background: var(--tl-bg-soft); border-bottom: 1px solid var(--tl-line); padding: 34px 0; }
.tl-band > .tl-wrap, .tl-band.tl-wrap { text-align: center; }
.tl-kpi__value { display: inline-block; font-size: 2.3rem; font-weight: 800; line-height: 1.1; background: var(--tl-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tl-kpi__label { color: var(--tl-muted); font-size: .92rem; }

/* ---------- Sections ---------- */
.tl-section { padding: 76px 0; }
.tl-section .tl-grid { margin-top: 34px; }
.tl-cta { background: linear-gradient(120deg, var(--tl-indigo) 0%, var(--tl-indigo-700) 55%, var(--tl-blue) 130%); color: #fff; text-align: center; padding: 60px 0; }
.tl-page .tl-cta h2, .tl-page .tl-cta h3 { color: #fff; }
.tl-cta p { color: #D1ECE7; }

/* ---------- Pages internes ---------- */
.tl-pagehead { background: var(--tl-bg-soft); border-bottom: 1px solid var(--tl-line); padding: 28px 0 20px; position: relative; }
.tl-pagehead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--tl-grad); }
.tl-breadcrumb { font-size: .85rem; color: var(--tl-muted); margin-bottom: 6px; }
.tl-breadcrumb a { color: var(--tl-muted); }
.tl-main { padding: 44px 0 64px; }
.tl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; }
.tl-layout:has(> .tl-layout__side.DNNEmptyPane) { grid-template-columns: minmax(0, 1fr); }

/* ---------- Pied de page ---------- */
.tl-footer { background: var(--tl-indigo); color: #A9D5CE; padding-top: 52px; }
.tl-footer__brand { padding-bottom: 28px; }
.tl-footer__brand img { height: 56px; width: auto; display: block; }
.tl-page .tl-footer h3, .tl-page .tl-footer h4 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.tl-page .tl-footer a { color: #A9D5CE; }
.tl-page .tl-footer a:hover { color: #fff; }
.tl-footer ul { list-style: none; padding: 0; margin: 0; }
.tl-footer li { margin-bottom: 8px; }
.tl-footer__bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 40px; padding: 18px 0; font-size: .85rem; }
.tl-footer__bottom-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Compatibilité administration DNN (barre d'édition / Personabar) ---------- */
.tl-page { overflow: visible; }

/* ---------- RTL (arabe) ---------- */
[dir="rtl"] .tl-page { text-align: right; }
[dir="rtl"] .tl-search { margin-left: 0; margin-right: auto; }
[dir="rtl"] .tl-burger { margin-left: 0; margin-right: auto; }

/* ---------- Mobile / tablette : menu en accordéon ---------- */
@media (max-width: 1099px) {
  .tl-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .tl-grid--3 { grid-template-columns: 1fr; }
  .tl-hero__in { grid-template-columns: 1fr; }
  .tl-layout { grid-template-columns: 1fr; }
  .tl-burger { display: block; }
  .tl-header__in { flex-wrap: wrap; min-height: 64px; gap: 12px; }
  .tl-logo img { height: 40px; }
  .tl-nav { display: none; flex-basis: 100%; order: 3; padding-bottom: 12px; }
  .tl-nav.is-open { display: block; }
  .tl-nav > ul { flex-direction: column; }
  .tl-nav > ul > li { flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid var(--tl-line); }
  .tl-page .tl-nav__link, .tl-page .tl-nav > ul > li > a { height: 48px; flex: 1 1 auto; }
  .tl-page .tl-nav > ul > li > a::after { display: none; }
  .tl-nav__toggle { width: 48px; height: 48px; margin-left: 0; }
  .tl-nav__toggle::before { left: 20px; top: 19px; }
  .tl-nav li.is-open > .tl-nav__toggle::before { top: 23px; }
  .tl-mega { display: none; flex-basis: 100%; padding: 4px 0 14px 12px; }
  .tl-nav li.is-open > .tl-mega { display: block; }
  .tl-mega__grid { grid-template-columns: 1fr; gap: 18px; }
  .tl-search, .tl-header__cta { display: none; }
  .tl-topbar__tag { display: none; }
}
@media (max-width: 575px) {
  .tl-grid--4 { grid-template-columns: 1fr; }
  .tl-hero { padding: 56px 0 64px; }
  .tl-section { padding: 48px 0; }
}
@media (prefers-reduced-motion: reduce) { .tl-page * { transition: none !important; } }


/* ===== CONTENEURS (fusionné depuis container.css : plus de chemin fixe) ===== */
/* TraLIS — conteneur "Standard" (pleine largeur, compact) — v01.01.00
   Une seule carte autour du module ; les actions du module (Modifier / Admin / Déplacer)
   sont regroupées derrière un engrenage en haut à droite (créé par js/tralis-app.js). */
.tl-card { width: 100%; background: #fff; border: 1px solid #DAEBE8; border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 80, 96, .05); margin-bottom: 16px; position: relative; }
.tl-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 12px 12px 0 0; background: linear-gradient(135deg, #6FD3C0 0%, #43B3A0 50%, #0F766E 100%); }

.tl-card__head { padding: 12px 72px 10px 16px; border-bottom: 1px solid #DAEBE8; background: #F0F8F7; border-radius: 12px 12px 0 0; }
.tl-page .tl-card__title, .tl-card .tl-card__title { margin: 0; font-size: 1rem; line-height: 1.3; font-weight: 800; color: #005060; }
.tl-card__titletext { color: #005060; }
.tl-card__head:has(.tl-card__titletext:empty) { display: none; }

.tl-card__body { padding: 12px 16px 16px; }

/* Outils (engrenage + réduire/agrandir) */
.tl-card__tools { position: absolute; top: 8px; right: 10px; z-index: 20; display: flex; align-items: center; gap: 6px; }
.tl-card__tools:not(:has(a, button, input)) { display: none; }

.tl-actions { position: relative; }
.tl-actions__btn { width: 30px; height: 30px; border: 1px solid #DAEBE8; border-radius: 9px; background: #fff; color: #005060; display: grid; place-items: center; cursor: pointer; padding: 0; }
.tl-actions__btn:hover, .tl-actions.is-open .tl-actions__btn { background: #F0F8F7; }
.tl-actions__btn:focus-visible { outline: 2px solid #0F766E; outline-offset: 2px; }

/* Sans JavaScript, les liens restent visibles ; avec JavaScript ils sont dans un menu déroulant */
.tl-actions.is-ready .tl-actions__menu { display: none; position: absolute; right: 0; top: 36px; min-width: 190px; padding: 6px; background: #fff; border: 1px solid #DAEBE8; border-radius: 12px; box-shadow: 0 16px 36px rgba(0, 80, 96, .22); z-index: 30; }
.tl-actions.is-ready.is-open .tl-actions__menu { display: block; }
.tl-actions__menu ul { list-style: none; margin: 0; padding: 0; }
.tl-actions__menu a { display: block; padding: 7px 12px; border-radius: 8px; color: #0B2F36; font-size: .85rem; font-weight: 600; text-decoration: none; }
.tl-actions__menu a:hover { background: #F0F8F7; color: #0F766E; text-decoration: none; }
.tl-actions__menu img { vertical-align: middle; margin-right: 6px; }

/* ---- Conteneur "Standard" : sans cadre (les modules TraLIS ont déjà leur propre carte) ---- */
.tl-card--bare { background: transparent; border: 0; box-shadow: none; border-radius: 0; margin-bottom: 12px; }
.tl-card--bare::before { display: none; }
/* Le titre du module répète le titre de la page : masqué visuellement, gardé pour les lecteurs d'écran */
.tl-card--bare > .tl-card__head { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.tl-card--bare > .tl-card__body { padding: 0; }
/* Outils (engrenage / réduire) : flottent en haut à droite, sans bande vide */
.tl-card--bare > .tl-card__tools { top: 4px; right: 4px; }
.tl-card--bare > .tl-card__tools .tl-actions__btn { width: 26px; height: 26px; background: rgba(255,255,255,.9); }

