/* Noxpager — Thème global (dark / light) + composants partagés */

:root,
[data-theme="dark"] {
  --nox-bg: #030508;
  --nox-bg-2: #0a1018;
  --nox-bg-3: #111822;
  --nox-surface: rgba(255, 255, 255, 0.03);
  --nox-surface-hover: rgba(255, 255, 255, 0.06);
  --nox-cyan: #00e5ff;
  --nox-cyan-dim: rgba(0, 229, 255, 0.3);
  --nox-cyan-glow: rgba(0, 229, 255, 0.45);
  --nox-text: #eef2f8;
  --nox-muted: rgba(238, 242, 248, 0.58);
  --nox-border: rgba(255, 255, 255, 0.08);
  --nox-header-bg: rgba(3, 5, 8, 0.82);
  --nox-shadow: rgba(0, 0, 0, 0.45);
  --nox-hero-glow: rgba(0, 229, 255, 0.09);
  --nox-btn-primary-bg: #eef2f8;
  --nox-btn-primary-text: #030508;
  --nox-text-muted: var(--nox-muted);
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --app-sidebar-width: 215px;
  color-scheme: dark;
}

[data-theme="light"] {
  --nox-bg: #f4f7fb;
  --nox-bg-2: #e8eef5;
  --nox-bg-3: #dce4ee;
  --nox-surface: rgba(255, 255, 255, 0.85);
  --nox-surface-hover: #ffffff;
  --nox-cyan: #0096b8;
  --nox-cyan-dim: rgba(0, 150, 184, 0.25);
  --nox-cyan-glow: rgba(0, 150, 184, 0.35);
  --nox-text: #0a1018;
  --nox-muted: rgba(10, 16, 24, 0.62);
  --nox-border: rgba(10, 16, 24, 0.1);
  --nox-header-bg: rgba(244, 247, 251, 0.9);
  --nox-shadow: rgba(10, 16, 24, 0.12);
  --nox-hero-glow: rgba(0, 150, 184, 0.12);
  --nox-btn-primary-bg: #0a1018;
  --nox-btn-primary-text: #f4f7fb;
  --nox-text-muted: var(--nox-muted);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--nox-bg);
  color: var(--nox-text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease, opacity 0.25s ease;
}

/* Turbo — barre de progression + transition */
.turbo-progress-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--nox-cyan), #7b61ff);
}

html.turbo-progress-bar--hidden .turbo-progress-bar {
  opacity: 0;
  transition: opacity 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Header ─── */

.site-header {
  --header-height: 64px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--nox-header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--nox-border);
  transition: background 0.35s ease;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.9rem clamp(1rem, 4vw, 2rem);
  position: relative;
  z-index: 230;
}

.site-header__inner--centered {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.site-header__inner--centered .site-header__brand {
  justify-self: start;
}

.site-header__inner--centered .site-header__actions {
  justify-self: end;
}

.site-header__center {
  display: none;
  align-items: center;
  justify-content: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}

.site-header__brand img { width: 34px; height: 34px; object-fit: contain; }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 230;
}

.site-header__auth-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-header__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nox-muted);
  transition: color 0.2s;
  position: relative;
}

.site-header__link:hover { color: var(--nox-cyan); }

.site-header__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--nox-cyan);
  border-radius: 99px;
}

.site-header__burger {
  display: none;
  position: relative;
  z-index: 230;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--nox-border);
  border-radius: 10px;
  background: var(--nox-surface);
  color: var(--nox-text);
  cursor: pointer;
}

.site-header__burger-icon {
  display: block;
}

.site-header__burger-icon--close {
  display: none;
}

.site-header__burger[aria-expanded="true"] .site-header__burger-icon--open {
  display: none;
}

.site-header__burger[aria-expanded="true"] .site-header__burger-icon--close {
  display: block;
}

.site-header__mobile {
  display: none;
  width: 100%;
  flex-basis: 100%;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.15rem;
  padding-bottom: 1.25rem;
}

.site-header__mobile > a {
  display: block;
  padding: 0.85rem 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  color: var(--nox-text);
  background: var(--nox-surface);
  border-radius: 10px;
  transition: color 0.2s, background 0.2s;
}

.site-header__mobile > a:hover,
.site-header__mobile > a:focus-visible {
  color: var(--nox-cyan);
  background: var(--nox-surface-hover);
}

.site-header__mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--nox-border);
}

.site-header__mobile-actions .btn {
  width: 100%;
  justify-content: center;
}

body.nav-open {
  overflow: hidden;
  touch-action: none;
}

@media (min-width: 901px) {
  .site-header__center {
    display: flex;
  }

  .site-header__burger {
    display: none !important;
  }

  .site-header__mobile {
    display: none !important;
  }
}

/* Theme toggle */

.theme-toggle {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--nox-border);
  border-radius: 10px;
  background: var(--nox-surface);
  color: var(--nox-text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover { border-color: var(--nox-cyan); color: var(--nox-cyan); }

.theme-toggle svg { width: 18px; height: 18px; }

[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle__sun { display: none; }
[data-theme="light"] .theme-toggle__moon { display: block; }

/* Locale switcher (FR / EN) */

.locale-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.locale-switcher__label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--nox-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.locale-switcher__select {
  height: 42px;
  min-width: 3.25rem;
  padding: 0 1.5rem 0 0.5rem;
  border: 1px solid var(--nox-border);
  border-radius: 10px;
  background: var(--nox-surface);
  color: var(--nox-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  transition: border-color 0.2s, color 0.2s;
}

.locale-switcher__select:hover,
.locale-switcher__select:focus {
  border-color: var(--nox-cyan);
  outline: none;
}

.locale-switcher--app .locale-switcher__label {
  display: none;
}

@media (max-width: 640px) {
  .locale-switcher--header .locale-switcher__label { display: none; }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--nox-btn-primary-bg);
  color: var(--nox-btn-primary-text);
}

.btn--primary:hover { box-shadow: 0 4px 20px var(--nox-shadow); }

.btn--ghost {
  background: transparent;
  color: var(--nox-text);
  border: 1px solid var(--nox-border);
}

.btn--ghost:hover { border-color: var(--nox-cyan); color: var(--nox-cyan); }

.btn--cyan {
  background: var(--nox-cyan);
  color: #001820;
}

[data-theme="light"] .btn--cyan { color: #fff; }

.btn--cyan:hover { box-shadow: 0 4px 24px var(--nox-cyan-dim); }

/* ─── Footer ─── */

.site-footer {
  background: var(--nox-bg-2);
  border-top: 1px solid var(--nox-border);
  transition: background 0.35s ease;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 5vw, 2rem) 2rem;
}

.site-footer__brand p {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--nox-muted);
  max-width: 280px;
  line-height: 1.65;
}

.site-footer__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.site-footer__logo img { width: 32px; height: 32px; }

.site-footer__col h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nox-cyan);
  margin-bottom: 1rem;
}

.site-footer__col ul { list-style: none; }

.site-footer__col li + li { margin-top: 0.55rem; }

.site-footer__col a {
  font-size: 0.875rem;
  color: var(--nox-muted);
  transition: color 0.2s;
}

.site-footer__col a:hover { color: var(--nox-text); }

.site-footer__bottom {
  border-top: 1px solid var(--nox-border);
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem clamp(1.25rem, 5vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer__copy {
  font-size: 0.8rem;
  color: var(--nox-muted);
}

.site-footer__legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
}

.site-footer__legal-row a {
  font-size: 0.78rem;
  color: var(--nox-muted);
  transition: color 0.2s;
}

.site-footer__legal-row a:hover { color: var(--nox-cyan); }

.site-footer__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.site-footer__badge {
  padding: 0.3rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  border: 1px solid var(--nox-border);
  border-radius: 6px;
  color: var(--nox-muted);
}

@media (max-width: 900px) {
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .site-header__inner--centered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .site-header__center {
    display: none !important;
  }

  .site-header__brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  .site-header__actions {
    flex: 0 0 auto;
    margin-left: auto;
    gap: 0.35rem;
  }

  .site-header__auth-desktop {
    display: none !important;
  }

  .site-header__burger {
    display: flex;
  }

  .site-header.nav-open {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    background: var(--nox-bg);
    border-bottom-color: transparent;
  }

  .site-header.nav-open .site-header__mobile {
    display: flex;
  }

  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .site-footer__grid { grid-template-columns: 1fr; }

  .site-footer__bottom { flex-direction: column; text-align: center; }

  .site-footer__legal-row { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
