@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&display=swap');

:root {
  /* BLEUS ET THÈME GOUVERNEMENTAL */
  --header-footer-bg: #1e3a8a; /* Bleu plus clair pour le header et le footer */
  --header-footer-hover: #1d4ed8;
  
  --blue-bright: #3b82f6;      /* Bleu vif d'action */
  --blue-hover: #2563eb;       /* Bleu au survol */
  --blue-bg: #eff6ff;          /* Fond bleu très doux */
  
  --gold: #c5a059;
  --gold-light: #e6c88b;
  --bg-light: #f8fafc;
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  /* Couleurs des bordures d'espaces */
  --color-yellow: #d97706;
  --color-green: #16a34a;
  --color-blue: #3b82f6;
  --color-red: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Lexend', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

/* HEADER & NAVIGATION */
.sa-header-bar {
  background-color: var(--header-footer-bg);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sa-header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
}

.sa-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}

.sa-header-seal {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.sa-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sa-nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sa-nav-link:hover, .sa-nav-link.active {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.1);
}

/* DROPDOWN MENU */
.sa-dropdown {
  position: relative;
}

.sa-dropdown-trigger {
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  display: block;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sa-dropdown-trigger:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.1);
}

.sa-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--header-footer-bg);
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 8px 0;
  z-index: 101;
}

.sa-dropdown-content a {
  padding: 10px 18px;
  display: block;
  font-size: 13px;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.sa-dropdown-content a:hover {
  background-color: rgba(197, 160, 89, 0.2);
  color: var(--gold-light);
}

.sa-dropdown:hover .sa-dropdown-content {
  display: block;
}

/* BOUTON CONNEXION HEADER */
.sa-login-btn {
  background: transparent;
  color: #ffffff;
  border: 1px solid var(--gold-light);
  padding: 8px 18px;
  border-radius: 6px;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sa-login-btn:hover {
  background: var(--gold);
  color: #ffffff;
}

/* BANNIÈRE HÉROS */
.sa-hero {
  background: linear-gradient(rgba(30, 58, 138, 0.85), rgba(30, 58, 138, 0.85)), url('https://i.imgur.com/votre-image-fond.jpg') center/cover;
  padding: 50px 20px;
  color: white;
  text-align: center;
}

.sa-hero-overlay {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.sa-hero h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.5px;
}

.sa-hero-subtitle {
  font-size: 17px;
  color: var(--gold-light);
  margin-top: 8px;
  margin-bottom: 0;
  font-weight: 400;
}

.sa-hero-seal {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

/* MAIN CONTAINER */
.sa-main-container {
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 20px;
}

/* BANNIÈRE BIENVENUE EN BLEU CLAIR */
.sa-card-welcome {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px 30px;
  margin-bottom: 35px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
  border-left: 6px solid var(--blue-bright);
}

.sa-card-welcome h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #1e40af;
}

.sa-card-welcome p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* GRILLE DES 4 ESPACES D'ALIGNEMENT PARFAIT */
.sa-spaces-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.sa-card-space {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-top: 5px solid transparent;
}

.space-yellow { border-top-color: var(--color-yellow); }
.space-green { border-top-color: var(--color-green); }
.space-blue { border-top-color: var(--color-blue); }
.space-red { border-top-color: var(--color-red); }

.sa-space-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
  text-transform: uppercase;
}

.sa-space-title {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
  margin: 4px 0 10px 0;
}

.sa-space-desc {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 20px 0;
  min-height: 48px;
}

.sa-direct-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 15px;
  margin-bottom: 20px;
  flex-grow: 1;
}

.sa-direct-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.sa-direct-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.sa-direct-link:hover {
  background: #eff6ff;
  color: var(--blue-bright);
  transform: translateX(2px);
}

.sa-direct-link .arrow {
  color: #94a3b8;
}

.sa-direct-link:hover .arrow {
  color: var(--blue-bright);
}

/* BOUTON D'ACCÈS ESPACE */
.sa-btn-space {
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--blue-bright);
  color: #ffffff;
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 12px 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.sa-btn-space:hover {
  background-color: var(--blue-hover);
}

/* SECTION TERRITOIRE & CARTE */
.sa-territory-section {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 35px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin-top: 20px;
  border: 1px solid var(--border-color);
}

.sa-territory-container {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 35px;
  align-items: center;
}

.sa-territory-map img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: block;
}

.sa-territory-text {
  font-size: 13.5px;
  color: #334155;
}

.sa-lead-text {
  font-size: 15px;
  color: #0f172a;
  margin-top: 0;
}

.sa-county-list {
  margin: 10px 0 20px 20px;
  font-weight: 600;
  color: #2563eb;
}

/* MODALE DE CONNEXION */
.sa-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.sa-modal-card {
  background: var(--header-footer-bg);
  color: white;
  padding: 30px;
  border-radius: 12px;
  width: 380px;
  position: relative;
  border: 1px solid var(--gold);
}

.sa-close-modal {
  position: absolute;
  right: 15px;
  top: 10px;
  cursor: pointer;
  font-size: 24px;
  color: #94a3b8;
}

.sa-close-modal:hover {
  color: white;
}

.sa-modal-card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.sa-modal-subtitle {
  font-size: 12px;
  color: #cbd5e1;
  margin: 4px 0 20px 0;
}

.sa-field {
  margin-bottom: 16px;
}

.sa-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.sa-field input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #3b82f6;
  background: #1e293b;
  color: white;
  font-family: 'Lexend', sans-serif;
  box-sizing: border-box;
}

.sa-btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--blue-bright);
  color: white;
  border: none;
  border-radius: 6px;
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.sa-btn-primary:hover {
  background: var(--blue-hover);
}

.sa-error-text {
  color: #ef4444;
  font-size: 12px;
  margin-top: 10px;
}

/* FOOTER */
.sa-footer {
  background-color: var(--header-footer-bg);
  color: #cbd5e1;
  padding: 40px 20px;
  border-top: 2px solid var(--gold);
  margin-top: 60px;
}

.sa-footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.sa-footer-seal {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.sa-footer-text h3 {
  color: white;
  font-size: 14px;
  letter-spacing: 0.5px;
  margin: 0 0 6px 0;
}

.sa-footer-text p {
  margin: 0;
  font-size: 13px;
}

.sa-footer-text a {
  color: var(--gold-light);
  text-decoration: none;
}

.sa-footer-divider {
  border: 0;
  height: 1px;
  background: var(--gold);
  margin: 20px 0 15px 0;
  opacity: 0.4;
}

.sa-copyright {
  font-size: 12px;
}

.sa-author-credit {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 11px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1100px) {
  .sa-spaces-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sa-spaces-grid {
    grid-template-columns: 1fr;
  }

  .sa-territory-container {
    grid-template-columns: 1fr;
  }
  
  .sa-header-container {
    flex-direction: column;
    gap: 15px;
  }

  .sa-hero-overlay {
    flex-direction: column;
  }
}