/* ========== Reset léger ========== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========== Accessibilité ========== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #ffffff;
  color: #111827;
  padding: 8px 10px;
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus { left: 8px; }

/* ========== Thèmes ========== */
html[data-theme="light"] {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --royal: #002b66;
  --nav-bg: var(--royal);
  --nav-border: #ffffff;
  --nav-text: #ffffff;
  --nav-link: #ffffff;
  --yellow: #f5c400;
  --yellow-text: #111827;
  --footer-overlay: rgba(0, 43, 102, 0.58);
  --field-bg: #ffffff;
  --field-border: #d1d5db;
  --focus: #f5c400;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #22304a;
  --royal: #001a3d;
  --nav-bg: var(--royal);
  --nav-border: #0b1220;
  --nav-text: #ffffff;
  --nav-link: #ffffff;
  --yellow: #f5c400;
  --yellow-text: #111827;
  --footer-overlay: rgba(0, 26, 61, 0.62);
  --field-bg: #0f172a;
  --field-border: #334155;
  --focus: #f5c400;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ========== Header / Navbar MOBILE OPTIMISÉ ========== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--nav-border);
  background: var(--nav-bg);
}

.nav-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
}

.nav-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.nav-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}

/* Logo cartouche blanc - RÉDUIT SUR MOBILE */
.logo-area {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #ffffff;
  padding: 5px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 160px;
  overflow: hidden;
}

.logo-nav {
  display: block;
  height: 32px;
  width: auto;
  object-fit: contain;
  max-width: 140px;
}

/* Boutons header */
.btn-connect,
.btn-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--nav-text);
  background: rgba(255, 255, 255, 0.10);
}

.btn-connect:hover { background: rgba(255, 255, 255, 0.18); }

.btn-signup {
  background: var(--yellow);
  color: var(--yellow-text);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.btn-signup:hover { filter: brightness(0.95); }

/* Menu desktop */
.navbar-menu {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.navbar-menu a {
  color: var(--nav-link);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
}
.navbar-menu a:hover { background: rgba(255, 255, 255, 0.14); }
.navbar-menu a[aria-current="page"] { background: rgba(255, 255, 255, 0.20); }

/* Burger - AU CENTRE SUR MOBILE */
.menu-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.menu-toggle:hover { background: rgba(255, 255, 255, 0.18); }

.mobile-only { display: none; }
.desktop-only { display: inline-flex; }

.menu-btn {
  width: 100%;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.10);
  font-weight: 800;
}
.menu-btn--yellow {
  background: var(--yellow);
  color: var(--yellow-text);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* ========== Toggle Jour / Nuit - COMPACT ========== */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nav-text);
  font-weight: 800;
  user-select: none;
}
.theme-switch__label { 
  font-size: 0.75rem;
}

.theme-switch__btn {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  padding: 0;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.theme-switch__thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ffffff;
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: left 180ms ease;
}
.theme-switch__btn[aria-checked="true"] .theme-switch__thumb { left: 19px; }

/* ========== LANGUE : CARTOUCHE DRAPEAUX - COMPACT ===== */
.lang-cartouche {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--field-bg);
  padding: 3px 6px;
  border-radius: 14px;
  border: 1px solid var(--field-border);
  flex-shrink: 0;
}

.lang-cartouche .flag {
  font-size: 1.2rem;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.2s;
}

.lang-cartouche .flag:hover {
  transform: scale(1.15);
}

.lang-cartouche .flag.is-active {
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.4));
}

.lang-switch-btn {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 43, 102, 0.92);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

html[data-theme="dark"] .lang-switch-btn {
  background: rgba(0, 26, 61, 0.92);
}

.lang-switch-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 999px;
  transform: translateY(-50%);
  transition: left 180ms ease;
}

.lang-switch-btn[aria-checked="true"]::after {
  left: 19px;
}

/* ========== Contenu ========== */
main {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
  text-align: center;
  flex: 1;
}

.home-logo {
  height: 180px;
  width: auto;
  display: block;
  margin: 22px auto 12px;
  object-fit: contain;
}

.logo-central {
  height: 150px;
  width: auto;
  display: block;
  margin: 18px auto 14px;
  object-fit: contain;
}

.hero-title {
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  line-height: 1.25;
  margin: 12px auto 10px;
  max-width: 900px;
  font-weight: 800;
}

.hero-sub {
  margin: 6px auto;
  max-width: 900px;
  color: var(--muted);
  font-weight: 600;
}
.hero-sub--last { margin-top: 10px; }

.accroche {
  max-width: 900px;
  margin: 14px auto 0;
}

.highlight { font-weight: 800; }

.content {
  text-align: left;
}
.content h1,
.content .logo-central,
.content .accroche {
  text-align: center;
}

.content-section {
  margin-top: 16px;
}

.content-section h2 {
  margin: 16px 0 8px;
  font-size: 1.15rem;
}

.subheading {
  margin: 14px 0 8px;
  font-size: 1.05rem;
}

.instruction-text {
  margin: 8px 0 10px;
}

.note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.bullets {
  margin: 8px 0 10px 0;
  padding-left: 18px;
}
.bullets li {
  margin: 6px 0;
}

/* ========== Formulaires ========== */
form {
  max-width: 780px;
  margin: 10px auto 0;
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

label {
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent);
}

button[type="submit"] {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 900;
  background: var(--yellow);
  color: var(--yellow-text);
}

.form-note {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 600;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert {
  max-width: 780px;
  margin: 12px auto;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
}
.alert-success { background: #e7f8ee; color: #0f5132; border: 1px solid #badbcc; }
.alert-error   { background: #fdecec; color: #842029; border: 1px solid #f5c2c7; }

/* ========== Footer ========== */
.site-footer {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background-color: var(--royal);
  background-image: url("image-footer.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-top: 1px solid var(--nav-border);
  min-height: 220px;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--footer-overlay);
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  padding: 56px 16px;
  text-align: center;
  font-weight: 700;
}

.site-footer a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ========== Responsive MOBILE ========== */
@media (max-width: 860px) {
  .theme-switch__label { display: none; }
}

@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; }

  .navbar {
    flex-wrap: wrap;
    padding: 8px 10px;
  }

  /* Nav-left encore plus compact sur mobile */
  .nav-left {
    gap: 4px;
  }

  .navbar-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 6px;
  }

  .navbar-menu.show {
    display: flex;
  }

  .navbar-menu a {
    width: 100%;
    justify-content: center;
  }

  .desktop-only { display: none; }
  .mobile-only { display: block; }

  .form-row {
    grid-template-columns: 1fr;
  }

  main {
    padding-bottom: 38px;
  }
}

@media (max-width: 420px) {
  .logo-nav { height: 28px; }
  .home-logo { height: 150px; }

  .navbar {
    padding: 6px 8px;
    gap: 4px;
  }

  /* Nav-left ultra-compact sur petits écrans */
  .nav-left {
    gap: 3px;
  }

  .theme-switch {
    gap: 3px;
  }

  .logo-area {
    max-width: 140px;
    padding: 4px 6px;
  }

  .theme-switch__btn,
  .lang-switch-btn {
    width: 34px;
    height: 18px;
  }

  .theme-switch__thumb,
  .lang-switch-btn::after {
    width: 12px;
    height: 12px;
  }

  .theme-switch__btn[aria-checked="true"] .theme-switch__thumb,
  .lang-switch-btn[aria-checked="true"]::after {
    left: 18px;
  }

  .lang-cartouche .flag {
    font-size: 1.1rem;
  }

  .lang-cartouche {
    padding: 2px 5px;
    gap: 4px;
  }
}

/* ========== Responsive DESKTOP ========== */
@media (min-width: 761px) {
  .nav-center {
    justify-content: center;
  }

  .navbar-menu {
    justify-content: center;
  }

  .logo-area {
    max-width: 240px;
  }

  .logo-nav {
    height: 42px;
    max-width: 220px;
  }

  .theme-switch__btn,
  .lang-switch-btn {
    width: 46px;
    height: 26px;
  }

  .theme-switch__thumb,
  .lang-switch-btn::after {
    width: 20px;
    height: 20px;
  }

  .theme-switch__btn[aria-checked="true"] .theme-switch__thumb,
  .lang-switch-btn[aria-checked="true"]::after {
    left: 23px;
  }

  .lang-cartouche .flag {
    font-size: 1.8rem;
  }

  .lang-cartouche {
    padding: 6px 10px;
    gap: 10px;
  }

  .theme-switch__label {
    font-size: 0.95rem;
  }
}

/* ========== Divers ========== */
input[readonly] {
  background: color-mix(in srgb, var(--field-bg) 70%, #9ca3af 30%);
  cursor: not-allowed;
}
form input[readonly] {
  background: #d1d5db !important;
  cursor: not-allowed;
}

input[readonly][name="sujet"] {
  text-transform: uppercase;
  font-weight: 700;
  color: #86a84a;
}
html[data-theme="dark"] input[readonly][name="sujet"] {
  color: #9cc56b;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 10px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-links a[aria-current="page"] {
  text-decoration: underline;
  font-weight: 700;
  color: var(--yellow);
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

img, svg {
  max-width: 100%;
  height: auto;
}

.navbar { overflow-x: clip; }

header {
  position: sticky;
  top: 0;
  z-index: 9999;
}

/* ========== Checkboxes ========== */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.checkbox-label:hover {
  background: rgba(91, 155, 213, 0.05);
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0 0;
  cursor: pointer;
}

.checkbox-label span {
  flex: 1;
  line-height: 1.5;
}

.checkboxes-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.consent-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.consent-checkboxes .checkbox-label {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.consent-checkboxes .checkbox-label:has(input:checked) {
  background: rgba(91, 155, 213, 0.1);
  border-color: var(--royal);
}

.help-text {
  display: block;
  margin-top: 5px;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.req {
  color: #dc2626;
  font-weight: bold;
}

/* ========== Formulaires avancés ========== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.dob-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--royal);
  font-size: 1.3rem;
  border-bottom: 2px solid var(--royal);
  padding-bottom: 10px;
}

.radios {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-pill:hover {
  border-color: var(--royal);
  background: rgba(91, 155, 213, 0.05);
}

.radio-pill:has(input:checked) {
  background: var(--royal);
  color: white;
  border-color: var(--royal);
}

.radio-pill input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.actions button[type="submit"] {
  background: var(--yellow);
  color: var(--yellow-text);
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.actions button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 196, 0, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  padding: 13px 30px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--royal);
  background: rgba(91, 155, 213, 0.05);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .dob-grid {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 20px;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .actions button,
  .actions .btn-secondary {
    width: 100%;
  }
}

/* Neutraliser le margin global form { margin: 10px auto 0 } pour le like dans le feed */
.post-item form {
  margin: 0 !important;
  max-width: none !important;
}
