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

/* ===== COULEURS DU DRAPEAU DU TCHAD ===== */
:root {
  --primary-blue: #123b7a;
  --primary-yellow: #f4c430;
  --primary-red: #c82333;
  --mbj-navy: var(--primary-blue);
  --mbj-gold: var(--primary-yellow);
  --mbj-ruby: var(--primary-red);
  --mbj-ink: #172033;
  --dark-blue: #0b2857;
  --light-blue: #edf3fb;
  --text-dark: #172033;
  --text-light: #556176;
  --border-color: #d8e0ea;
  --shadow: 0 2px 8px rgba(0, 43, 127, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 43, 127, 0.15);
  --panel-shadow: 0 18px 40px rgba(0, 43, 127, 0.12);
  --soft-border: 1px solid rgba(0, 43, 127, 0.1);
  --header-height: 74px;
  --brand-gradient: linear-gradient(135deg, var(--primary-blue) 0%, #1e5ca8 100%);
  --surface-0: #ffffff;
  --surface-1: #f7f9fc;
  --surface-2: #edf2f8;
  --success-700: #137c4d;
  --success-100: #dcfce7;
  --danger-700: #991b1b;
  --danger-100: #fee2e2;
  --warning-700: #9a3412;
  --warning-100: #fff7ed;
  --focus-ring: rgba(18, 59, 122, 0.28);
  --radius-sm: 6px;
  --radius-md: 8px;
}

/* ===== MODE SOMBRE (bascule manuelle via [data-theme]) =====
   Seuls les tokens neutres (surfaces, texte, bordures) changent : les
   couleurs de marque (bleu/or/rouge du drapeau) restent identiques dans
   les deux themes pour garder une identite visuelle coherente. */
:root[data-theme="dark"] {
  --mbj-ink: #e7ecf5;
  --dark-blue: #6ea3e8;
  --light-blue: #17243c;
  --text-dark: #e7ecf5;
  --text-light: #9fb0cc;
  --border-color: #2b3a56;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 26px rgba(0, 0, 0, 0.5);
  --panel-shadow: 0 18px 42px rgba(0, 0, 0, 0.5);
  --soft-border: 1px solid rgba(255, 255, 255, 0.1);
  --surface-0: #121b30;
  --surface-1: #0d1526;
  --surface-2: #1b2841;
  --success-100: #123322;
  --danger-100: #3a1414;
  --warning-100: #3a2a0c;
  --focus-ring: rgba(244, 196, 48, 0.5);
}

/* ===== SMOOTH SCROLL ===== */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  overflow-x: clip;
}

/* ===== PAGE LOADER ===== */
#page-loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  z-index: 9999;
  background: transparent;
  pointer-events: none;
  opacity: 1;
  will-change: opacity, transform;
}

#page-loader-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary-yellow), var(--primary-red));
  transition: width 0.3s ease;
}

#page-loader.loader-active #page-loader-bar {
  width: 85%;
  transition: width 2s ease;
}

#page-loader.loader-done #page-loader-bar {
  width: 100%;
  transition: width 0.25s ease, opacity 0.3s ease 0.2s;
  opacity: 0;
}

/* ===== NAV ACTIVE LINK ===== */
#main-nav a.nav-active {
  border-bottom-color: var(--primary-yellow);
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.mobile-bottom-nav {
  display: none;
}

/* ===== BURGER MOBILE ===== */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  align-self: center;
  justify-self: end;
  grid-row: 1;
}

.nav-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--surface-0);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-burger.burger-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.burger-open span:nth-child(2) { opacity: 0; }
.nav-burger.burger-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== FOOTER MULTI-COLONNES ===== */
.site-footer {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 70%, #6f1d2c 100%);
  color: #fff;
  margin-top: 60px;
  padding-top: 36px;
}

.site-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 32px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px;
}

.footer-app-promo > p,
.footer-community > p {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 6px;
  line-height: 1.6;
}

.footer-store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 142px;
  min-height: 46px;
  padding: 7px 12px;
  color: #fff;
  background: #101114;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}

.store-badge small {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 500;
}

.store-badge-icon {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
}

.store-badge-play {
  background: linear-gradient(135deg, #34a853 0 34%, #fbbc04 34% 61%, #ea4335 61% 78%, #4285f4 78%);
  clip-path: polygon(10% 0, 100% 50%, 10% 100%);
}

.store-badge-apple {
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 800;
}

.store-badge:hover {
  color: #fff;
  background: #24262b;
}

.store-badge.is-disabled {
  cursor: default;
  opacity: 0.72;
  pointer-events: none;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  opacity: 1 !important;
}

.footer-logo-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--surface-0);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.footer-logo-title {
  font-family: 'Sora', 'Manrope', sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin: 0;
}

.footer-logo-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.footer-socials {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-socials a:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.footer-socials img {
  width: 20px;
  height: 20px;
}

.footer-feature-band {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.footer-app-promo,
.footer-community {
  min-width: 0;
}

.footer-community {
  text-align: right;
}

.footer-community .footer-socials {
  justify-content: flex-end;
}

.footer-col h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
  opacity: 0.7;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col ul li {
  padding: 0;
  font-size: 14px;
  opacity: 0.9;
}

.footer-col ul a {
  color: #fff;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-col ul a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  padding: 14px 24px;
  font-size: 12px;
  opacity: 0.75;
}

/* ===== BOUTON RETOUR EN HAUT ===== */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f3a8f, #1e5cca);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 43, 127, 0.4);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 500;
  pointer-events: none;
}

#back-to-top.back-to-top-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 43, 127, 0.5);
}

/* ===== INPUTS AMÉLIORÉS ===== */
input, select, textarea {
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 43, 127, 0.12);
  background: #f5f9ff;
}

input::placeholder, textarea::placeholder {
  color: #b0bec5;
  font-size: 14px;
}

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

body {
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #f7f9fc 0%, #ffffff 45%, #edf2f8 100%);
}

:root[data-theme="dark"] body {
  background: linear-gradient(180deg, #0d1526 0%, #101a30 45%, #121b30 100%);
}

body.page-ready {
  opacity: 1;
  transform: none;
}

body.page-leaving {
  opacity: 1;
  transform: none;
  pointer-events: none;
  cursor: progress;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(90deg, rgba(16, 47, 114, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 47, 114, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.45;
}

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

/* ===== HEADER / NAVIGATION ===== */
.header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0;
  background: var(--brand-gradient);
  color: #fff;
  padding: 0;
  box-shadow: 0 18px 36px rgba(0, 32, 102, 0.32);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
}

.header h1 {
  font-family: 'Sora', 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 12px 18px;
  background: linear-gradient(90deg, rgba(255, 205, 0, 0.1), rgba(206, 17, 38, 0.1));
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--surface-0);
  box-shadow: 0 8px 18px rgba(1, 24, 76, 0.38);
}

.brand-copy {
  display: grid;
  line-height: 1.08;
  gap: 4px;
}

.brand-title {
  font-family: 'Sora', 'Manrope', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.86;
}

#global-greeting {
  position: relative;
  overflow: hidden;
  padding: 14px 24px;
  background: var(--surface-1);
  border-bottom: 1px solid rgba(0,43,127,.1);
  color: var(--primary-blue);
  font-weight: 600;
  display: none;
}

#global-greeting::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mbj-navy) 0%, var(--mbj-gold) 50%, var(--mbj-ruby) 100%);
}

.header nav {
  display: flex;
  gap: 0;
  padding: 0;
  border-top: 3px solid var(--primary-yellow);
  grid-column: 1 / -1;
  grid-row: 2;
}

.header-user {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-self: end;
  gap: 8px;
  padding: 12px 14px;
  position: relative;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.header-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  min-width: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  align-self: center;
  margin: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.header-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.language-switcher {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 40px;
  line-height: 40px;
  min-height: 40px;
  min-width: 64px;
  width: 64px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  padding: 4px 22px 4px 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  align-self: center;
  margin: 0;
}

.language-switcher option {
  color: #0f172a;
}

.header nav a {
  color: #fff;
  text-decoration: none;
  padding: 12px 20px;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  font-weight: 500;
  font-size: 14px;
  opacity: 0.95;
  touch-action: manipulation;
}

.header nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-bottom-color: var(--primary-yellow);
  opacity: 1;
}

.notification-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: center;
  margin: 0;
}

.header-firstname {
  display: inline-flex;
  align-items: center;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #fff;
}

.notification-bell:hover {
  background: rgba(255, 255, 255, 0.16);
}

.child-manager-tab {
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.tracked-empty-inline {
  margin: 0;
  padding: 0.35rem 0;
}

.notification-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-red);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.notification-panel {
  position: absolute;
  top: 58px;
  right: 0;
  width: min(320px, calc(100vw - 40px));
  background: var(--surface-0);
  color: #0f172a;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 14px;
  z-index: 120;
}

.notification-panel.hidden {
  display: none;
}

.notification-item,
.notification-empty {
  width: 100%;
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 14px;
  color: var(--text-dark);
  background: transparent;
  border-radius: 0;
  cursor: pointer;
}

.notification-item:hover {
  background: rgba(0, 43, 127, 0.06);
}

.notification-item:last-child,
.notification-empty:last-child {
  border-bottom: none;
}

.notification-empty {
  color: #475569;
}

/* ===== SECONDARY DASHBOARDS (ELEVE / PARENT / ENSEIGNANT) ===== */
.simple-dashboard {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.simple-dashboard-head {
  display: grid;
  gap: 12px;
}

.simple-dashboard-head h1 {
  margin: 0;
}

.simple-dashboard-user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.simple-dashboard-user p {
  margin: 0;
  font-weight: 700;
  color: #0f2a59;
}

.simple-dashboard-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(15, 47, 117, 0.18);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.simple-dashboard-avatar-fallback {
  background: linear-gradient(145deg, #e8efff 0%, #dbe9ff 100%);
  display: grid;
  place-items: center;
  font-size: 32px;
}

.simple-dashboard-actions {
  display: grid;
  gap: 10px;
}

.simple-dashboard-actions .btn {
  text-align: center;
}

.role-mobile-hub {
  display: none;
}

.motion-stagger > * {
  opacity: 0;
  transform: translateY(10px);
  animation: dashCardIn 0.34s ease forwards;
}

.motion-stagger > *:nth-child(1) { animation-delay: 0.02s; }
.motion-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.motion-stagger > *:nth-child(3) { animation-delay: 0.14s; }
.motion-stagger > *:nth-child(4) { animation-delay: 0.2s; }

@keyframes dashCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 700px) {
  .simple-dashboard-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== MAIN ===== */
main {
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

/* ===== HERO SECTION ===== */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--light-blue) 0%, #fff 100%);
  border-radius: 12px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.hero h2 {
  font-size: 42px;
  color: var(--primary-blue);
  margin-bottom: 16px;
  font-weight: 700;
}

.hero p {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-home {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  text-align: left;
  gap: 30px;
  padding: 38px;
  border-radius: 20px;
  border: 1px solid rgba(0, 43, 127, 0.12);
  box-shadow: 0 18px 32px rgba(0, 43, 127, 0.16);
}

.hero-home-copy {
  max-width: 620px;
}

.hero-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f3a8f;
}

.hero-home-copy h2 {
  margin-bottom: 14px;
}

.hero-home-copy p {
  margin-left: 0;
  margin-right: 0;
}

.hero-home-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.hero-home-actions .btn {
  min-width: 180px;
}

.hero-home-media {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 360px;
  box-shadow: 0 16px 28px rgba(0, 43, 127, 0.22);
}

.hero-home-media img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center 18%;
  filter: saturate(1.05) contrast(1.03) brightness(1.04);
  display: block;
}

.hero-photo-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(0, 26, 77, 0.72);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(2px);
}

.home-hero {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 26px;
}

.home-hero-media {
  position: relative;
  min-height: 560px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 34px rgba(0, 43, 127, 0.2);
}

.home-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(1.03) contrast(1.03) brightness(1.03);
}

.home-hero-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: #0f2f75;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(0, 43, 127, 0.16);
}

.home-hero-content {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(239, 245, 255, 0.92));
  border-radius: 20px;
  border: var(--soft-border);
  box-shadow: 0 18px 34px rgba(0, 43, 127, 0.14);
  padding: 28px;
}

.home-hero-content h1 {
  font-family: 'Sora', 'Manrope', sans-serif;
  line-height: 1.18;
  font-size: clamp(30px, 4vw, 46px);
  margin-bottom: 14px;
  color: #0f2f75;
}

.home-hero-content > p {
  color: #334155;
  margin: 0 0 16px;
}

.home-estimator-card {
  margin-top: 16px;
  background: var(--surface-0);
  border: 1px solid rgba(0, 43, 127, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 22px rgba(0, 43, 127, 0.1);
}

.estimator-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.estimator-tab {
  border: none;
  padding: 12px 10px;
  font-weight: 700;
  background: #f4f8ff;
  color: #13398c;
  cursor: pointer;
}

.estimator-tab.active {
  background: linear-gradient(135deg, #113782, #1e5cca);
  color: #fff;
}

.estimator-panel {
  padding: 14px;
  border-top: 1px solid rgba(0, 43, 127, 0.08);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.estimator-panel[hidden] {
  display: none;
}

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

.exam-option {
  border: 1px solid rgba(0, 43, 127, 0.16);
  background: var(--surface-0);
  color: #0f2f75;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.exam-option:hover,
.exam-option.is-active {
  background: rgba(17, 55, 130, 0.08);
  box-shadow: 0 8px 18px rgba(0, 43, 127, 0.1);
  transform: translateY(-1px);
}

.estimator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  padding: 14px;
}

.estimator-grid select {
  margin-bottom: 0;
  background: var(--surface-0);
}

.estimator-grid .btn {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.home-trust-strip {
  margin: 14px 0 46px;
  border-radius: 14px;
  border: 1px solid rgba(0, 43, 127, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 20px rgba(0, 43, 127, 0.08);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.home-trust-strip div {
  text-align: center;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.home-trust-strip strong {
  color: #0f2f75;
  font-size: 24px;
  white-space: nowrap;
}

.home-trust-strip span {
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .home-trust-strip strong,
  .home-trust-strip span {
    white-space: normal;
  }
}

.home-mobile-quickstart {
  display: none;
}

.home-mobile-quickstart-head p:last-child {
  margin: 10px 0 0;
  color: #475569;
  line-height: 1.6;
}

.home-mobile-quickstart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-mobile-quick-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(0, 43, 127, 0.1);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 20px rgba(0, 43, 127, 0.08);
}

.home-mobile-quick-card strong {
  display: block;
  color: #0f2f75;
  font-size: 16px;
  margin-bottom: 6px;
}

.home-mobile-quick-card span {
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}

.home-section {
  margin-top: 48px;
}

.section-title-wrap {
  margin-bottom: 20px;
}

.section-title-wrap h2 {
  font-family: 'Sora', 'Manrope', sans-serif;
  color: #0f2f75;
  margin: 0;
}

.home-process .process-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.process-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 43, 127, 0.12);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 20px rgba(0, 43, 127, 0.08);
}

.process-card span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  background: #dbeafe;
  color: #0f2f75;
  margin-bottom: 8px;
}

.process-card h3 {
  margin-bottom: 6px;
  color: #0f2f75;
}

.home-testimonials .testimonials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-testimonials blockquote {
  margin: 0;
  background: rgba(255, 255, 255, 0.96);
  border-left: 4px solid #1e5cca;
  border-radius: 12px;
  padding: 18px;
  color: #334155;
  box-shadow: 0 10px 18px rgba(0, 43, 127, 0.08);
}

.home-testimonials cite {
  display: block;
  margin-top: 10px;
  color: #0f2f75;
  font-style: normal;
  font-weight: 700;
}

.home-cta-band {
  margin-top: 48px;
  text-align: center;
  padding: 32px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f3a8f 0%, #1f5fc7 40%, #ce1126 100%);
  color: #fff;
  box-shadow: 0 18px 30px rgba(0, 43, 127, 0.24);
}

.home-cta-band h2 {
  margin-bottom: 8px;
}

.home-cta-band p {
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 16px;
}

.home-contact-section {
  margin-top: 30px;
  background: var(--surface-0);
  padding: 28px 24px;
  border-radius: 14px;
  border: 1px solid rgba(0, 43, 127, 0.12);
  box-shadow: var(--shadow);
}

.home-contact-section h2 {
  text-align: center;
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.home-contact-section > p {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 22px;
}

.home-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.home-contact-grid article {
  padding: 16px;
  border-radius: 10px;
  background: #f8fbff;
  border: 1px solid rgba(0, 43, 127, 0.1);
}

.home-contact-grid h3 {
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.home-contact-grid a {
  color: var(--primary-blue);
  font-weight: 700;
  text-decoration: none;
}

.home-contact-grid p {
  margin: 0;
  color: #334155;
}

/* ===== FEATURES SECTION ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 60px 0;
}

.feature-card {
  background: var(--surface-0);
  padding: 32px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border-left: 5px solid var(--primary-blue);
  text-align: center;
}

.feature-card:nth-child(2) {
  border-left-color: var(--primary-yellow);
}

.feature-card:nth-child(3) {
  border-left-color: var(--primary-red);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.feature-card h3 {
  color: var(--primary-blue);
  font-size: 24px;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.8;
}

/* ===== BUTTONS ===== */
.btn, button.btn {
  background: var(--brand-gradient);
  color: #fff;
  padding: 12px 28px;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  display: inline-block;
  min-height: 44px;
  touch-action: manipulation;
}

.btn:hover, button.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0, 43, 127, 0.26);
}

.btn:active, button.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(0, 43, 127, 0.18);
}

.btn:focus-visible,
button.btn:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand-gradient);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--primary-blue);
  border: 1px solid var(--border-color);
}

.btn-danger {
  background: linear-gradient(135deg, var(--primary-red) 0%, #a50a1f 100%);
  color: #fff;
}

.btn-outline {
  background: var(--surface-0);
  color: var(--primary-blue);
  border: 1px solid rgba(0, 43, 127, 0.35);
  padding: 10px 26px;
}

.btn-outline:hover {
  background: var(--surface-2);
}

.text-success {
  color: var(--success-700) !important;
}

.text-danger {
  color: var(--danger-700) !important;
}

.text-warning {
  color: var(--warning-700) !important;
}

.surface-card {
  background: var(--surface-0);
  border: var(--soft-border);
  border-radius: 12px;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ===== FORMS ===== */
form {
  max-width: 500px;
  margin: 20px auto;
  background: var(--surface-0);
  padding: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

form h2 {
  color: var(--primary-blue);
  margin-bottom: 24px;
  font-size: 28px;
}

.page-narrow {
  max-width: 680px;
  margin: 0 auto;
}

.info-card {
  background: var(--surface-0);
  border: var(--soft-border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.info-card-compact {
  max-width: 520px;
  margin: 48px auto;
  text-align: center;
  padding: 34px;
}

.grid-2-equal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stack-md {
  margin-top: 14px;
}

.actions-inline {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions-inline .btn {
  min-width: 0;
}

.status-success {
  color: var(--success-700);
}

.status-error {
  color: var(--danger-700);
}

.status-help {
  color: var(--text-light);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
}

input, select {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  /* 16px, not 15px: below 16px, iOS Safari auto-zooms the whole page on
     focus, which is jarring on a form-heavy flow like this. */
  font-size: 16px;
  transition: all 0.3s ease;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: rgba(1, 48, 138, 0.2);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 43, 127, 0.1);
  background-color: var(--light-blue);
}

/* ===== MESSAGES / TOASTS ===== */
.toast {
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: 8px;
  display: none;
  font-size: 15px;
  border-left: 5px solid;
  animation: slideIn 0.3s ease;
  box-shadow: 0 10px 22px rgba(0, 43, 127, 0.08);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-success {
  display: block;
  background: var(--success-100);
  border-color: var(--success-700);
  color: var(--success-700);
}

.toast-error {
  display: block;
  background: var(--danger-100);
  border-color: var(--danger-700);
  color: var(--danger-700);
}

.toast-warning {
  display: block;
  background: var(--warning-100);
  border-color: var(--warning-700);
  color: var(--warning-700);
}

.toast a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}

.messagerie-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.messagerie-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.message-notification-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 43, 127, 0.08);
  color: var(--primary-blue);
  border: 1px solid rgba(0, 43, 127, 0.16);
  font-weight: 700;
}

.message-notification-banner strong {
  margin-right: 6px;
}

.chat-messages {
  min-height: 240px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--surface-1);
  margin-bottom: 16px;
}

.chat-bubble {
  max-width: 90%;
  padding: 12px 14px;
  border-radius: 16px;
  position: relative;
  line-height: 1.5;
}

.chat-bubble.incoming {
  background: var(--surface-0);
  align-self: flex-start;
  border: 1px solid rgba(0, 43, 127, 0.08);
}

.chat-bubble.outgoing {
  background: rgba(0, 43, 127, 0.08);
  align-self: flex-end;
}

.chat-time {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

.chat-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  margin-bottom: 12px;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

/* ===== UTILITIES ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}

.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mt-40 { margin-top: 40px; }
.mb-40 { margin-bottom: 40px; }

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(0, 43, 127, 0.1), rgba(255, 205, 0, 0.16)),
    linear-gradient(40deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.65));
  padding: 28px 32px;
  border-radius: 20px;
  margin-bottom: 32px;
  box-shadow: var(--panel-shadow);
  border: var(--soft-border);
  position: relative;
  overflow: hidden;
}

.dashboard-hero::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 205, 0, 0.35), rgba(255, 205, 0, 0));
  pointer-events: none;
}

.dashboard-hero .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 205, 0, 0.15);
  color: var(--primary-blue);
  font-weight: 700;
  margin-bottom: 12px;
  width: fit-content;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-panel {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.section-header h2 {
  margin-bottom: 8px;
}

.panel-card {
  background: var(--surface-0);
  padding: 28px;
  border-radius: var(--radius-md);
  box-shadow: var(--panel-shadow);
  border: var(--soft-border);
}

.dashboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dashboard-list li {
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}

.dashboard-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary-blue);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface-0);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0, 43, 127, 0.11);
  border: var(--soft-border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0, 43, 127, 0.16);
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--text-light);
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.teacher-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.teacher-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.avatar-stack {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.app-avatar,
.app-avatar-fallback {
  border-radius: 50%;
  flex-shrink: 0;
}

.app-avatar {
  object-fit: cover;
  background: #e5e7eb;
}

.app-avatar-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: white;
  font-weight: 700;
  text-transform: uppercase;
}

.app-avatar-sm,
.app-avatar-fallback.app-avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.app-avatar-md,
.app-avatar-fallback.app-avatar-md {
  width: 56px;
  height: 56px;
  font-size: 1rem;
}

.app-avatar-lg,
.app-avatar-fallback.app-avatar-lg {
  width: 140px;
  height: 140px;
  font-size: 3.5rem;
}

.app-avatar-ring-primary {
  border: 3px solid #2563eb;
}

.app-avatar-ring-soft {
  border: 2px solid #dbeafe;
}

.teacher-card-footer {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.teacher-card-footer .btn,
.teacher-card-footer .btn-outline {
  padding: 9px 18px;
  font-size: 14px;
  min-width: auto;
}

.teacher-card-footer .btn-primary {
  padding: 9px 18px;
}

.teacher-result-compact {
  padding: 14px 16px;
}

.teacher-result-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.teacher-result-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.teacher-result-name {
  font-size: 1rem;
  font-weight: 800;
  color: #0f2f75;
}

.teacher-result-subject {
  margin: 3px 0 0;
  font-size: 13px;
  color: #475569;
}

#teachers-results-inline,
#teachers-results,
#parent-recommendations-results,
#student-recommendations-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.teacher-result-compact:hover {
  transform: none;
  box-shadow: 0 12px 20px rgba(0, 43, 127, 0.11);
}

.teacher-details-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
}

.teacher-details-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.teacher-details-dialog {
  position: relative;
  width: min(860px, calc(100% - 24px));
  max-height: calc(100vh - 40px);
  /* dvh accounts for the mobile browser's address bar, which vh does not.
     Declared after the vh fallback so unsupporting browsers keep that
     value. */
  max-height: calc(100dvh - 40px);
  overflow: auto;
  margin: 20px auto;
  border-radius: 16px;
  border: 1px solid rgba(15, 58, 143, 0.18);
  background: var(--surface-0);
  box-shadow: 0 26px 56px rgba(15, 23, 42, 0.28);
  padding: 16px 18px 18px;
}

.teacher-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.teacher-details-header h3 {
  margin: 0;
}

.teacher-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.teacher-price {
  color: var(--primary-red);
  font-weight: 700;
}

.search-form {
  display: grid;
  gap: 16px;
}

.search-form .form-row {
  display: grid;
  gap: 10px;
}

.search-form .small-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.search-form input,
.search-form select {
  width: 100%;
}

.small-filter-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 20px;
}

.small-filter-box select,
.small-filter-box button {
  min-width: 160px;
}

.teacher-search-page {
  max-width: 1000px;
  margin: 30px auto;
  padding: 20px;
}

.teacher-search-title {
  color: var(--primary-blue);
  margin-bottom: 30px;
}

.teacher-search-intro {
  margin-bottom: 20px;
  color: #555;
  max-width: 800px;
}

.teacher-search-filters {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
}

.teacher-search-filters h3 {
  margin-bottom: 15px;
}

.teacher-search-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.teacher-search-field label {
  font-weight: 600;
}

.teacher-search-field input,
.teacher-search-field select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.teacher-search-form-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.teacher-search-form-actions .btn,
.teacher-search-form-actions .btn-primary {
  flex: 1;
  padding: 10px;
}

.teacher-search-results {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.teacher-search-results-message {
  text-align: center;
  color: #666;
  grid-column: 1 / -1;
}

.teacher-search-results-message.is-empty {
  color: #999;
}

.teacher-search-results-message.is-error {
  color: red;
}

.teacher-search-result-card {
  background: var(--surface-0);
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.teacher-search-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.teacher-search-result-card-body {
  padding: 20px;
}

.teacher-search-result-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.teacher-search-result-name {
  margin: 0;
  color: var(--primary-blue);
}

.teacher-search-result-subject {
  margin: 5px 0 0;
  color: #666;
  font-size: 14px;
}

.teacher-search-result-meta {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.teacher-search-result-meta p {
  margin: 0 0 8px;
  font-size: 14px;
}

.teacher-search-result-meta p:last-child {
  margin-bottom: 0;
}

.teacher-search-result-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-blue);
}

.teacher-search-result-description {
  margin: 0 0 12px;
  font-size: 14px;
  color: #555;
}

.teacher-search-result-availability {
  margin: 0 0 15px;
  font-size: 13px;
  color: #777;
}

.teacher-search-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.teacher-search-result-actions .btn,
.teacher-search-result-actions .btn-primary {
  text-align: center;
  padding: 10px;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
}

.range-value {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 14px;
}

.badge-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 43, 127, 0.08);
  color: var(--primary-blue);
  font-size: 13px;
  font-weight: 700;
}

/* ===== DASHBOARD ENHANCEMENTS ===== */
#dashboard-shell {
  display: grid;
  gap: 22px;
}

#dashboard-title {
  font-family: 'Sora', 'Manrope', sans-serif;
  letter-spacing: 0.01em;
}

#dashboard-subtitle {
  color: #334155;
  font-weight: 500;
}

.dashboard-right-panel {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.dashboard-user-meta {
  width: 100%;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 43, 127, 0.14);
  backdrop-filter: blur(6px);
}

.user-label {
  margin: 0;
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-info h3 {
  margin: 2px 0 0;
  line-height: 1.25;
}

.dashboard-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: var(--soft-border);
  box-shadow: 0 8px 22px rgba(0, 43, 127, 0.1);
  margin-bottom: 6px;
}

.overview-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(238, 245, 255, 0.92));
  border-radius: 20px;
  border: var(--soft-border);
  box-shadow: 0 16px 34px rgba(0, 43, 127, 0.14);
  padding: 24px;
}

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.overview-head h2 {
  margin: 4px 0 6px;
  font-family: 'Sora', 'Manrope', sans-serif;
}

.overview-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f3a8f;
}

.overview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.overview-chip {
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  color: #0f3a8f;
  border: 1px solid rgba(15, 58, 143, 0.22);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 7px 12px;
  transition: all 0.2s ease;
}

.overview-chip:hover {
  background: #0f3a8f;
  color: white;
  border-color: #0f3a8f;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.overview-card {
  border-radius: 14px;
  border: 1px solid rgba(0, 43, 127, 0.16);
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 14px 12px;
}

.overview-label {
  margin: 0;
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}

.overview-value {
  margin: 6px 0 0;
  font-size: 28px;
  line-height: 1.1;
  color: #0f2f75;
  font-weight: 800;
}

.overview-value-status {
  font-size: 22px;
  color: #0f8b42;
}

.tab-item {
  border: 1px solid rgba(0, 43, 127, 0.2);
  border-radius: 999px;
  background: var(--surface-0);
  color: #0f2f75;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.22s ease;
}

.tab-item:hover {
  background: rgba(0, 43, 127, 0.06);
}

.tab-item.active {
  background: linear-gradient(135deg, #0f3a8f 0%, #1959c1 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 14px rgba(2, 45, 122, 0.25);
}

.text-small {
  color: #475569;
  font-size: 14px;
}

.profile-form {
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.teacher-declaration-notice {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 600;
}

.profile-phone-fields {
  display: grid;
  grid-template-columns: minmax(106px, 0.34fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.profile-phone-country,
.profile-phone-local {
  min-width: 0;
}

.profile-phone-fields select,
.profile-phone-fields input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  /* 16px: below that, iOS Safari auto-zooms the page on focus. */
  font-size: 16px;
}

.profile-phone-fields select {
  padding-left: 6px;
  padding-right: 6px;
  text-overflow: ellipsis;
}

.profile-photo-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-photo-file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.profile-photo-file-name {
  max-width: 100%;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.form-row {
  margin-bottom: 14px;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.agenda-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agenda-filter-btn.active {
  background: linear-gradient(135deg, #0f3a8f 0%, #1a57b6 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(15, 58, 143, 0.24);
}

.agenda-day-card {
  border-left: 4px solid #d0d5dd;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.agenda-day-card.agenda-day-has-session {
  border-left-color: #15803d;
  background: #ecfdf3;
}

.agenda-day-card.agenda-day-empty {
  background: #f8fafc;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.availability-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.availability-counter-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 58, 143, 0.2);
  background: rgba(15, 58, 143, 0.08);
  color: #0f2f75;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 12px;
}

.availability-legend {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.availability-day-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 58, 143, 0.18);
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff 0%, #f4f8ff 100%);
  box-shadow: 0 8px 18px rgba(15, 58, 143, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.availability-day-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(15, 58, 143, 0.13);
  border-color: rgba(15, 58, 143, 0.32);
}

.availability-day-card input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.availability-day-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid rgba(15, 58, 143, 0.35);
  background: var(--surface-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.availability-day-mark::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg) translateY(-1px);
}

.availability-day-name {
  color: #0f2f75;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.availability-day-card input[type='checkbox']:checked + .availability-day-mark {
  border-color: #0f3a8f;
  background: linear-gradient(135deg, #0f3a8f 0%, #1a57b6 100%);
  box-shadow: 0 6px 12px rgba(15, 58, 143, 0.28);
}

.availability-day-card input[type='checkbox']:checked + .availability-day-mark::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}

.availability-day-card input[type='checkbox']:checked ~ .availability-day-name {
  color: #0b275e;
}

.niveau-checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.niveau-checkbox-card .availability-day-name small {
  display: block;
  font-weight: 600;
  color: #64748b;
  font-size: 12px;
}

.profile-price-info {
  padding: 14px 16px;
  border: 1px solid rgba(15, 58, 143, 0.18);
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff 0%, #f4f8ff 100%);
}

.profile-price-info-label {
  display: block;
  color: #0f2f75;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.profile-price-breakdown {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.profile-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 58, 143, 0.05);
  font-size: 13.5px;
  font-weight: 700;
  color: #0f2f75;
}

.profile-price-row small {
  font-weight: 600;
  color: #475569;
}

.profile-price-note {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .niveau-checklist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.diploma-policy-callout {
  border: 1px solid rgba(15, 58, 143, 0.18);
  background: linear-gradient(180deg, rgba(15, 58, 143, 0.06), rgba(255, 255, 255, 0.98));
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.diploma-policy-title {
  margin: 0 0 6px;
  font-weight: 800;
  color: #0f2f75;
}

.diploma-policy-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #334155;
  font-size: 14px;
}

.diploma-policy-list li {
  margin-bottom: 4px;
}

.diploma-interview-notice {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(15, 58, 143, 0.18);
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.diploma-status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.diploma-status-pending {
  background: rgba(180, 83, 9, 0.12);
  color: #92400e;
  border: 1px solid rgba(146, 64, 14, 0.22);
}

.diploma-status-confirmed {
  background: rgba(22, 101, 52, 0.12);
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.24);
}

.diploma-status-rejected {
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.24);
}

.diploma-status-unknown {
  background: rgba(71, 85, 105, 0.12);
  color: #334155;
  border: 1px solid rgba(71, 85, 105, 0.24);
}

input[type='range'] {
  accent-color: var(--primary-blue);
}

textarea {
  width: 100%;
  border: 1px solid rgba(0, 43, 127, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: var(--surface-0);
}

textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 43, 127, 0.12);
}

#dashboard-content {
  animation: dashboardFadeIn 0.35s ease;
}

@keyframes dashboardFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.exercise-correction summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 10px;
}

.exercise-correction p {
  margin: 0;
}

@media (max-width: 1050px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-hero-media {
    min-height: 420px;
  }

  .home-trust-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-process .process-grid,
  .home-testimonials .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Footer 2 colonnes sur tablette */
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .footer-feature-band {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 16px;
  }

  .footer-community {
    text-align: left;
  }

  .footer-community .footer-socials {
    justify-content: flex-start;
  }

  .dashboard-hero,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    flex-direction: column;
    text-align: center;
  }

  .dashboard-right-panel {
    width: 100%;
    justify-items: center;
  }

  .dashboard-actions {
    justify-content: center;
  }

  .dashboard-tabs {
    justify-content: center;
  }

  .overview-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .overview-chips {
    justify-content: center;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .availability-grid {
    grid-template-columns: 1fr;
  }

  .agenda-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.55;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
    background:
      radial-gradient(circle at 14% -18%, rgba(16, 47, 114, 0.2), transparent 40%),
      radial-gradient(circle at 86% -16%, rgba(241, 191, 36, 0.22), transparent 35%),
      linear-gradient(180deg, #f2f6ff 0%, #eef4ff 100%);
  }

  main {
    display: grid;
    gap: 14px;
    padding: 14px 12px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
    max-width: 100%;
    overflow-x: hidden;
  }

  main > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  body.menu-open {
    overflow: hidden;
  }

  .hero {
    padding: 40px 20px;
  }

  .hero-home {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 24px;
  }

  .home-hero-content {
    padding: 20px;
    display: grid;
    gap: 14px;
  }

  .home-hero-media {
    min-height: 320px;
  }

  .home-mobile-quickstart {
    display: grid;
    gap: 14px;
    margin: 0 0 22px;
  }

  .home-trust-strip {
    margin-top: 0;
  }

  .home-hero-content h1 {
    font-size: clamp(26px, 7vw, 34px);
    margin-bottom: 0;
  }

  .home-hero-content > p,
  .home-mobile-quickstart-head p:last-child,
  .home-contact-section > p,
  .feature-card p,
  .process-card p,
  .home-testimonials blockquote,
  .home-contact-grid a,
  .home-contact-grid p {
    font-size: 15px;
  }

  .home-hero-badge,
  .hero-eyebrow,
  .home-trust-strip span,
  .mobile-app-primary-label,
  .dashboard-mobile-primary-label,
  .dashboard-side-link,
  .messagerie-mobile-tab,
  .text-small,
  .notification-item,
  .notification-empty {
    font-size: 13px;
  }

  .section-title-wrap h2,
  .home-cta-band h2,
  .home-contact-section h2,
  .section-header h2,
  .overview-head h2,
  .messagerie-header h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .feature-card h3,
  .process-card h3,
  .card h3 {
    font-size: 18px;
  }

  .btn,
  button.btn,
  .header nav a {
    font-size: 14px;
  }

  .btn,
  button.btn,
  .btn-outline,
  .btn-secondary {
    min-height: 44px;
    border-radius: 12px;
    font-weight: 700;
  }

  .home-mobile-quickstart-grid,
  .home-contact-grid {
    grid-template-columns: 1fr;
  }

  .home-trust-strip strong {
    font-size: 22px;
  }

  .estimator-grid {
    grid-template-columns: 1fr;
  }

  .home-trust-strip {
    grid-template-columns: 1fr;
  }

  .hero-home-copy {
    margin: 0 auto;
  }

  .hero-home-copy p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-home-actions {
    justify-content: center;
  }

  .hero-home-media {
    min-height: 300px;
  }

  .hero-home-media img {
    min-height: 300px;
  }

  .hero h2 {
    font-size: 32px;
  }

  form {
    padding: 16px;
    margin: 8px auto;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    background: var(--surface-0);
  }

  label {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f2a59;
  }

  .info-card,
  .info-card-compact {
    padding: 22px;
  }

  .grid-2-equal {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .actions-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-inline .btn {
    width: 100%;
    text-align: center;
  }

  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    padding: 10px 12px;
    background: var(--surface-0);
  }

  input::placeholder,
  textarea::placeholder {
    color: #6b7280;
    opacity: 0.95;
  }

  textarea {
    min-height: 110px;
  }

  /* Burger visible sur mobile */
  .nav-burger {
    display: flex;
    grid-column: 3;
    grid-row: 1;
    padding: 12px 16px;
  }

  /* Nav cachée par défaut, dépliée en overlay */
  .header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    padding-top: env(safe-area-inset-top);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    margin: 0 8px;
    width: calc(100% - 16px);
    top: 8px;
  }

  .header nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: linear-gradient(145deg, #012a77, #004fb5);
    z-index: 200;
    border-top: 3px solid var(--primary-yellow);
    box-shadow: 0 8px 24px rgba(0, 32, 102, 0.4);
    grid-column: unset;
    grid-row: unset;
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
  }

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

  .header nav a {
    padding: 14px 20px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-left: none;
  }

  .header-user {
    grid-column: unset;
    grid-row: 1;
    padding-right: 8px;
    gap: 6px;
  }

  .language-switcher {
    min-width: 58px;
    width: 58px;
    font-size: 12px;
    padding: 4px 20px 4px 7px;
  }

  .header-firstname {
    display: none;
  }

  .header h1 {
    font-size: clamp(16px, 4.4vw, 20px);
    padding: 10px 12px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-tagline {
    font-size: 9px;
    letter-spacing: 0.08em;
  }

  .notification-panel {
    right: 0;
    width: min(340px, calc(100vw - 24px));
  }

  .panel-card,
  .card {
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(0, 43, 127, 0.08);
    box-shadow: 0 11px 24px rgba(0, 43, 127, 0.1);
  }

  .card h3,
  .panel-card h3 {
    line-height: 1.3;
  }

  .site-footer {
    margin-top: 28px;
    padding-top: 20px;
  }

  .site-footer-inner {
    gap: 14px;
    padding: 0 14px 18px;
  }

  .footer-col ul {
    gap: 5px;
  }

  .footer-bottom {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .teacher-search-page {
    margin: 16px auto;
    padding: 14px 10px;
  }

  .teacher-search-title {
    margin-bottom: 12px;
    font-size: 1.45rem;
    line-height: 1.2;
  }

  .teacher-search-intro {
    margin-bottom: 14px;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .teacher-search-filters {
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 16px;
  }

  .teacher-search-filters h3 {
    margin-bottom: 10px;
    font-size: 0.98rem;
  }

  .teacher-search-field label {
    font-size: 0.86rem;
    margin-bottom: 6px;
    display: block;
  }

  .teacher-search-field input,
  .teacher-search-field select {
    min-height: 44px;
    border-radius: 10px;
    padding: 10px 11px;
  }

  .teacher-search-form-grid,
  .search-form .small-grid,
  .teacher-search-result-actions {
    grid-template-columns: 1fr;
  }

  .teacher-search-form-actions {
    gap: 8px;
  }

  .teacher-search-form-actions .btn,
  .teacher-search-form-actions .btn-primary {
    min-height: 44px;
  }

  .teacher-search-results {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .teacher-search-result-card-body {
    padding: 14px;
  }

  .teacher-search-result-header {
    gap: 10px;
    margin-bottom: 10px;
  }

  .teacher-search-result-name {
    font-size: 1rem;
  }

  .teacher-search-result-meta {
    padding: 10px;
    margin-bottom: 10px;
  }

  .teacher-search-result-description,
  .teacher-search-result-availability {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .teacher-search-saved-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .teacher-search-saved-btn {
    width: 100%;
    text-align: left;
    min-height: 42px;
  }

  .teacher-search-form-actions,
  .messagerie-header,
  .messagerie-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .teacher-search-form-actions .btn,
  .teacher-search-form-actions .btn-primary,
  .button-row .btn,
  .button-row .btn-outline,
  .hero-home-actions .btn {
    width: 100%;
    text-align: center;
  }

  .small-filter-box select,
  .small-filter-box button {
    min-width: 0;
    width: 100%;
  }

  #admin-search {
    width: 100% !important;
  }

  #back-to-top {
    right: 14px;
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    justify-content: stretch;
    gap: 6px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 700;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(148deg, rgba(11, 40, 87, 0.98), rgba(18, 59, 122, 0.97));
    box-shadow: 0 14px 30px rgba(11, 40, 87, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
  }

  .mobile-nav-link {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 6px 5px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
    touch-action: manipulation;
  }

  .mobile-nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .mobile-nav-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-nav-link.mobile-nav-active,
  .mobile-nav-link:hover {
    background: rgba(255, 205, 0, 0.2);
    color: #fff;
    transform: translateY(-1px);
  }

  .mobile-nav-link:active {
    transform: translateY(0);
    background: rgba(255, 205, 0, 0.28);
  }
}


@media (max-width: 560px) {
  .profile-phone-fields {
    grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr);
  }

  .profile-phone-fields select,
  .profile-phone-fields input {
    /* Kept at 16px even on the narrowest screens: shrinking it further
       would trigger iOS Safari's auto-zoom-on-focus on exactly the
       devices where that's most disruptive. */
    font-size: 16px;
    padding-left: 8px;
    padding-right: 8px;
  }

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

  body {
    font-size: 14px;
  }

  .header {
    min-height: 68px;
  }

  .header h1 {
    padding: 9px 10px;
  }

  .brand-copy {
    max-width: 150px;
  }

  .brand-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-tagline {
    display: none;
  }

  .language-switcher {
    min-width: 52px;
    width: 52px;
  }

  .notification-bell {
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
    padding: 0 6px;
  }

  .notification-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 16px));
  }

  .mobile-bottom-nav {
    left: 8px;
    right: 8px;
    gap: 5px;
    padding: 7px 8px;
  }

  .mobile-nav-link {
    min-height: 52px;
    padding: 5px 2px;
  }

  .mobile-nav-text {
    font-size: 10px;
    line-height: 1.1;
    white-space: normal;
  }

  .home-hero-content {
    padding: 18px;
    border-radius: 16px;
  }

  .home-hero-content h1 {
    font-size: 25px;
  }

  .section-title-wrap h2,
  .home-cta-band h2,
  .home-contact-section h2,
  .section-header h2,
  .overview-head h2,
  .messagerie-header h1 {
    font-size: 21px;
  }

  .feature-card h3,
  .process-card h3,
  .card h3,
  .home-mobile-quick-card strong {
    font-size: 17px;
  }

  .home-hero-content > p,
  .home-mobile-quickstart-head p:last-child,
  .feature-card p,
  .process-card p,
  .home-testimonials blockquote,
  .home-contact-grid a,
  .home-contact-grid p,
  .home-mobile-quick-card span {
    font-size: 14px;
  }

  .dashboard-mobile-primary-label,
  .mobile-app-primary-label,
  .hero-eyebrow,
  .home-hero-badge,
  .home-trust-strip span,
  .text-small {
    font-size: 12px;
  }

  .btn,
  button.btn,
  .header nav a,
  .messagerie-mobile-tab,
  .dashboard-side-link {
    font-size: 13px;
  }

  .dashboard-actions .btn,
  .dashboard-actions .btn-outline,
  .button-row .btn,
  .button-row .btn-outline {
    width: 100%;
  }

  .home-contact-section {
    padding: 20px 16px;
  }

  .header {
    margin: 0 6px;
    width: calc(100% - 12px);
    top: 6px;
  }

  .site-footer { display: none; }

  /* Footer 1 colonne sur mobile */
  .site-footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-footer {
    display: none;
  }

  .site-footer.site-footer-home {
    display: block;
    margin-top: 28px;
    padding-top: 0;
  }

  .site-footer-home .site-footer-inner,
  .site-footer-home .footer-community {
    display: none;
  }

  .site-footer-home .footer-feature-band {
    padding: 24px 16px;
  }

  .site-footer-home .footer-app-promo {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .simple-dashboard {
    gap: 10px;
  }

  .simple-dashboard-head {
    padding: 12px;
  }

  .simple-dashboard-head h1 {
    font-size: 1.18rem;
    line-height: 1.2;
  }

  .simple-dashboard-user {
    gap: 8px;
  }

  .simple-dashboard-user p {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .simple-dashboard-avatar {
    width: 62px;
    height: 62px;
  }

  .simple-dashboard-avatar-fallback {
    font-size: 24px;
  }

  .simple-dashboard-actions .btn {
    min-height: 46px;
  }

  .role-mobile-hub {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .role-mobile-link {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 3px;
    min-height: 66px;
    padding: 10px 11px;
    text-decoration: none;
    border-radius: 14px;
    color: #0f2f75;
    background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
    border: 1px solid rgba(15, 47, 117, 0.13);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  }

  .role-mobile-link:active {
    transform: translateY(1px);
  }

  .role-mobile-link strong {
    font-size: 0.86rem;
    line-height: 1.2;
  }

  .role-mobile-link span {
    font-size: 0.74rem;
    color: #5b6b84;
    line-height: 1.2;
  }
}

@media (hover: none) {
  .card:hover,
  .feature-card:hover,
  .overview-service-card:hover,
  #back-to-top:hover,
  .btn:hover,
  button.btn:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== LOADING SPINNERS & SKELETONS ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 43, 127, 0.1);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 16px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Loading badge */
.loading-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: rgba(0, 43, 127, 0.05);
  border-radius: 6px;
  font-size: 13px;
  color: var(--primary-blue);
  font-weight: 500;
}

/* Error state styles */
.error-state {
  padding: 16px;
  background-color: #fff3cd;
  border-left: 4px solid var(--primary-red);
  border-radius: 4px;
  color: #663c00;
  font-size: 14px;
}

.error-state-icon::before {
  content: "⚠ ";
  font-weight: bold;
}

/* Success state styles */
.success-state {
  padding: 16px;
  background-color: #d4edda;
  border-left: 4px solid #28a745;
  border-radius: 4px;
  color: #155724;
  font-size: 14px;
}

.success-state-icon::before {
  content: "✓ ";
  font-weight: bold;
}

/* ============================================================
   Header mobile : marque TchadEdu a gauche, bouton compte
   circulaire (remplace l'ancien menu burger) a droite, apres les
   bascules theme et langue. Bloc place en toute fin de fichier et
   gardant !important sur les proprietes de mise en page : .header
   a plusieurs definitions grid/flex plus haut (styles.css et
   landing.css, pour differents paliers de largeur) qui s'etaient
   deja marche dessus par le passe (voir le bug du tiroir mobile du
   tableau de bord) — ce bloc est volontairement le dernier mot.
   ============================================================ */
.nav-account-toggle {
  display: none;
}

@media (max-width: 768px) {
  .header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }

  .header h1.brand-root {
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0;
    flex: 1 1 auto;
  }

  .header-user {
    grid-column: auto !important;
    grid-row: auto !important;
    flex: 0 0 auto;
  }

  .nav-account-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .nav-account-toggle svg {
    width: 20px;
    height: 20px;
  }

  .nav-account-toggle:hover,
  .nav-account-toggle.burger-open {
    background: rgba(255, 255, 255, 0.3);
  }

  .header-firstname {
    display: none !important;
  }

  #main-nav {
    display: none;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: auto !important;
    right: 10px !important;
    width: auto !important;
    min-width: 190px !important;
    max-width: calc(100vw - 20px) !important;
    max-height: none !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 16px 36px rgba(0, 32, 102, 0.32) !important;
    grid-column: unset !important;
    grid-row: unset !important;
  }

  #main-nav.nav-open {
    display: flex !important;
  }

  #main-nav a {
    border-left: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    white-space: nowrap;
  }

  #main-nav a:last-child {
    border-bottom: none !important;
  }
}

/* ============================================================
   Fenetre "continuer sur le web ou telecharger l'appli" —
   mobile uniquement (affichee/masquee par JS selon l'OS), un
   bandeau type bottom-sheet pour rester coherent avec le reste
   des composants mobiles de l'app (messagerie, menu compte...).
   ============================================================ */
.app-install-prompt {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.app-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 20, 46, 0.55);
}

.app-install-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--surface-0, #fff);
  color: var(--text-dark, #0f172a);
  border-radius: 20px 20px 0 0;
  padding: 24px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  box-shadow: 0 -16px 40px rgba(6, 20, 48, 0.35);
}

.app-install-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: block;
}

.app-install-sheet h2 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--primary-blue, #002b7f);
}

.app-install-text {
  font-size: 14px;
  color: var(--text-light, #5b6b8c);
  margin: 0 0 18px;
  line-height: 1.5;
}

.app-install-soon {
  font-size: 13px;
  color: #92400e;
  background: #fff7e6;
  border: 1px solid #f4c430;
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 0 14px;
}

.app-install-actions {
  display: grid;
  gap: 10px;
}

.app-install-btn-primary,
.app-install-btn-secondary {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.app-install-btn-primary {
  border: 0;
  background: linear-gradient(135deg, #ffdf74 0%, #f4c430 55%, #d9a521 100%);
  color: #3a2a06;
}

.app-install-btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.app-install-btn-secondary {
  border: 1px solid var(--border-color, #d7dfef);
  background: transparent;
  color: var(--primary-blue, #002b7f);
}

body.app-install-open {
  overflow: hidden;
}

@media (min-width: 769px) {
  /* Le prompt ne s'affiche de toute facon jamais sur ordinateur (le script
     ne le demasque que pour iOS/Android), mais au cas ou une fenetre
     desktop serait redimensionnee a une largeur de telephone, on garde un
     dialogue centre plutot qu'un bottom-sheet. */
  .app-install-prompt {
    align-items: center;
  }

  .app-install-sheet {
    border-radius: 20px;
    padding: 28px;
  }
}
