/* ==========================================================================
   Urbalya — en-tête commun à toutes les pages (site public et espace pro).
   Feuille autonome : classes préfixées, aucune dépendance à urbalya.css,
   pour cohabiter avec les styles propres du formulaire professionnel.
   ========================================================================== */

.site-header {
  --sh-ink: #0F172A;
  --sh-text: #334155;
  --sh-muted: #64748B;
  --sh-subtle: #94A3B8;
  --sh-line: rgba(15, 23, 42, 0.08);
  --sh-soft: #F8FAFC;
  --sh-blue: #2563EB;
  --sh-blue-600: #1D4ED8;
  --sh-danger: #B91C1C;
  --sh-gutter: clamp(16px, 4vw, 32px);
  --sh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: calc(12px + env(safe-area-inset-top));
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.site-header *,
.site-header *::before,
.site-header *::after {
  box-sizing: border-box;
}

.site-header a {
  text-decoration: none;
}

.site-header__container {
  position: relative;
  width: 100%;
  max-width: calc(1200px + var(--sh-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--sh-gutter);
}

.site-header__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px -14px rgba(15, 23, 42, 0.18);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  transition: box-shadow 0.3s var(--sh-ease), background-color 0.3s var(--sh-ease);
}

.site-header.is-scrolled .site-header__bar {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 16px 40px -18px rgba(15, 23, 42, 0.28);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header__bar {
    background: rgba(255, 255, 255, 0.94);
  }
}

.site-header .ico {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header .ico--sm {
  width: 16px;
  height: 16px;
}

.site-header :focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 3px;
}

/* ---------- Marque ---------- */

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--sh-ink);
}

.site-brand:hover {
  color: var(--sh-ink);
}

.site-brand__mark {
  display: block;
  width: 36px;
  height: 36px;
}

.site-brand__name {
  font-family: "Tsukimi Rounded", "Plus Jakarta Sans", ui-rounded, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
}

/* ---------- Slogan (ordinateur uniquement) ---------- */

.header-tagline {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  transform: translate(-50%, -50%);
  color: #475569;
  font-family: "Tsukimi Rounded", "Plus Jakarta Sans", ui-rounded, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.header-tagline em {
  font-style: normal;
  background: linear-gradient(100deg, #2563EB 10%, #0EA5E9 55%, #10B981 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header .brand-dots {
  display: inline-grid;
  grid-template-columns: repeat(2, 5px);
  gap: 2px;
}

.site-header .brand-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #F59E0B;
}

.site-header .brand-dots i:nth-child(2) {
  background: #EF4444;
}

.site-header .brand-dots i:nth-child(3) {
  background: #10B981;
}

.site-header .brand-dots i:nth-child(4) {
  background: #2563EB;
}

/* ---------- Actions ---------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.site-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--sh-blue);
  background: var(--sh-blue);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.3), 0 8px 20px -8px rgba(37, 99, 235, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s var(--sh-ease), background-color 0.2s var(--sh-ease), border-color 0.2s var(--sh-ease), box-shadow 0.2s var(--sh-ease), color 0.2s var(--sh-ease);
}

.site-header__cta:hover {
  border-color: var(--sh-blue-600);
  background: var(--sh-blue-600);
  color: #fff;
  transform: translateY(-1px);
}

/* Variante sobre (ex. « Annuler le dossier » dans l'espace pro). */
.site-header__cta--quiet {
  border-color: rgba(15, 23, 42, 0.14);
  background: #fff;
  color: var(--sh-ink);
  box-shadow: none;
}

.site-header__cta--quiet:hover {
  border-color: rgba(15, 23, 42, 0.24);
  background: var(--sh-soft);
  color: var(--sh-ink);
}

.site-header__cta--block {
  width: 100%;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  margin: 0;
  padding: 0 16px 0 13px;
  border: 1px solid var(--sh-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sh-ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.menu-toggle:hover {
  background: var(--sh-soft);
}

.menu-toggle .ico-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .ico-open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .ico-close {
  display: block;
}

/* ---------- Menu complet ---------- */

.mobile-menu {
  margin-top: 8px;
  padding: 10px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04), 0 30px 70px -28px rgba(15, 23, 42, 0.3);
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu nav {
  display: grid;
  gap: 2px;
}

.mobile-menu nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  color: var(--sh-ink);
  font-size: 16px;
  font-weight: 500;
}

.mobile-menu nav a:hover,
.mobile-menu nav a[aria-current="page"] {
  background: var(--sh-soft);
  color: var(--sh-ink);
}

.mobile-menu nav a small {
  display: block;
  margin-top: 1px;
  color: var(--sh-muted);
  font-size: 13px;
  font-weight: 400;
}

.mobile-menu nav a .ico {
  color: var(--sh-subtle);
}

.mobile-menu nav a.menu-link--danger,
.mobile-menu nav a.menu-link--danger:hover {
  color: var(--sh-danger);
}

.menu-title {
  margin: 10px 14px 4px;
  color: var(--sh-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.menu-title:first-child {
  margin-top: 4px;
}

.mobile-menu__actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 4px 4px;
  border-top: 1px solid var(--sh-line);
}

.site-header .store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.site-header .store-badge {
  display: inline-flex;
  border-radius: 12px;
  box-shadow: 0 10px 24px -14px rgba(15, 23, 42, 0.55);
  transition: transform 0.2s var(--sh-ease);
}

.site-header .store-badge:hover {
  transform: translateY(-2px);
}

.site-header .store-badge img {
  display: block;
  width: auto;
  height: 52px;
}

/* Sur grand écran, le menu s'ouvre en panneau sous le bouton « Menu ». */
@media (min-width: 768px) {
  .mobile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: var(--sh-gutter);
    width: 380px;
    margin-top: 0;
  }

  .mobile-menu nav a {
    padding: 11px 14px;
    font-size: 15px;
  }
}

/* Le slogan est réservé à la version ordinateur. */
@media (max-width: 1023px) {
  .header-tagline {
    display: none;
  }
}

@media (max-width: 479px) {
  .header-actions .site-header__cta {
    display: none;
  }

  .menu-toggle {
    width: 44px;
    padding: 0;
  }

  .menu-toggle__label {
    display: none;
  }

  .site-header__bar {
    height: 58px;
    padding-left: 12px;
    padding-right: 7px;
  }

  .site-brand__mark {
    width: 32px;
    height: 32px;
  }

  .site-brand__name {
    font-size: 20px;
  }

  .site-header .store-badges {
    gap: 10px;
  }

  .site-header .store-badge img {
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header__bar,
  .site-header__cta,
  .site-header .store-badge {
    transition: none;
  }
}

@media print {
  .site-header {
    display: none !important;
  }
}
