/* Charte graphique Hannah Ibawi RH - Appliquée à tout le site */
:root {
  --primary: #0077b6;
  --primary-dark: #005f8a;
  --primary-light: #e8f4fc;
  --accent: #ff6b35;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 16px;
  --gradient-hero: linear-gradient(90deg, #006994 0%, #0077b6 35%, #00b4d8 70%, #90e0ef 100%);
  --gradient-hero-alt: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Lien d’évitement (accessibilité clavier) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { height: 96px; width: auto; }

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-desktop a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active { color: var(--primary); }

.nav-desktop .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-desktop a:hover .nav-icon,
.nav-desktop a.active .nav-icon { opacity: 1; }

/* Zone droite du header (cloche, langue, admin, espace candidat) — alignée horizontalement */
.nav-utils {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.nav-utils .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all 0.2s;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  box-sizing: border-box;
}

.nav-utils .icon-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-utils > .btn-primary {
  flex-shrink: 0;
  align-self: center;
  white-space: nowrap;
}

button.icon-btn {
  font-family: inherit;
}

.lang-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  margin-top: 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  min-width: 120px;
  z-index: 1005;
}
.lang-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.6rem;
}

.lang-dropdown:hover .lang-menu,
.lang-dropdown:focus-within .lang-menu {
  display: block;
}

.lang-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
}

.lang-menu a:hover {
  background: var(--gray-50);
  color: var(--primary);
}

/* Bascule FR/EN si la page n’a pas le menu 🌐 dans le header */
.hannah-lang-fallback {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10040;
  padding: 0.45rem 0.85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-size: 0.85rem;
  font-weight: 600;
}
.hannah-lang-fallback a {
  color: var(--primary);
  text-decoration: none;
}
.hannah-lang-fallback a:hover {
  text-decoration: underline;
}
.hannah-lang-fallback-sep {
  color: var(--gray-400);
  user-select: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Nav dropdown — pont ::before pour éviter le « trou » au survol (margin) qui fermait le menu */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { display: flex !important; align-items: center; gap: 0.4rem; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  margin-top: 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.5rem 0;
  min-width: 200px;
  z-index: 1005;
}
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.6rem;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--gray-50); color: var(--primary); }

.logo-link { display: block; text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: var(--white) !important;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-admin {
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  color: var(--gray-700) !important;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  border: 1px solid var(--gray-300);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-admin:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: var(--white) !important;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 119, 182, 0.25);
  transform: translateY(-1px);
}

.btn-admin .btn-admin-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.btn-admin:hover .btn-admin-icon {
  opacity: 1;
}

/* Admin en style icon-btn (même dimensions que cloche et globe dans nav-utils) */
.nav-utils .btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  box-shadow: none;
  font-size: 0;
  line-height: 0;
  color: var(--gray-500);
}

.nav-utils .btn-admin .btn-admin-label {
  display: none;
}

.nav-utils .btn-admin:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: none;
  border-color: var(--gray-300);
}

.nav-utils .btn-admin .btn-admin-icon {
  width: 20px;
  height: 20px;
}

/* Hero section (pages secondaires) */
.hero-page {
  background: var(--gradient-hero);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--white);
}

.hero-page h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-page p {
  opacity: 0.95;
  font-size: 1.05rem;
}

.hero-page img {
  max-width: 220px;
  margin-top: 1.5rem;
  border-radius: var(--radius);
}

/* Footer unifié */
.footer {
  background: var(--gray-900);
  color: var(--white);
  padding: 3rem 2rem 2rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-social h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0;
  color: var(--white);
}

@media (max-width: 1024px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }

  .footer-social .social-links {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.footer-brand strong {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  margin-top: 0.75rem;
}

.footer h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--white);
}

.footer ul { list-style: none; }

.footer ul li {
  margin-bottom: 0.5rem;
}

.footer ul a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  transition: color 0.2s;
}

.footer ul a:hover { color: var(--white); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.footer-credit {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.footer-credit a {
  color: rgba(255,255,255,0.75);
  text-decoration: underline;
}
.footer-credit a:hover {
  color: var(--white);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition: background 0.2s, transform 0.2s;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.social-links svg { width: 20px; height: 20px; }

/* Responsive header (menu burger + replis nav / nav-utils) */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem;
  }

  .header .logo-link {
    order: 1;
  }

  .header .menu-toggle {
    order: 2;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .header .nav-desktop {
    order: 3;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
  }

  .header .nav-utils {
    order: 4;
    width: 100%;
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0.5rem;
    gap: 0.5rem;
  }

  .header.nav-open .nav-desktop,
  .header.nav-open .nav-utils {
    display: flex;
  }

  .header.nav-open .nav-desktop a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
  }

  .header.nav-open .nav-desktop a:last-of-type {
    border-bottom: none;
  }

  .nav-desktop a {
    font-size: 0.9rem;
  }
}

/* Bandeau session portail (candidat / recruteur) — dans header.header ou en tête de body */
body.hb-portal-active {
  padding-top: 0;
}

/* Bandeau intégré au header : 2e ligne pleine largeur sous logo + navigation */
.header.header--portal {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0;
}

/* La 1re ligne (logo, nav, menus déroulants) doit rester au-dessus du bandeau (.hb-portal-bar z-index 1002),
   sinon les sous-menus Services / À propos passent derrière le bandeau bleu. */
.header.header--portal > .logo-link,
.header.header--portal > .nav-desktop,
.header.header--portal > .nav-utils,
.header.header--portal > .menu-toggle {
  position: relative;
  z-index: 1003;
}

.header.header--portal .hb-portal-bar {
  flex: 1 1 100%;
  min-width: 100%;
  order: 50;
  margin-left: -2rem;
  margin-right: -2rem;
  margin-bottom: -1rem;
  margin-top: 0.75rem;
  width: calc(100% + 4rem);
  max-width: none;
  align-self: stretch;
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.header.header--portal .hb-portal-bar-inner {
  font-size: 0.95rem;
  padding: 0.75rem 2rem;
}

.header.header--portal .hb-portal-name {
  font-size: 1.02rem;
}

.header.header--portal .hb-portal-email {
  max-width: min(100%, 320px);
}

@media (max-width: 768px) {
  .header.header--portal .hb-portal-bar {
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
  }

  .header.header--portal .hb-portal-bar-inner {
    padding: 0.65rem 1rem;
  }
}

a.btn-primary.hb-cta-logged {
  background: var(--primary-dark);
}

.hb-portal-bar {
  position: sticky;
  top: 0;
  z-index: 1002;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  box-shadow: 0 4px 20px rgba(0, 40, 80, 0.12);
}

.hb-portal-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.5rem;
  background: linear-gradient(105deg, #023e8a 0%, #0077b6 38%, #0096c7 100%);
  color: #f8fafc;
  font-size: 0.88rem;
  line-height: 1.45;
}

.hb-portal-bar-accent {
  display: none;
}

.hb-portal-bar-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  min-width: 0;
  flex: 1;
}

.hb-portal-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.hb-portal-name {
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hb-portal-dot {
  opacity: 0.55;
  user-select: none;
}

.hb-portal-email {
  color: #caf0f8;
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(100%, 240px);
  cursor: default;
}

.hb-portal-ref {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffe8d6;
}

.hb-portal-ref-label {
  font-weight: 500;
  opacity: 0.85;
  margin-right: 0.15rem;
}

.hb-portal-logout {
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transition: background 0.2s, border-color 0.2s;
}

.hb-portal-logout:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 640px) {
  .hb-portal-bar-inner {
    padding: 0.55rem 1rem;
  }

  .hb-portal-email {
    max-width: 100%;
  }

  .hb-portal-logout {
    width: 100%;
  }
}

/* Bandeau cookies (js/cookie-consent.js) — le chatbot utilise --hc-z 10080 (css/hannah-chatbot.css) */
/* Évite que le contenu du bas soit masqué par le bandeau fixe */
body.hannah-cookie-banner-open {
  padding-bottom: clamp(10rem, 28vh, 16rem);
}

.hannah-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10060;
  padding: 1rem 1.25rem;
  background: var(--white);
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
  border-top: 1px solid var(--gray-200);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hannah-cookie-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.hannah-cookie-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.5rem;
}

.hannah-cookie-desc {
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.55;
  margin: 0;
}

.hannah-cookie-text {
  margin-bottom: 1rem;
}

.hannah-cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.hannah-cookie-btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.hannah-cookie-btn--primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.hannah-cookie-btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.hannah-cookie-btn--secondary {
  background: var(--gray-100);
  color: var(--gray-900);
  border-color: var(--gray-300);
}

.hannah-cookie-btn--secondary:hover {
  background: var(--gray-200);
}

.hannah-cookie-btn--ghost {
  background: transparent;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.hannah-cookie-btn--ghost:hover {
  background: var(--gray-50);
}

.hannah-cookie-customize {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--gray-200);
}

.hannah-cookie-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--gray-800);
  cursor: pointer;
}

.hannah-cookie-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.hannah-cookie-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 0.65rem 0 0.85rem;
}

.hannah-cookie-hint a {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .hannah-cookie-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hannah-cookie-btn {
    width: 100%;
    text-align: center;
  }
}

/* Contenu CMS en mode « texte seul » (généré côté serveur) */
.cms-plain {
  max-width: 72ch;
}
.cms-plain p {
  margin: 0 0 0.85rem;
}
.cms-plain p:last-child {
  margin-bottom: 0;
}
