/* =============================================================================
   base.css — Variables, reset, layout général, header et footer
   ============================================================================= */

/* =============================================================================
   VARIABLES — Thème sombre (par défaut) et thème clair
   ============================================================================= */
:root {
  /* Couleurs de marque (identiques dans les 2 thèmes) */
  --bg-tile-blue:       #0078d4;
  --bg-tile-blue-dark:  #003a6b;
  --bg-tile-gray:       #2d3a4a;
  --bg-tile-gray-light: #3d4a5a;
  --bg-tile-green:      #107c10;
  --bg-tile-orange:     #d83b01;
  --bg-tile-red:        #e81123;
  --accent-yellow:      #ffb900;
  --formation-grad:     linear-gradient(135deg, #3d4a5a 0%, #2d3a4a 100%);

  /* Texte des tuiles (toujours sur fond foncé) */
  --tile-text:           #ffffff;
  --tile-text-secondary: rgba(255,255,255,0.65);
  --tile-text-tertiary:  rgba(255,255,255,0.45);

  /* Thème SOMBRE (par défaut) */
  --bg-page:    #1b2735;
  --bg-header:  #0d1620;
  --bg-card:    #2d3a4a;
  --text-primary:   #ffffff;
  --text-secondary: rgba(255,255,255,0.65);
  --text-tertiary:  rgba(255,255,255,0.45);
  --tile-shadow:       0 2px 8px rgba(0,0,0,0.3);
  --tile-shadow-hover: 0 14px 32px rgba(0,0,0,0.55);
  --header-shadow:     0 2px 16px rgba(0,0,0,0.4);
  --modal-overlay-bg:  rgba(13, 22, 32, 0.78);
  --divider:           rgba(255,255,255,0.08);
  --hover-bg:          rgba(255,255,255,0.08);
  --hover-bg-strong:   rgba(255,255,255,0.15);
  --btn-border:        rgba(255,255,255,0.15);

  /* Dimensions */
  --tile-gap:  8px;
  --tile-size: 130px;
  --font-display: 'Segoe UI', 'Open Sans', system-ui, -apple-system, sans-serif;
}

/* Thème CLAIR */
html.light {
  --bg-page:    #f3f5f8;
  --bg-header:  #ffffff;
  --bg-card:    #ffffff;
  --text-primary:   #1b2735;
  --text-secondary: rgba(27,39,53,0.65);
  --text-tertiary:  rgba(27,39,53,0.45);
  --tile-shadow:       0 2px 8px rgba(15,30,50,0.08);
  --tile-shadow-hover: 0 16px 36px rgba(15,30,50,0.22);
  --header-shadow:     0 2px 10px rgba(15,30,50,0.08);
  --modal-overlay-bg:  rgba(20, 30, 45, 0.55);
  --divider:           rgba(27,39,53,0.08);
  --hover-bg:          rgba(27,39,53,0.06);
  --hover-bg-strong:   rgba(27,39,53,0.12);
  --btn-border:        rgba(27,39,53,0.15);
}

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

html, body {
  height: 100%;
  font-family: var(--font-display);
  background: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* =============================================================================
   HEADER
   ============================================================================= */
.site-header {
  background: var(--bg-header);
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 64px;
  border-bottom: 3px solid var(--bg-tile-blue);
  flex-shrink: 0;
  gap: 24px;
  z-index: 100;
  box-shadow: var(--header-shadow);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 18px;
  white-space: nowrap;
  color: var(--text-primary);
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: var(--bg-tile-blue);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -1px;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.main-nav a {
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.2s;
}

.main-nav a:hover,
.main-nav a.nav-home {
  background: var(--hover-bg);
}

/* =============================================================================
   BOUTON RECHERCHE — visible et incitatif
   ============================================================================= */
.search-btn {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  border: 1px solid #0078d4;
  color: #fff;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35);
  position: relative;
  /* Petit "pulse" subtil pour attirer l'œil */
  animation: search-btn-pulse 2.4s ease-in-out infinite;
}

.search-btn:hover {
  background: linear-gradient(135deg, #1a8cea 0%, #0078d4 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 120, 212, 0.55);
  animation: none;
}

.search-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.4);
}

/* Petite indication clavier dans le bouton */
.search-btn-kbd {
  margin-left: 6px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Consolas', 'Monaco', monospace;
  line-height: 1;
  opacity: 0.9;
}

/* Animation de pulse subtile */
@keyframes search-btn-pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35);
  }
  50% {
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35),
                0 0 0 8px rgba(0, 120, 212, 0.0);
  }
  25%, 75% {
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35),
                0 0 0 4px rgba(0, 120, 212, 0.15);
  }
}

/* Désactive l'animation si l'utilisateur préfère */
@media (prefers-reduced-motion: reduce) {
  .search-btn { animation: none; }
}

/* =============================================================================
   THEME TOGGLE (inchangé)
   ============================================================================= */
.theme-toggle {
  background: var(--hover-bg);
  border: 1px solid var(--btn-border);
  color: var(--text-primary);
  padding: 0;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s;
  width: 40px;
  height: 38px;
  flex-shrink: 0;
}

.theme-toggle:hover { background: var(--hover-bg-strong); }

.header-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 18px;
}

.separator { opacity: 0.4; }

.weather-badge {
  background: var(--hover-bg);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =============================================================================
   POPUP D'ACCUEIL
   ============================================================================= */
.site-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 95000;
  background: rgba(10, 15, 25, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.site-popup-overlay[hidden] { display: none; }
.site-popup-overlay.site-popup-visible { opacity: 1; }

.site-popup-box {
  background: #fff;
  color: #1b1b1b;
  border-radius: 10px;
  max-width: 460px;
  width: 100%;
  padding: 0;
  position: relative;
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.25s ease;
  overflow: hidden;
}
.site-popup-visible .site-popup-box {
  transform: translateY(0) scale(1);
}

.site-popup-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.site-popup-body {
  padding: 26px 30px 28px;
}
.site-popup-box:has(.site-popup-img) .site-popup-body {
  padding-top: 22px;
}

.site-popup-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  color: #333;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 2;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
}
.site-popup-close:hover { background: #fff; }

.site-popup-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-right: 30px;
}
.site-popup-message {
  font-size: 14.5px;
  line-height: 1.6;
  color: #333;
}
.site-popup-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 11px 22px;
  background: #0078d4;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
.site-popup-btn:hover { background: #106ebe; }

body.popup-open { overflow: hidden; }

@media (max-width: 500px) {
  .site-popup-body { padding: 22px 20px 20px; }
}

/* =============================================================================
   BANDEAU DE CONSENTEMENT COOKIES (RGPD)
   ============================================================================= */
.cookie-consent-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90000;
  background: #1b2735;
  color: #fff;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.cookie-consent-banner.cookie-consent-visible {
  transform: translateY(0);
}
.cookie-consent-text {
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 640px;
  flex: 1;
  min-width: 240px;
}
.cookie-consent-text a {
  color: #7cc4ff;
  text-decoration: underline;
}
.cookie-consent-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-consent-btn {
  padding: 10px 20px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #fff;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.cookie-consent-decline:hover {
  background: rgba(255,255,255,0.1);
}
.cookie-consent-accept {
  background: #0078d4;
  border-color: #0078d4;
}
.cookie-consent-accept:hover {
  background: #106ebe;
  border-color: #106ebe;
}
@media (max-width: 600px) {
  .cookie-consent-banner { padding: 16px; }
  .cookie-consent-actions { width: 100%; }
  .cookie-consent-btn { flex: 1; }
}

/* =============================================================================
   BANDEAU ALERTE
   ============================================================================= */
.alert-banner {
  background: var(--accent-yellow);
  color: #1b1b1b;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 500;
  font-size: 14px;
  position: relative;
  flex-shrink: 0;
}

.alert-banner.alert-info  { background: #0078d4; color: #fff; }
.alert-banner.alert-error { background: #d83b01; color: #fff; }
.alert-banner.hidden      { display: none; }

.alert-close {
  position: absolute;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: inherit;
  padding: 0;
  line-height: 1;
}

/* =============================================================================
   MAIN
   ============================================================================= */
main {
  flex: 1;
}

.home-placeholder {
  max-width: 720px;
  margin: 60px auto;
  padding: 40px;
  background: var(--bg-card);
  border-radius: 8px;
  box-shadow: var(--tile-shadow);
}

.home-placeholder h1 {
  margin-bottom: 16px;
  font-size: 22px;
}

.home-placeholder p {
  margin-bottom: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.home-placeholder ul {
  margin-top: 16px;
  padding-left: 20px;
}

.home-placeholder li {
  margin-bottom: 6px;
}

.home-placeholder a {
  color: var(--bg-tile-blue);
  font-weight: 600;
}

.home-placeholder a:hover {
  text-decoration: underline;
}

/* =============================================================================
   FOOTER
   ============================================================================= */
.site-footer {
  background: var(--bg-header);
  color: var(--text-primary);
  padding: 24px 20px;
  border-top: 3px solid var(--bg-tile-blue);
  flex-shrink: 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto 16px;
  font-size: 13px;
  line-height: 1.6;
}

.footer-cell a {
  color: var(--bg-tile-blue);
}

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

.footer-bottom {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

/* =============================================================================
   FAB Contactez-nous (placeholder, vrai design en phase 3)
   ============================================================================= */
.fab-contact {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  background: linear-gradient(135deg, #d83b01 0%, #b53000 100%);
  color: #fff;
  border: none;
  border-radius: 32px;
  padding: 14px 22px 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(216,59,1,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab-contact:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 32px rgba(216,59,1,0.55);
}

.fab-icon { font-size: 20px; line-height: 1; }

/* =============================================================================
   RESPONSIVE BASE
   ============================================================================= */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .header-info .weather-badge { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .search-btn-kbd { display: none; }  /* Ctrl+K cache sur tablette/mobile */
}

@media (max-width: 640px) {
  .site-header { gap: 12px; padding: 0 12px; }
  .logo-text { display: none; }
  .clock { font-size: 15px; }
  .header-info .separator,
  .header-info .date-display { display: none; }
  .fab-contact { padding: 14px; border-radius: 50%; }
  .fab-text { display: none; }
  /* Sur mobile : bouton recherche compact (juste l'icône loupe) */
  .search-btn { padding: 9px 14px; }
  .search-btn span:not([aria-hidden]) { display: none; }
}
