/* ===================================================================
   URBATOUR QUALITY – style.css
   Clone fidèle de https://urbatour-quality.tn/
   Pearl Theme (style_11 header) + skin-custom overrides
   =================================================================== */

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --accent: #f00;
  --accent-hover: #d00;
  --accent-secondary: #ff481f;
  --dark: #333333;
  --dark-deep: #232426;
  --dark-brand: #231f20;
  --white: #ffffff;
  --gray-bg: #f5f5f5;
  --card-bg: #ececec;
  --border: #e6e6e6;
  --text: #333333;
  --text-body: #808080;
  --text-light: #888888;
  --text-muted: #666666;
  --font-main: 'Montserrat', sans-serif;
  --font-arabic: 'Cairo', sans-serif;
  --transition: 0.3s ease;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 24px rgba(0,0,0,0.15);
  --radius: 0;
  --container: 1140px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 14px;
  max-width: 100vw;
  width: 100%;
  position: relative;
  overflow-x: hidden;
  line-height: 24px;
  color: var(--text-body);
  background-image: url('../images/bg-main.jpg');
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* `overflow: clip` bloque tout scroll latéral plus strictement que hidden
   sur Chromium récents (Chrome, Mi Browser, Samsung Internet). */
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}

html[dir="rtl"] body,
html[lang="ar"] body {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
}

/* Sécurité RTL : empêcher toute largeur interne de dépasser le viewport */
html[dir="rtl"] main,
html[dir="rtl"] section,
html[dir="rtl"] .container,
html[dir="rtl"] .hero-section,
html[dir="rtl"] .survey-content-area {
  max-width: 100vw;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: color var(--transition); }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 15px;
}

p { margin-bottom: 25px; line-height: 24px; }


/* ===== LANGUAGE SWITCHER (floating top-right, index.html) ===== */
.lang-switcher {
  position: fixed;
  top: 0;
  right: 10vw;
  z-index: 10001;
  font-size: 14px;
}
html[dir="rtl"] .lang-switcher {
  right: auto;
  left: 10vw;
}
.lang-switcher-inner {
  position: relative;
}
.lang-current {
  background: rgba(255,255,255,0.7);
  border-radius: 0 0 8px 8px;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background var(--transition);
}
.lang-current:hover {
  background: rgba(255,255,255,0.9);
}
.lang-flag {
  width: 18px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
}
.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  overflow: hidden;
  min-width: 140px;
}
html[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}
.lang-dropdown[hidden] { display: none; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.lang-btn:hover {
  background: rgba(0,0,0,0.05);
}
.lang-btn.active {
  font-weight: 600;
}
.lang-btn .lang-flag {
  flex-shrink: 0;
}


/* ===== LANGUAGE BAR (survey.html / standalone pages) ===== */
.lang-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  display: flex;
  justify-content: flex-end;
  gap: 0;
  background: var(--dark-deep);
  padding: 4px 20px;
  font-size: 12px;
}
html[dir="rtl"] .lang-bar {
  flex-direction: row-reverse;
}
.lang-bar .lang-btn {
  display: inline-block;
  padding: 4px 10px;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: color var(--transition);
  width: auto;
}
.lang-bar .lang-btn:hover {
  color: var(--white);
  background: none;
}
.lang-bar .lang-btn.active {
  color: var(--white);
  font-weight: 600;
}


/* ===== HEADER / NAVBAR (index.html – site-header) ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--dark-deep);
  transition: box-shadow var(--transition);
}
.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 15px 0;
}
.header-logo a {
  display: block;
}
.header-logo .logo {
  width: 200px;
  height: auto;
}
.header-nav {
  display: flex;
  align-items: center;
}
.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
}
.nav-menu li a {
  display: block;
  padding: 10px 15px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.5px;
  transition: color var(--transition);
  white-space: nowrap;
}
.nav-menu li a:hover {
  color: var(--white);
}
.nav-cta-item {
  margin-left: 10px;
  margin-right: 30px;
}
html[dir="rtl"] .nav-cta-item {
  margin-left: 30px;
  margin-right: 10px;
}
.nav-cta {
  border: 2px solid var(--accent) !important;
  padding: 8px 20px !important;
  transition: background var(--transition), color var(--transition) !important;
}
.nav-cta:hover {
  background: var(--accent) !important;
  color: var(--white) !important;
}


/* ===== NAVBAR (survey.html / admin.html – .navbar) ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--dark-deep);
  padding: 0;
  transition: box-shadow var(--transition);
}
.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}
.nav-logo {
  color: var(--white);
  font-family: var(--font-arabic);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.nav-back {
  font-size: 0.85rem;
  color: var(--accent) !important;
  font-weight: 500;
  transition: opacity var(--transition);
}
.nav-back:hover {
  opacity: 0.8;
}


/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--dark-deep);
  padding: 8px 0;
}
.mobile-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-logo img {
  width: 160px;
  height: auto;
}
.mobile-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mobile-toggle .mbc {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: var(--transition);
}
.header-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
}
.header-overlay.active {
  display: block;
}


/* ===== WELCOME MAP SECTION ===== */
.welcome-map-section {
  padding: 40px 0;
  background-color: #f9f9f9;
}

.welcome-map-wrap {
  text-align: center;
}

.welcome-map-img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ===== HERO / ABOUT SECTION ===== */
.hero-section {
  padding: 130px 0 40px;
}
.hero-title {
  color: var(--accent);
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-arabic);
  margin-bottom: 10px;
  line-height: 1.3;
}
.hero-desc {
  text-align: center;
  font-size: 20px;
  line-height: 24px;
  font-weight: 400;
  color: var(--text);
  max-width: 900px;
  margin: 0 auto;
}
.hero-spacer {
  height: 35px;
}
.hero-columns {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
}
.hero-left {
  flex: 1 1 auto;
  min-width: 0;
}
.hero-right {
  flex: 0 0 320px;
  max-width: 320px;
  margin: 0;
  align-self: flex-start;
  position: sticky;
  top: 90px;
}
html[dir="rtl"] .hero-right {
  margin: 0;
}
html[dir="rtl"] .hero-columns {
  flex-direction: row-reverse;
}

.context-heading {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-arabic);
  text-align: center;
  color: var(--dark-brand);
  margin-bottom: 20px;
}
.context-body {
  text-align: justify;
}
.context-body p {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.context-thanks {
  font-weight: 400;
  font-style: normal;
}
.photo-credit {
  text-align: center;
  font-style: italic;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -10px;
  padding-bottom: 20px;
}


/* ===== HERO CARD (right column) ===== */
.hero-card {
  background: var(--white);
  border: 6px solid var(--border);
  padding: 25px 20px 30px;
  text-align: center;
}
.hero-card-logo {
  max-width: 150px;
  margin: 0 auto 15px;
}
.hero-card-title {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-arabic);
  color: var(--dark-brand);
  line-height: 1.2;
  margin-bottom: 12px;
}
.hero-card-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-light);
  text-align: justify;
  margin-bottom: 18px;
}
.hero-card-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background var(--transition);
  text-decoration: none;
}
.hero-card-cta:hover {
  background: var(--accent-hover);
}


/* ===================================================================
   BANNIÈRE D'ACCUEIL (welcome-banner) — carte compacte type modale
   - desktop/tablette/mobile : image à gauche, contenu à droite
   - largeur max contenue (~600 px) pour garder l'aspect "encart"
   =================================================================== */
.welcome-banner {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  overflow: hidden;
  margin: 0 auto 32px;
  max-width: 600px;
  width: 100%;
  min-height: 260px;
}
.welcome-banner__image {
  flex: 0 0 42%;
  max-width: 42%;
  overflow: hidden;
  background: #f3f3f3;
}
.welcome-banner__img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  object-position: center;
}
.welcome-banner__content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px 18px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.welcome-banner__logo {
  display: block;
  max-width: 150px;
  width: 100%;
  height: auto;
  margin: 0 auto 2px;
}
.welcome-banner__title {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-arabic);
  color: var(--dark-brand);
  line-height: 1.3;
  margin: 0;
}
.welcome-banner__desc {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-light);
  text-align: center;
  margin: 0;
  max-width: 280px;
}
.welcome-banner__cta {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-transform: none;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  margin-top: 4px;
}
.welcome-banner__cta:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.welcome-banner__credit {
  position: absolute;
  left: 8px;
  bottom: 4px;
  margin: 0;
  padding: 0;
  font-size: 8px;
  line-height: 1.35;
  color: var(--text-muted);
  font-style: italic;
  max-width: 40%;
  text-align: left;
  pointer-events: none;
}
html[dir="rtl"] .welcome-banner__credit {
  left: auto;
  right: 8px;
  text-align: right;
}

/* ===== HERO CONTEXT (Contexte de l'étude sous la bannière) ===== */
.hero-context {
  max-width: 960px;
  margin: 0 auto;
}


/* ===== GRAY BLOCK (Zone + Profiles wrapper) ===== */
.gray-block {
  background: var(--gray-bg);
}


/* ===== SECTION DIVIDER ===== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding-top: 20px;
}
.divider-line {
  flex: 1;
  height: 1px;
  background: #ccc;
}
.section-divider--large .divider-line {
  height: 2px;
}
.divider-title {
  font-size: 20px;
  font-weight: 500;
  font-family: var(--font-arabic);
  color: var(--accent);
  text-align: center;
  white-space: nowrap;
}
.section-divider--large .divider-title {
  font-size: 30px;
}


/* ===== ZONE D'ÉTUDE ===== */
.zone-section {
  padding: 40px 0 30px;
  margin-top: -80px;
  position: relative;
  z-index: 1;
}
.zone-map-wrap {
  text-align: center;
}
.zone-map-img {
  max-width: 88%;
  margin: 0 auto;
  display: block;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}


/* ===== PROFILE CARDS ===== */
.profiles-section {
  padding: 20px 0 40px;
}
.profiles-grid {
  display: flex;
  gap: 0;
  margin: 0 -80px;
  padding: 65px 55px 80px;
  background: var(--white);
  border: 10px solid var(--border);
}
.profile-card {
  flex: 1;
  display: block;
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
  padding-bottom: 40px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.profile-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.profile-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 10px 15px;
}
.profile-type {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-arabic);
  text-align: center;
  text-transform: uppercase;
  color: var(--dark-brand);
  margin-bottom: 0;
}
.profile-name {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-arabic);
  text-align: center;
  text-transform: uppercase;
  color: var(--dark-brand);
  margin-bottom: 8px;
}
.profile-desc {
  font-size: 14px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
}
.profile-btn-wrap {
  margin-top: auto;
}
.profile-btn {
  display: inline-block;
  padding: 10px 25px;
  background: var(--accent);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.profile-btn:hover,
.profile-card:hover .profile-btn {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(255,0,0,0.3);
}


/* ===== TEAM BANNER ===== */
.team-banner {
  background: var(--accent);
  padding: 20px 0;
  text-align: center;
}
.team-banner-title {
  color: var(--white);
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-arabic);
  text-align: center;
}


/* ===== TEAM SECTION ===== */
.team-section {
  background: var(--gray-bg);
  padding: 0 0 30px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 30px 0;
}
.team-card {
  background: var(--white);
  padding: 30px 20px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.01);
  transition: box-shadow var(--transition);
}
.team-card:hover {
  box-shadow: var(--shadow-hover);
}
.team-card-name {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-arabic);
  color: var(--dark-brand);
  margin-bottom: 4px;
  text-align: center;
}
.team-card-email {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 16px;
}
.team-card-bio {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}


/* ===== PARALLAX SECTION ===== */
.parallax-section {
  position: relative;
  height: 220px;
  background-image: url('../images/sidi-bou-said.jpg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}
.parallax-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28,29,27,0.5);
}


/* ===== AFFILIATIONS ===== */
.affiliations-section {
  background: var(--white);
  padding: 30px 0 40px;
}
.affiliations-title {
  color: var(--accent);
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-arabic);
  margin-top: 30px;
  margin-bottom: 20px;
}
.affiliations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: center;
  margin-top: 15px;
}
.affiliation-img-wrap {
  text-align: center;
}
.affiliation-img-wrap img {
  max-width: 88%;
  margin: 0 auto;
}
.confidentiality {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 24px;
  font-style: italic;
}


/* ===== FOOTER ===== */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
}
.site-footer a {
  color: rgba(255,255,255,0.5);
}
.site-footer a:hover {
  color: var(--white);
}
.footer-container {
  padding-top: 40px;
  padding-bottom: 20px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 20px;
  align-items: center;
}
.footer-widget {
  font-size: 13px;
  line-height: 1.7;
}
.footer-logo {
  width: 200px;
}
.footer-widget--text {
  grid-column: span 2;
}
.footer-widget--flag {
  text-align: center;
}
.footer-flag {
  width: 74px;
  height: auto;
  margin: 0 auto;
}
.footer-bottom {
  position: relative;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 15px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.footer-privacy-link {
  margin: 6px 0 0;
}
.footer-privacy-link button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.2s;
}
.footer-privacy-link button:hover {
  color: rgba(255,255,255,0.7);
}
/* QR Code dans le footer */
.footer-widget--qr {
  text-align: center;
}
.footer-qr-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#footerQrCode {
  display: inline-block;
  background: transparent;
  border-radius: 4px;
  padding: 4px;
}
#footerQrCode img, #footerQrCode canvas {
  display: block;
  border-radius: 4px;
}
.footer-qr-url {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  margin: 4px 0 0;
  word-break: break-all;
}
/* Cacher la roue dentée — on utilise le lien footer à la place */
.consent-reopen {
  display: none !important;
  background: rgba(0,0,0,0.15);
}


/* ===== FADE-IN ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ===================================================================
   SURVEY PAGE STYLES
   =================================================================== */
.survey-page {
  padding-top: 70px;
  min-height: 100vh;
  background: var(--gray-bg);
}
.lang-bar ~ .navbar {
  top: 28px;
}
.lang-bar ~ .navbar ~ .survey-page {
  padding-top: 98px;
}

.survey-header {
  background: var(--dark);
  color: var(--white);
  padding: 40px 24px;
  text-align: center;
  margin-bottom: 0;
}
.survey-header h1 {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.survey-header p {
  font-size: 0.9rem;
  opacity: 0.8;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.progress-container {
  background: #e8e0d4;
  padding: 16px 24px;
  position: sticky;
  top: 70px;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.lang-bar ~ .navbar ~ .survey-page .progress-container {
  top: 98px;
}
.progress-bar-wrap {
  max-width: 800px;
  margin: 0 auto;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
}
.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(51,51,51,0.15);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.survey-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.dimension-section { display: none; }
.dimension-section.active { display: block; }

.dimension-title {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}
.dimension-instruction {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 32px;
  line-height: 1.7;
}

.question-card {
  background: var(--white);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-left: 4px solid var(--dark);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.question-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.question-card.answered {
  border-left-color: var(--accent);
}
html[dir="rtl"] .question-card {
  border-left: none;
  border-right: 4px solid var(--dark);
}
html[dir="rtl"] .question-card.answered {
  border-right-color: var(--accent);
}
.question-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 20px;
}


/* ===== LIKERT SCALE ===== */
.likert-group {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.likert-option {
  position: relative;
}
.likert-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.likert-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(51,51,51,0.2);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  transition: all var(--transition);
}
.likert-option input:checked + label {
  background: var(--dark);
  color: var(--white);
  border-color: var(--dark);
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(51,51,51,0.3);
}
.likert-option label:hover {
  border-color: var(--accent);
  background: rgba(255,0,0,0.08);
}
.likert-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 8px;
  padding: 0 4px;
}


/* ===== SURVEY NAVIGATION ===== */
.survey-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #e8e0d4;
}
.btn {
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}
.btn-prev {
  background: var(--white);
  color: var(--dark);
  border: 2px solid var(--dark);
}
.btn-prev:hover {
  background: var(--gray-bg);
}
.btn-next,
.btn-submit {
  background: var(--dark);
  color: var(--white);
}
.btn-next:hover,
.btn-submit:hover {
  background: var(--accent);
  color: var(--white);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ===== SYNTHESIS SECTION ===== */
.synthesis-section { display: none; }
.synthesis-section.active { display: block; }

.synthesis-title {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}
.synthesis-instruction {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 32px;
  line-height: 1.7;
}

.district-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.district-name {
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
  min-width: 200px;
}
.district-rating {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.district-rating .likert-option label {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}
.district-unknown {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-light);
}
.district-unknown input {
  accent-color: var(--dark);
}


/* ===== SUCCESS PAGE ===== */
.success-page {
  text-align: center;
  padding: 80px 24px;
  max-width: 600px;
  margin: 0 auto;
}
.success-icon {
  width: 80px;
  height: 80px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.5rem;
  color: var(--white);
}
.success-page h2 {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 16px;
}
.success-page p {
  color: var(--text-light);
  line-height: 1.8;
}


/* ===================================================================
   ADMIN PAGE STYLES
   =================================================================== */
.admin-page {
  padding-top: 80px;
  min-height: 100vh;
  background: var(--gray-bg);
}
.admin-header {
  background: var(--dark);
  color: var(--white);
  padding: 32px 24px;
  text-align: center;
}
.admin-header h1 {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}
.admin-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--white);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: box-shadow var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-hover);
}
.stat-number {
  font-family: var(--font-arabic);
  font-size: 2.5rem;
  color: var(--dark);
  font-weight: 700;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-toolbar select,
.admin-toolbar button {
  padding: 10px 20px;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.85rem;
}
.admin-toolbar select {
  border: 2px solid var(--dark);
  color: var(--dark);
  background: var(--white);
}
.admin-toolbar .btn-export {
  background: var(--accent);
  color: var(--white);
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: 6px;
}
.admin-toolbar .btn-export:hover {
  background: var(--accent-hover);
}

.responses-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.responses-table th {
  background: var(--dark);
  color: var(--white);
  padding: 14px 16px;
  font-size: 0.8rem;
  text-align: left;
  font-weight: 600;
}
html[dir="rtl"] .responses-table th {
  text-align: right;
}
.responses-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--gray-bg);
}
.responses-table tr:hover td {
  background: var(--gray-bg);
}


/* ===================================================================
   RTL SUPPORT
   =================================================================== */
html[dir="rtl"] .nav-menu {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .context-body {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .hero-card-desc {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .team-card-bio {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] .hero-columns {
  flex-direction: column;
}
html[dir="rtl"] .footer-widgets {
  direction: rtl;
}
html[dir="rtl"] .profiles-grid {
  direction: rtl;
}
html[dir="rtl"] .survey-nav {
  flex-direction: row-reverse;
}
html[dir="rtl"] .progress-info {
  flex-direction: row-reverse;
}
html[dir="rtl"] .district-card {
  flex-direction: row-reverse;
}
/* En RTL, on NE renverse PAS l'ordre flex des labels :
   - 1er span (لا أوافق إطلاقا) reste dans l'ordre DOM et apparaît naturellement
     à DROITE en RTL → aligné avec le bouton 1 (lui aussi à droite en RTL)
   - 2e span (أوافق تماما) apparaît à GAUCHE → aligné avec 5 (ou 7) à gauche */
html[dir="rtl"] .likert-labels {
  flex-direction: row;
}
html[dir="rtl"] .admin-toolbar {
  flex-direction: row-reverse;
}
html[dir="rtl"] .responses-table td {
  text-align: right;
}
html[dir="rtl"] .nav-back {
  direction: rtl;
}


/* ===================================================================
   RESPONSIVE – 1024px breakpoint (tablet / small desktop)
   =================================================================== */
@media (max-width: 1024px) {
  .site-header { display: none; }
  .mobile-header { display: block; }
  /* Sur la page enquête, on garde un header compact (pas de mobile-header ici) */
  body:has(.survey-page) .site-header {
    display: block;
    padding: 8px 0;
  }
  body:has(.survey-page) .site-header .nav-menu {
    display: none;
  }
  body:has(.survey-page) .site-header .header-row {
    justify-content: center;
  }

  .hero-section { padding: 90px 0 30px; }

  /* Bannière d'accueil tablette : carte compacte centrée */
  .welcome-banner {
    min-height: 240px;
    margin-bottom: 24px;
    max-width: 560px;
  }
  .welcome-banner__image {
    flex: 0 0 42%;
    max-width: 42%;
  }
  .welcome-banner__img {
    min-height: 240px;
  }
  .welcome-banner__content {
    padding: 18px 16px 30px;
    gap: 8px;
  }
  .welcome-banner__logo {
    max-width: 140px;
  }
  .welcome-banner__title {
    font-size: 14px;
  }
  .welcome-banner__desc {
    font-size: 11px;
  }
  .welcome-banner__cta {
    font-size: 12.5px;
    padding: 8px 16px;
  }
  .welcome-banner__credit {
    font-size: 8px;
    max-width: 38%;
  }

  .profiles-grid {
    flex-wrap: wrap;
    margin: 0;
    padding: 30px 20px;
    border-width: 5px;
  }
  .profile-card {
    flex: 0 0 48%;
    max-width: 48%;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .affiliations-grid {
    grid-template-columns: 1fr;
  }

  .footer-widgets {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-widget--text {
    grid-column: span 1;
  }
  .footer-logo {
    margin: 0 auto;
  }

  .zone-section {
    margin-top: 0;
  }

  .nav-menu {
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    background: var(--dark-deep);
    flex-direction: column;
    padding: 20px;
    transform: translateY(-120%);
    transition: transform var(--transition);
    z-index: 9998;
  }
  .nav-menu.open {
    transform: translateY(0);
  }
  .nav-cta-item {
    margin: 10px 0 0;
  }
  html[dir="rtl"] .nav-cta-item {
    margin: 10px 0 0;
  }

  .section-divider {
    flex-wrap: wrap;
    justify-content: center;
  }
  .divider-title {
    white-space: normal;
    font-size: 16px;
  }
  .section-divider--large .divider-title {
    font-size: 20px;
  }

  .parallax-section {
    background-attachment: scroll;
  }
}


/* ===== SYNTHESIS STARS STYLING ===== */
.star-rating {
  display: flex;
  gap: 4px;
  align-items: center;
}

.star-rating .star {
  font-size: 18px;
  color: #FFD700;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
}

.star-rating .star.empty {
  color: #e0e0e0;
  opacity: 0.3;
}

.synthesis-map {
  margin-top: 30px;
  text-align: center;
}

.synthesis-map img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.map-caption {
  font-size: 12px;
  color: #888;
  margin-top: 10px;
  font-weight: 500;
}

.error-message {
  color: red;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 8px;
}

.nav-error {
  color: red;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 16px;
  background: #ffe5e5;
  border: 1px solid #ff9999;
  border-radius: 6px;
  margin-bottom: 12px;
  text-align: center;
}
html[dir="rtl"] .nav-error {
  text-align: center;
}

.required-star {
  color: red;
  margin-left: 3px;
  font-weight: 700;
}
html[dir="rtl"] .required-star {
  margin-left: 0;
  margin-right: 3px;
}


/* ===== RESPONSIVE – 768px breakpoint (mobile) ===== */
@media (max-width: 768px) {
  .hero-section { padding: 80px 0 24px; }

  /* Bannière d'accueil mobile : carte modale compacte, max 95% largeur */
  .welcome-banner {
    min-height: 200px;
    margin: 0 auto 20px;
    border-radius: 4px;
    max-width: 95%;
  }
  .welcome-banner__image {
    flex: 0 0 40%;
    max-width: 40%;
  }
  .welcome-banner__img {
    min-height: 200px;
    height: 100%;
  }
  .welcome-banner__content {
    padding: 12px 10px 24px;
    gap: 6px;
  }
  .welcome-banner__logo {
    max-width: 110px;
    margin-bottom: 1px;
  }
  .welcome-banner__title {
    font-size: 12px;
    line-height: 1.3;
  }
  .welcome-banner__desc {
    font-size: 10px;
    line-height: 1.4;
  }
  .welcome-banner__cta {
    font-size: 11px;
    padding: 7px 14px;
  }
  .welcome-banner__credit {
    font-size: 7.5px;
    left: 5px;
    bottom: 3px;
    max-width: 36%;
  }
  html[dir="rtl"] .welcome-banner__credit {
    left: auto;
    right: 5px;
  }

  .hero-card {
    padding: 30px 20px 40px;
    border-width: 5px;
  }
  .hero-card-cta {
    font-size: 16px;
    padding: 12px 30px;
  }

  .profiles-grid {
    flex-direction: column;
  }
  .profile-card {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .parallax-section {
    height: 140px;
  }

  .hero-title {
    font-size: 20px;
  }
  .hero-desc {
    font-size: 16px;
    line-height: 22px;
  }

  .survey-body {
    padding: 24px 16px 60px;
  }
  .question-card {
    padding: 18px 20px;
  }
  .likert-option label {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .district-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .district-name {
    min-width: auto;
  }
}


/* ===== RESPONSIVE – 550px breakpoint (small mobile) ===== */
@media (max-width: 550px) {
  :root {
    --container: 100%;
  }

  .hero-title { font-size: 18px; }
  .hero-desc { font-size: 14px; }

  .context-heading { font-size: 14px; }
  .context-body p { font-size: 13px; }

  /* Bannière d'accueil – très petit mobile (<550px) */
  .welcome-banner {
    max-width: 100%;
    min-height: 180px;
  }
  .welcome-banner__image {
    flex: 0 0 40%;
    max-width: 40%;
  }
  .welcome-banner__img { min-height: 180px; }
  .welcome-banner__content {
    padding: 10px 8px 22px;
    gap: 5px;
  }
  .welcome-banner__logo { max-width: 90px; }
  .welcome-banner__title { font-size: 10.5px; }
  .welcome-banner__desc { font-size: 9px; line-height: 1.35; }
  .welcome-banner__cta { font-size: 10px; padding: 6px 10px; }
  .welcome-banner__credit { font-size: 7px; max-width: 36%; }

  .hero-card { padding: 20px 15px 30px; }
  .hero-card-logo { max-width: 180px; }
  .hero-card-title { font-size: 16px; }
  .hero-card-cta { font-size: 14px; padding: 10px 24px; }

  .divider-title { font-size: 14px; }
  .section-divider--large .divider-title { font-size: 16px; }

  .team-banner-title { font-size: 18px; }

  .affiliations-title { font-size: 16px; }

  .survey-header h1 { font-size: 1.2rem; }
  .survey-header p { font-size: 0.8rem; }

  .survey-nav {
    flex-direction: column;
    gap: 12px;
  }
  .survey-nav .btn {
    width: 100%;
    text-align: center;
  }

  .btn {
    padding: 10px 24px;
    font-size: 0.85rem;
  }

  .admin-body { padding: 16px 12px; }
  .stat-number { font-size: 2rem; }

  .footer-bottom { font-size: 12px; }

  .lang-switcher {
    right: 5vw;
  }
  html[dir="rtl"] .lang-switcher {
    left: 5vw;
  }
}


/* ===== RESPONSIVE – 425px breakpoint (extra small) ===== */
@media (max-width: 425px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .responses-table {
    font-size: 0.75rem;
  }
  .responses-table th,
  .responses-table td {
    padding: 8px 10px;
  }

  .likert-group {
    gap: 4px;
  }
  .likert-option label {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    border-radius: 6px;
  }
  .district-rating .likert-option label {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }
}


/* ===== PRINT ===== */
@media print {
  .site-header, .mobile-header, .navbar, .lang-switcher, .lang-bar,
  .header-overlay, .survey-nav, .progress-container { display: none !important; }
  body { background: none !important; }
  .survey-page, .admin-page { padding-top: 0; }
}


/* ============================================================
   EXTENSIONS RULES2 : tokens, a11y, consent, modal, sync, dash
   ============================================================ */

/* --- Design tokens étendus (sans changer l'apparence) --- */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --color-success: #2e7d32;
  --color-warning: #ed6c02;
  --color-error: #d32f2f;
  --color-info: #0277bd;
  --focus-ring: 0 0 0 3px rgba(0, 123, 255, 0.5);
  --z-banner: 10002;
  --z-modal: 10003;
  --z-toast: 10004;
}

/* --- Skip link (WCAG 2.4.1) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-toast);
  background: var(--dark);
  color: #fff;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.skip-link:focus {
  left: 10px;
  top: 10px;
  outline: 3px solid var(--accent);
}

/* --- Focus visible renforcé (WCAG 2.4.7 + 2.4.11) --- */
:focus-visible {
  outline: 3px solid #1976d2;
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible,
.btn:focus-visible,
.btn-next:focus-visible,
.btn-prev:focus-visible,
.btn-submit:focus-visible,
.btn-start:focus-visible,
.lang-btn:focus-visible,
.profile-card:focus-visible {
  outline: 3px solid #1976d2;
  outline-offset: 3px;
  box-shadow: var(--focus-ring);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #1976d2;
  outline-offset: 0;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

/* --- Target size mobile (WCAG 2.5.8) --- */
@media (pointer: coarse) {
  .lang-btn, .btn, .profile-btn, .btn-next, .btn-prev, .btn-submit, .btn-start {
    min-height: 44px;
    min-width: 44px;
  }
  .likert-option label {
    min-height: 44px;
    min-width: 44px;
  }
}

/* --- Reduced motion (WCAG 2.3.3) --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Visually hidden utility pour screen readers --- */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --- Fieldset Likert (a11y) : conserver l'apparence des .question-card --- */
fieldset.question-card {
  min-width: 0;
}
legend.likert-legend {
  padding: 0;
  border: 0;
  display: block;
  width: 100%;
  float: none;
  margin-bottom: 12px;
}

/* ============================================================
   CONSENT BANNER (RGPD)
   ============================================================ */
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.25);
  z-index: var(--z-banner);
  font-size: 14px;
  color: var(--text);
  display: none;
}
.consent-banner.is-visible { display: block; }
.consent-banner h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: var(--dark);
  font-weight: 700;
}
.consent-banner p {
  margin: 0 0 12px 0;
  line-height: 1.5;
  color: var(--text);
}
.consent-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 16px;
}
.consent-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: #f7f7f7;
  border-radius: var(--radius-sm);
}
.consent-option input[type="checkbox"] {
  margin-top: 3px;
  min-width: 18px;
  min-height: 18px;
}
.consent-option .consent-option-label {
  flex: 1;
}
.consent-option .consent-option-title {
  font-weight: 600;
  color: var(--dark);
  display: block;
}
.consent-option .consent-option-desc {
  font-size: 12px;
  color: var(--text-light);
  display: block;
}
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.consent-actions button {
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  border-radius: var(--radius-sm);
  min-height: 44px;
  font-family: inherit;
}
.consent-actions .consent-btn-primary {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.consent-actions .consent-btn-primary:hover { background: #000; }
.consent-actions .consent-btn-reject {
  background: #fff;
  color: var(--text);
}
html[dir="rtl"] .consent-actions { justify-content: flex-start; }

/* Bouton flottant pour rouvrir le consentement */
.consent-reopen {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: var(--z-banner);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
/* Roue dentée masquée — le lien footer est utilisé à la place */
.consent-reopen.is-visible { display: none; }

/* ============================================================
   SYNC / OFFLINE INDICATOR
   ============================================================ */
.sync-indicator {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  padding: 8px 16px;
  background: var(--color-info);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  display: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sync-indicator.is-visible { display: block; }
.sync-indicator.is-offline { background: var(--color-warning); }
.sync-indicator.is-success { background: var(--color-success); }
.sync-indicator.is-error { background: var(--color-error); }

/* Petit toast autosave */
.autosave-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.autosave-toast.is-visible { opacity: 1; }
html[dir="rtl"] .autosave-toast { right: auto; left: 20px; }

/* ============================================================
   REVIEW MODAL (avant submit)
   ============================================================ */
.review-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 20px;
  overflow-y: auto;
}
.review-modal-overlay.is-open { display: flex; }
.review-modal {
  background: #fff;
  border-radius: var(--radius-md);
  max-width: 860px;
  width: 100%;
  margin: 40px auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  padding: 24px 28px 32px;
  position: relative;
  color: var(--text);
}
.review-modal h2 {
  margin: 0 0 6px 0;
  font-size: 22px;
  color: var(--dark);
}
.review-modal .review-intro {
  margin-bottom: 20px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.5;
}
.review-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  color: var(--text);
  line-height: 1;
}
html[dir="rtl"] .review-modal-close { right: auto; left: 12px; }
.review-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: #fafafa;
}
.review-section-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
.review-section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--dark);
  flex: 1;
}
.review-section-summary {
  font-size: 12px;
  color: var(--text-light);
  margin-right: 12px;
}
html[dir="rtl"] .review-section-summary { margin-right: 0; margin-left: 12px; }
.review-section-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  min-height: 28px;
}
.review-section-body {
  display: none;
  padding: 4px 16px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.review-section.is-open .review-section-body { display: block; }
.review-qa {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  display: flex;
  gap: 12px;
}
.review-qa:last-child { border-bottom: none; }
.review-qa-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.review-qa-answer {
  font-weight: 700;
  color: var(--dark);
  min-width: 80px;
  text-align: right;
  font-size: 13px;
}
html[dir="rtl"] .review-qa-answer { text-align: left; }
.review-edit-link {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.review-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}
html[dir="rtl"] .review-modal-actions { justify-content: flex-start; }
.review-modal-actions .btn { min-height: 44px; }

/* ============================================================
   LOGIN ADMIN
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c3e50, #4a6278);
  padding: 20px;
}
.login-card {
  background: #fff;
  padding: 40px 36px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 420px;
}
.login-card h1 {
  font-size: 22px;
  margin: 0 0 8px 0;
  color: var(--dark);
  text-align: center;
}
.login-card .login-sub {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 24px;
  font-size: 13px;
}
.login-card .form-group { margin-bottom: 16px; }
.login-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--dark);
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}
.login-card .btn-login {
  width: 100%;
  background: var(--dark);
  color: #fff;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  margin-top: 8px;
  min-height: 48px;
}
.login-card .btn-login:hover { background: #000; }
.login-error {
  background: #ffe5e5;
  color: var(--color-error);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.login-error.is-visible { display: block; }
.login-success {
  background: #e7f5ea;
  color: var(--color-success);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.login-help {
  font-size: 13px;
  color: var(--text-muted);
  margin: 6px 0 18px;
  line-height: 1.5;
  text-align: center;
}
.login-links {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
}
.login-links a {
  color: var(--dark-brand);
  text-decoration: underline;
}
.login-links a:hover { color: var(--accent); }

/* ============================================================
   DASHBOARD V2
   ============================================================ */
.dash {
  min-height: 100vh;
  background: #f4f6f8;
  padding-top: 60px;
}
.dash-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #1f2937;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.dash-topbar-brand {
  font-weight: 700;
  font-size: 16px;
  margin-right: 24px;
}
.dash-topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.dash-topbar-user .user-role {
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
}
.dash-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.dash-logout:hover { background: rgba(255, 255, 255, 0.1); }

.dash-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.dash-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
  overflow-x: auto;
}
.dash-tab {
  background: transparent;
  border: none;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.dash-tab:hover { color: #1f2937; }
.dash-tab.is-active {
  color: #1f2937;
  border-bottom-color: var(--accent);
}
.dash-panel { display: none; }
.dash-panel.is-active { display: block; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--accent);
}
.kpi-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin-top: 4px;
}
.kpi-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.dash-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}
.dash-card h3 {
  margin: 0 0 16px 0;
  font-size: 15px;
  color: #1f2937;
  font-weight: 700;
}

.dash-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}
.chart-wrap-wide {
  height: 320px;
}

.dash-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.dash-toolbar select,
.dash-toolbar input {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-family: inherit;
  min-height: 40px;
}
.dash-btn {
  background: #1f2937;
  color: #fff;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  min-height: 40px;
  font-family: inherit;
}
.dash-btn:hover { background: #111827; }
.dash-btn.dash-btn-secondary {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
}
.dash-btn.dash-btn-danger { background: var(--color-error); }

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-table th,
.dash-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.dash-table th {
  background: #f9fafb;
  font-weight: 700;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.dash-table tr:hover { background: #fafbfc; }
html[dir="rtl"] .dash-table th,
html[dir="rtl"] .dash-table td { text-align: right; }

.dash-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.dash-bar-fill { height: 100%; background: var(--accent); }

.dash-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.dash-badge-success { background: #d1fae5; color: #065f46; }
.dash-badge-warn { background: #fef3c7; color: #92400e; }
.dash-badge-danger { background: #fee2e2; color: #991b1b; }
.dash-badge-info { background: #dbeafe; color: #1e40af; }

.dash-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
  font-size: 14px;
}

/* Detail drawer */
.dash-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: var(--z-modal);
  align-items: flex-start;
  justify-content: flex-end;
}
.dash-drawer-overlay.is-open { display: flex; }
.dash-drawer {
  background: #fff;
  width: 100%;
  max-width: 640px;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}
.dash-drawer-close {
  float: right;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
}
.dash-drawer h2 { margin-top: 0; font-size: 18px; }
.dash-detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}
.dash-detail-grid dt { font-weight: 600; color: #6b7280; }
.dash-detail-grid dd { margin: 0; color: #1f2937; word-break: break-word; }
.dash-detail-section {
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
  margin-bottom: 14px;
}
.dash-detail-section h4 {
  margin: 0 0 10px 0;
  font-size: 13px;
  text-transform: uppercase;
  color: #6b7280;
}
.dash-detail-answers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
  font-size: 12px;
}
.dash-detail-answers .qa {
  background: #f3f4f6;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.dash-detail-answers .qa strong { display: block; color: var(--accent); }

/* Responsive dashboard */
@media (max-width: 640px) {
  .dash-topbar { padding: 0 12px; }
  .dash-topbar-brand { font-size: 14px; margin-right: 10px; }
  .dash-container { padding: 16px 10px 40px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .dash-tab { padding: 10px 12px; font-size: 13px; }
  .dash-table { font-size: 12px; }
  .dash-table th, .dash-table td { padding: 6px 8px; }
  .dash-detail-grid { grid-template-columns: 100px 1fr; }
}

/* ============================================================
   Lazy loading placeholder (CLS prevention)
   ============================================================ */
img[loading="lazy"] { background: #f0f0f0; }
