/* ============================================================
   CEN V140 — CONNEXION RECENTRÉE + VRAI HEADER/FOOTER PUBLIC
   Couche finale : corrige les conflits historiques sans supprimer
   les fonctionnalités existantes.
   ============================================================ */
:root{
  --cen140-blue:#0b5fa8;
  --cen140-blue-dark:#063762;
  --cen140-blue-deep:#052b4d;
  --cen140-gold:#f2c230;
  --cen140-line:#d6e3ec;
  --cen140-page:#f4f8fc;
  --cen140-ink:#172f42;
  --cen140-muted:#526b7d;
  --cen140-edge:clamp(20px,3vw,48px);
  --cen140-login-max:520px;
}

/* ----- Les vraies barres de l'accueil restent fixes partout, login compris ----- */
@media (min-width:981px){
  body.public-layout .site-header.public-header.cen-institutional-header{
    position:fixed!important;top:0!important;left:0!important;right:0!important;
    width:100%!important;height:var(--public-header-h)!important;min-height:var(--public-header-h)!important;max-height:var(--public-header-h)!important;
    z-index:4000!important;transform:none!important;transition:none!important;animation:none!important;
  }
  body.public-layout .top-nav.public-nav.cen-public-nav{
    position:fixed!important;top:var(--public-header-h)!important;left:0!important;right:0!important;
    width:100%!important;height:var(--public-nav-h)!important;min-height:var(--public-nav-h)!important;max-height:var(--public-nav-h)!important;
    z-index:3990!important;transform:none!important;transition:none!important;animation:none!important;
  }
  body.public-layout .main-content.public-content{
    padding-top:calc(var(--public-header-h) + var(--public-nav-h) + 28px)!important;
  }
}

/* ----- Connexion : aucune poussée latérale, flash + carte dans le même axe ----- */
body.page-login{
  min-height:100dvh!important;margin:0!important;padding:0!important;background:linear-gradient(180deg,#f7fbfe,#eef5fa)!important;
  display:block!important;overflow-x:hidden!important;color:var(--cen140-ink)!important;
}
body.page-login::before{display:none!important}
body.page-login .main-content.public-content{
  width:100%!important;max-width:none!important;margin:0!important;
  display:grid!important;grid-template-columns:minmax(0,var(--cen140-login-max))!important;justify-content:center!important;align-content:start!important;
  gap:14px!important;padding-left:16px!important;padding-right:16px!important;padding-bottom:38px!important;
  min-height:clamp(520px,64vh,760px)!important;background:transparent!important;
}
body.page-login .main-content.public-content>*{
  width:100%!important;max-width:var(--cen140-login-max)!important;margin-left:auto!important;margin-right:auto!important;
}
body.page-login .flash-zone{
  order:0!important;width:100%!important;max-width:var(--cen140-login-max)!important;margin:0!important;gap:8px!important;
}
body.page-login .flash-zone .flash{
  width:100%!important;margin:0!important;border:1px solid #c9dce9!important;border-left:4px solid var(--cen140-blue)!important;
  background:#eef7fd!important;color:#25485f!important;box-shadow:none!important;line-height:1.5!important;
}
body.page-login .cen-login-v138{
  order:1!important;width:100%!important;max-width:var(--cen140-login-max)!important;margin:0 auto!important;display:block!important;
}
body.page-login .cen-login-card{
  width:100%!important;max-width:none!important;margin:0!important;padding:30px clamp(20px,3vw,34px) 26px!important;
  background:#fff!important;border:1px solid #cfdfe9!important;border-radius:20px!important;box-shadow:0 18px 48px rgba(4,43,77,.10)!important;
}
body.page-login .cen-login-heading{margin:0 0 22px!important;text-align:center!important}
body.page-login .cen-login-kicker{
  display:inline-block!important;margin-bottom:7px!important;color:var(--cen140-blue)!important;font-size:12px!important;font-weight:900!important;
  letter-spacing:.09em!important;text-transform:uppercase!important;
}
body.page-login .cen-login-heading h1{color:var(--cen140-blue-dark)!important;font-size:clamp(29px,3vw,36px)!important;margin:0!important}
body.page-login .cen-login-heading p{color:var(--cen140-muted)!important;margin:7px 0 0!important}
body.page-login .cen-login-brand{display:none!important}

/* Un seul contour propre quand l'utilisateur écrit. */
body.page-login .cen-login-input{
  border:1.5px solid #b9cedd!important;border-radius:12px!important;box-shadow:none!important;outline:0!important;background:#fff!important;
}
body.page-login .cen-login-input:focus-within{
  border-color:var(--cen140-blue)!important;box-shadow:0 0 0 3px rgba(11,95,168,.10)!important;outline:0!important;
}
body.page-login .cen-login-input input,
body.page-login .cen-login-input input:focus,
body.page-login .cen-login-input input:focus-visible{
  border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;color:#173247!important;
  -webkit-appearance:none!important;appearance:none!important;
}
body.page-login input:-webkit-autofill,
body.page-login input:-webkit-autofill:hover,
body.page-login input:-webkit-autofill:focus{
  -webkit-text-fill-color:#173247!important;-webkit-box-shadow:0 0 0 1000px #fff inset!important;box-shadow:0 0 0 1000px #fff inset!important;
  transition:background-color 9999s ease-out 0s!important;
}
body.page-login .cen-login-password-toggle{
  width:42px!important;height:42px!important;min-width:42px!important;border:0!important;border-radius:10px!important;background:#edf5fa!important;
  color:var(--cen140-blue-dark)!important;box-shadow:none!important;outline:0!important;
}
body.page-login .cen-login-submit{background:linear-gradient(135deg,var(--cen140-blue-dark),var(--cen140-blue))!important;color:#fff!important}
body.page-login .cen-login-links{gap:10px!important;flex-wrap:wrap!important}.cen-login-links a{color:var(--cen140-blue)!important}

/* Le footer de connexion EST maintenant le vrai footer complet de l'accueil. */
body.page-login .cen-footer-v137{
  display:block!important;position:relative!important;width:100%!important;max-width:none!important;margin:0!important;
  padding:34px var(--cen140-edge) 18px!important;background:linear-gradient(120deg,var(--cen140-blue-deep),var(--cen140-blue-dark) 65%,#084f91)!important;
  border-top:5px solid var(--cen140-gold)!important;color:#fff!important;
}
body.public-layout .cen-footer-v137{padding-left:var(--cen140-edge)!important;padding-right:var(--cen140-edge)!important}
body.public-layout .cen-footer-v137 .cen-footer-grid,
body.public-layout .cen-footer-v137 .footer-bottom{width:100%!important;max-width:1440px!important;margin-left:auto!important;margin-right:auto!important}
body.page-login .cen-footer-v137 :is(h3,p,a,span,small,b){color:#fff!important}
body.page-login .cen-footer-v137 .footer-bottom{position:static!important;inset:auto!important;transform:none!important}

/* Pas de ticker/boutons flottants dans le formulaire de connexion. */
body.page-login .enhanced-ticker,body.page-login .install-pwa-button,body.page-login .floating-help{display:none!important}

/* ----- Contraste général : renforcer les zones claires sans casser les blocs bleus ----- */
body.public-layout .public-content > :is(p,ul,ol,dl){color:var(--cen140-ink)!important}
body.public-layout .public-content :where(.card,.panel-card,.activity-card,.home-intro-card,.cen-login-card,.cen-payment-channel,.cen-payment-config,.table-wrap,.form,.form-grid) :is(p,li,dd,dt,label,td,small){color:var(--cen140-ink)!important}
body.public-layout .public-content :where(.card,.panel-card,.activity-card,.home-intro-card,.cen-login-card,.cen-payment-channel,.cen-payment-config,.table-wrap,.form,.form-grid) :is(.muted,.help,.hint,.subtle,.description,.meta,.secondary-text){color:var(--cen140-muted)!important}
body.public-layout .public-content :is(h1,h2,h3,h4,strong){text-wrap:pretty}
body.public-layout .public-content :is(input,select,textarea){color:#173247!important;background-color:#fff!important}
body.public-layout .public-content :is(input,textarea)::placeholder{color:#728696!important;opacity:1!important}
body.public-layout .cen-footer-v137 :is(p,li,dd,dt,label,td,small,strong,h1,h2,h3,h4,span,a){color:#fff!important}

/* Même nettoyage de lisibilité dans les écrans administratifs clairs. */
body.admin-layout .workspace-content :where(.card,.panel-card,.kpi-card,.module-guide,.table-wrap,.form,.form-grid) :is(p,li,dd,dt,label,td,small){color:#2f4b5f!important}
body.admin-layout .workspace-content :where(.card,.panel-card,.kpi-card,.module-guide,.table-wrap,.form,.form-grid) :is(.muted,.help,.hint,.subtle,.description,.meta,.secondary-text){color:#5b7283!important}
body.admin-layout .workspace-content :is(input,select,textarea){color:#173247!important;background-color:#fff!important}
body.admin-layout .workspace-content :is(input,textarea)::placeholder{color:#718695!important;opacity:1!important}

/* ----- Responsive téléphone : deux barres stables + connexion pleine largeur utile ----- */
@media (max-width:980px){
  body.public-layout .public-mobile-bar{
    display:grid!important;position:fixed!important;top:0!important;left:0!important;right:0!important;z-index:4200!important;
    height:58px!important;min-height:58px!important;max-height:58px!important;transform:none!important;transition:none!important;
  }
  body.public-layout .site-header.public-header.cen-institutional-header{
    position:fixed!important;top:58px!important;left:0!important;right:0!important;z-index:4100!important;
    width:100%!important;height:72px!important;min-height:72px!important;max-height:72px!important;transform:none!important;transition:none!important;
  }
  body.public-layout .top-nav.public-nav.cen-public-nav{
    position:fixed!important;top:0!important;left:0!important;bottom:0!important;height:100dvh!important;max-height:none!important;min-height:0!important;
    z-index:4300!important;
  }
  body.public-layout .main-content.public-content{padding-top:146px!important}
  body.page-login .main-content.public-content{grid-template-columns:minmax(0,560px)!important;padding-left:12px!important;padding-right:12px!important;padding-bottom:28px!important;min-height:0!important}
  body.page-login .cen-login-card{padding:24px 18px 22px!important;border-radius:17px!important}
  body.page-login .flash-zone{margin-top:0!important}
  body.page-login .cen-footer-v137{padding:28px 18px 16px!important}
  body.page-login .cen-footer-grid{grid-template-columns:1fr!important}
}

@media (max-width:560px){
  body.public-layout .main-content.public-content{padding-top:142px!important}
  body.page-login .main-content.public-content{padding-left:10px!important;padding-right:10px!important;padding-bottom:22px!important;gap:10px!important}
  body.page-login .cen-login-card{padding:21px 14px 19px!important;border-radius:15px!important;box-shadow:0 12px 30px rgba(4,43,77,.08)!important}
  body.page-login .cen-login-heading h1{font-size:28px!important}
  body.page-login .cen-login-links{flex-direction:column!important;align-items:stretch!important;text-align:center!important}
  body.page-login .cen-login-links a{display:block!important;width:100%!important;padding:9px!important}
  body.page-login .cen-login-back{margin-top:12px!important}
  body.page-login .cen-footer-v137{margin-top:0!important}
}

@media print{
  body.public-layout .site-header.public-header.cen-institutional-header,
  body.public-layout .top-nav.public-nav.cen-public-nav,
  body.public-layout .public-mobile-bar,
  body.public-layout .cen-footer-v137{display:none!important}
  body.public-layout .main-content.public-content{padding-top:0!important}
}
