/* ═══════════════════════════════════════════════════════════════
   HOPPI NAVBAR — Composant réutilisable
   Palette: charcoal #28536B, air #7EA8BE, peach #F7E3AF,
            pink #EEB1D5, latte #FFF5E1
   ═══════════════════════════════════════════════════════════════ */

:root {
  --h-charcoal: #28536B;
  --h-air: #7EA8BE;
  --h-peach: #F7E3AF;
  --h-pink: #EEB1D5;
  --h-pink-dark: #e69abf;
  --h-latte: #FFF5E1;
  --h-ink: #1B2B3A;
  --h-ink-soft: #425568;
  --h-rule: #E8ECEF;
  --h-white: #ffffff;
  --h-display: 'Baloo 2', 'Baloo', system-ui, sans-serif;
  --h-body: 'Inter', -apple-system, sans-serif;
  /* --h-nav-h est declare dans globals.css (inline, pas de FOUC).
     Si tu changes la hauteur de .h-nav, met-le a jour LA-bas. */
}

/* Masquer la navbar Webflow historique quand la nouvelle est présente */
body:has(.h-nav) > .layout > .navbar { display: none !important; }

/* Authentifie : "Site principal" devient redondant (l'user est deja dans l'app)
   Toggle gere par NavbarAuth (.toggle('h-authed', isAuthenticated)) */
body.h-authed .h-nav-menu,
body.h-authed .h-nav-mobile-link-site { display: none !important; }
/* Sans .h-nav-menu (flex:1), pousser brand a gauche et right a droite */
body.h-authed .h-nav-brand { margin-right: auto; }

/* ─────────── Navbar wrapper ─────────── */
.h-nav {
  position: fixed;
  top: 16px; left: 16px; right: 16px;
  z-index: 1000;
  font-family: var(--h-body);
  pointer-events: none;
}
.h-nav-inner {
  pointer-events: auto;
  background: white;
  border-radius: 100px;
  padding: 10px 12px 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1340px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(40,83,107,0.08),
              inset 0 0 0 1px rgba(40,83,107,0.04);
  transition: box-shadow 0.25s ease;
}
.h-nav-inner:hover {
  box-shadow: 0 8px 28px rgba(40,83,107,0.1),
              inset 0 0 0 1px rgba(40,83,107,0.06);
}

/* ─────────── Logo ─────────── */
.h-nav-logo {
  display: flex; align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  height: 40px;
}
.h-nav-logo img {
  height: 40px;
  width: auto;
  display: block;
  transition: transform 0.4s cubic-bezier(.34, 1.56, .64, 1);
  transform-origin: center 65%;
}
.h-nav-logo:hover img {
  transform: rotate(-8deg) scale(1.08);
}
.h-nav-logo:active img {
  transform: rotate(-8deg) scale(0.96);
  transition-duration: 0.12s;
}

/* ─────────── Brand (jobboard variant: logo + title) ─────────── */
.h-nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.h-nav-divider {
  width: 1px;
  height: 22px;
  background: rgba(40,83,107,0.12);
}
.h-nav-title {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--h-charcoal);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .h-nav-title { font-size: 13px; }
  .h-nav-divider { height: 18px; }
}

/* ─────────── Menu links ─────────── */
.h-nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-start;
  padding-left: 16px;
}
.h-nav-link {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--h-charcoal);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 100px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.005em;
}
.h-nav-link:hover { background: var(--h-latte); }
.h-nav-link.active { background: var(--h-latte); }
.h-nav-link svg {
  width: 10px; height: 10px;
  transition: transform 0.25s ease;
  opacity: 0.6;
}
.h-nav-link[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ─────────── Dropdowns ─────────── */
.h-nav-item {
  position: relative;
}
.h-nav-dropdown {
  position: absolute;
  top: calc(100% + 20px);
  left: 50%;
  transform: translate(-50%, -6px);
  min-width: 260px;
  background: white;
  border-radius: 20px;
  padding: 10px;
  box-shadow: 0 12px 32px rgba(40,83,107,0.12),
              inset 0 0 0 1px rgba(40,83,107,0.06);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.25s ease, visibility 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.h-nav-item.open .h-nav-dropdown,
.h-nav-item:hover .h-nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
/* Zone invisible pour garder le hover continu entre le bouton et le dropdown */
.h-nav-dropdown::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0; right: 0;
  height: 20px;
}
.h-nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-family: var(--h-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--h-charcoal);
  text-decoration: none;
  border-radius: 12px;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.h-nav-dropdown a:hover { background: var(--h-latte); }
.h-nav-dropdown a .emoji {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ─────────── Right side CTAs ─────────── */
.h-nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.h-nav-login {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--h-charcoal);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 100px;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.h-nav-login:hover { background: var(--h-latte); }

.h-nav-signup {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--h-charcoal);
  background: var(--h-pink);
  border: none;
  padding: 12px 22px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.h-nav-signup {
  cursor: pointer;
}
.h-nav-signup:hover {
  background: var(--h-pink-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(238,177,213,0.4);
}

.h-nav-login {
  cursor: pointer;
  background: transparent;
  border: none;
}

/* ─────────── Authenticated state ─────────── */
.h-nav-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 2px 2px;
  margin-right: 4px;
}
.h-nav-avatar {
  width: 34px; height: 34px;
  border-radius: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(238,177,213,0.35), rgba(247,227,175,0.35));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(238,177,213,0.25);
  flex-shrink: 0;
}
.h-nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.h-nav-avatar span {
  font-family: var(--h-display);
  font-weight: 800;
  font-size: 12px;
  color: var(--h-charcoal);
}
.h-nav-profile-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.h-nav-profile-name {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--h-charcoal);
  letter-spacing: -0.005em;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h-nav-logout {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--h-display);
  font-weight: 600;
  font-size: 11px;
  color: rgba(40,83,107,0.45);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease;
}
.h-nav-logout:hover { color: var(--h-charcoal); }

.h-nav-myspace {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--h-charcoal);
  text-decoration: none;
  background: var(--h-pink);
  padding: 10px 16px 10px 18px;
  border-radius: 100px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.h-nav-myspace svg { width: 14px; height: 14px; }
.h-nav-myspace:hover {
  background: var(--h-pink-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(238,177,213,0.4);
}

@media (max-width: 900px) {
  .h-nav-profile-info { display: none; }
  .h-nav-profile { margin-right: 0; padding: 0; }
}

/* ─────────── Burger ─────────── */
.h-nav-burger {
  display: none;
  background: var(--h-charcoal);
  border: none;
  width: 42px; height: 42px;
  border-radius: 100%;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.h-nav-burger:hover { background: var(--h-ink); }
.h-nav-burger svg { width: 18px; height: 18px; color: white; }

/* ─────────── Mobile menu ─────────── */
.h-nav-mobile {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--h-latte);
  /* Au-dessus de .h-nav (1000) pour que le close X soit cliquable */
  z-index: 1050;
  padding: 96px 24px 40px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.h-nav-mobile-close {
  position: absolute;
  top: 22px; right: 22px;
  width: 44px; height: 44px;
  border-radius: 100%;
  background: white;
  border: 1px solid rgba(40,83,107,0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--h-charcoal);
  transition: background 0.2s ease, transform 0.15s ease;
  z-index: 1;
}
.h-nav-mobile-close:hover { background: var(--h-peach); transform: rotate(90deg); }
.h-nav-mobile-close svg { width: 20px; height: 20px; }
.h-nav-mobile.open {
  opacity: 1;
  visibility: visible;
}
.h-nav-mobile-menu {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-bottom: 32px;
}
.h-nav-mobile-link {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--h-charcoal);
  text-decoration: none;
  padding: 16px 20px;
  border-radius: 16px;
  transition: background 0.2s ease;
}
.h-nav-mobile-link:hover,
.h-nav-mobile-link:active {
  background: white;
}
.h-nav-mobile-ctas {
  display: flex; flex-direction: column;
  gap: 10px;
  padding-top: 24px;
  border-top: 1px dashed rgba(40,83,107,0.2);
}
.h-nav-mobile-login,
.h-nav-mobile-signup {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 16px;
  padding: 16px;
  border-radius: 100px;
  text-align: center;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.h-nav-mobile-login {
  background: white;
  color: var(--h-charcoal);
  border: 1px solid var(--h-rule);
}
.h-nav-mobile-signup {
  background: var(--h-charcoal);
  color: white;
}

/* ─────────── Responsive ─────────── */
@media (max-width: 980px) {
  .h-nav-menu { display: none; }
  .h-nav-login { display: none; }
  /* "Mon espace" et "S'inscrire" sont relayés au mobile menu — evite l'overflow */
  .h-nav-myspace { display: none; }
  .h-nav-signup { display: none; }
  .h-nav-inner {
    padding: 10px 14px 10px 20px;
    justify-content: space-between;
  }
  .h-nav-burger { display: flex; }
  .h-nav-mobile { display: block; }
}

/* Cacher le titre sur les tres petits ecrans */
@media (max-width: 380px) {
  .h-nav-title { display: none; }
  .h-nav-divider { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   MODAL S'INSCRIRE
   ═══════════════════════════════════════════════════════════════ */

.h-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.h-modal.open {
  opacity: 1;
  visibility: visible;
}
.h-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27,43,58,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.h-modal-card {
  position: relative;
  background: white;
  border-radius: 28px;
  padding: 40px 36px 36px;
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 40px 80px rgba(0,0,0,0.25);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.35s cubic-bezier(.22,1,.36,1);
}
.h-modal.open .h-modal-card {
  transform: translateY(0) scale(1);
}
.h-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border: none;
  background: var(--h-latte);
  border-radius: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--h-charcoal);
  transition: background 0.2s ease;
  font-size: 16px;
}
.h-modal-close:hover { background: var(--h-peach); }
.h-modal-kicker {
  font-family: var(--h-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--h-pink);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.h-modal-title {
  font-family: var(--h-display);
  font-weight: 800;
  font-size: clamp(26px, 3.5vw, 32px);
  line-height: 1.1;
  color: var(--h-charcoal);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.h-modal-lede {
  font-family: var(--h-body);
  font-size: 15px;
  color: var(--h-ink-soft);
  line-height: 1.5;
  margin: 0 0 24px;
}

.h-modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.h-modal-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--h-latte);
  border: 1.5px solid transparent;
  border-radius: 18px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}
.h-modal-option:hover {
  border-color: var(--h-charcoal);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(40,83,107,0.08);
}
.h-modal-option.opt-pink { background: #fbecf4; }
.h-modal-option.opt-peach { background: #fef3de; }
.h-modal-option.opt-air { background: #eef4f8; }
.h-modal-option-emoji {
  width: 48px; height: 48px;
  background: white;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(40,83,107,0.06);
}
.h-modal-option-body {
  flex: 1;
  min-width: 0;
}
.h-modal-option-name {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--h-charcoal);
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}
.h-modal-option-desc {
  font-family: var(--h-body);
  font-size: 13px;
  color: var(--h-ink-soft);
  margin: 0;
  line-height: 1.4;
}
.h-modal-option-arrow {
  font-family: var(--h-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--h-charcoal);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.h-modal-option:hover .h-modal-option-arrow { transform: translateX(4px); }

.h-modal-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--h-rule);
  font-family: var(--h-body);
  font-size: 13px;
  color: var(--h-ink-soft);
}
.h-modal-foot a {
  color: var(--h-charcoal);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--h-charcoal);
  padding-bottom: 1px;
  transition: opacity 0.15s ease;
}
.h-modal-foot a:hover { opacity: 0.7; }

@media (max-width: 560px) {
  .h-modal-card { padding: 32px 24px 24px; border-radius: 24px; }
  .h-modal-option { padding: 14px 16px; gap: 12px; }
  .h-modal-option-emoji { width: 42px; height: 42px; font-size: 20px; }
}

/* Block scroll when modal/mobile open */
body.h-no-scroll { overflow: hidden; }
