﻿body {
  background: #f8f9f7;
  overflow-x: hidden;
}

::selection {
  background: #6ca16e;
  color: #fff;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #eef3ee; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6ca16e, #4e7c5a);
  border-radius: 10px;
  border: 2px solid #eef3ee;
}

/* Décale les ancres sous la navbar fixe */
section[id] { scroll-margin-top: 70px; }

/* ===== Navbar sticky ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar .nav-link {
  position: relative;
  text-decoration: none !important;
}

.navbar .nav-link::after {
  content: "";
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: #ff6600;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
  transform: scaleX(1);
}

.navbar .nav-link.active { color: #4e7c5a !important; font-weight: 600; }

/* ===== Titres de section ===== */
.section-title {
  display: table;           /* centré, sur sa propre ligne */
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 15px;
  font-weight: 800;
  letter-spacing: .5px;
  background: linear-gradient(90deg, #4e7c5a, #6ca16e, #4e7c5a);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: titleShine 5s linear infinite;
}

.section-title::after {
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #6ca16e, #ff6600);
}

@keyframes titleShine {
  to { background-position: 200% center; }
}

/* ===== Hero ===== */
.hero-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-title {
  text-shadow: 0 6px 30px rgba(0, 0, 0, .25);
  perspective: 600px;
}

.contact-info {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 1rem 1.5rem;
}

.contact-info i {
  width: 1.2em;
  text-align: center;
}

/* Vague de transition bas du hero */
.hero-section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 60px;
  background: #f8f9fa;
  clip-path: ellipse(75% 100% at 50% 100%);
  pointer-events: none;
}

.scroll-indicator { z-index: 2; bottom: 70px; }

/* ===== Bandeau d'icônes ===== */
.orthoptie-icons-banner {
  position: relative;
  z-index: 1;
  background: #eaf5ea;
  padding: .8rem 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.orthoptie-icons-banner .icons-track i {
  font-size: 2rem;
  color: #6ca16e;
}

/* ===== Présentation / vidéo ===== */
#presentation .video-frame {
  display: block;
  width: fit-content;
  margin: 1.5rem auto 0;
}

/* ===== À propos ===== */
#apropos .lead {
  max-width: 720px;
  margin: 0 auto;
}

/* ===== Contact ===== */
.contact-section .btn-animated {
  border-width: 2px;
  border-radius: 50px;
  padding: .7rem 1.6rem;
  backdrop-filter: blur(4px);
}

.contact-section .btn-animated:hover {
  background: #fff;
  color: #4e7c5a;
}

/* ===== Icônes de fond (parallaxe, fixes) ===== */
.orthoptie-icons-bg {
  display: block;
  padding: 0;
  margin: 0;
  background: transparent;
}

/* ===== Liens ===== */
.email-link:hover,
.phone-link:hover,
.address-link:hover {
  cursor: pointer;
}

/* ===== Footer ===== */
body { margin-bottom: 0 !important; }

.footer {
  position: relative !important;
  bottom: auto !important;
  width: 100%;
  white-space: normal !important;
  line-height: 1.6 !important;
  background: linear-gradient(180deg, #f8f9fa, #eaf5ea);
}

.footer a {
  color: #4e7c5a;
  font-weight: 600;
  transition: color .3s ease;
}

.footer a:hover { color: #ff6600; }

.contact-section {
  padding-top: 4rem !important;
  padding-bottom: 5rem !important;
}

.contact-section .btn-animated span { white-space: nowrap; }


/* ===== Bouton retour en haut ===== */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ca16e, #4e7c5a);
  color: #fff;
  box-shadow: 0 8px 20px rgba(78,124,90, .4);
  opacity: 0;
  transform: translateY(20px) scale(.8);
  pointer-events: none;
  transition: opacity .4s ease, transform .4s cubic-bezier(.22, 1, .36, 1);
  z-index: 1050;
}

.back-to-top.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.back-to-top:hover { transform: translateY(-4px); }

/* ===== Préchargeur ===== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6ca16e, #4e7c5a);
  transition: opacity .6s ease, visibility .6s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.page-loader i {
  font-size: 4rem;
  color: #fff;
  animation: blinkEye 1.4s ease-in-out infinite;
}

@keyframes blinkEye {
  0%, 40%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(.1); }
  60% { transform: scaleY(1); }
}

@media (max-width: 991.98px) {
  .contact-info { padding: .8rem 1rem; }
  .hero-section::after { height: 30px; }
  .scroll-indicator { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader { display: none; }
}

/* ===== WhatsApp & langues ===== */
.whatsapp-float { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; box-shadow: 0 8px 20px rgba(37,211,102,.45); z-index: 1050; text-decoration: none; transition: transform .3s ease; }
.whatsapp-float:hover { color: #fff; transform: scale(1.1); }
.back-to-top { right: 24px; bottom: 90px; }
.lang-switcher .btn.active { background: #4e7c5a; color: #fff; border-color: #4e7c5a; }

/* ===== Carte ===== */
.map-section .map-frame { border: 2px solid #6ca16e; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(78,124,90,.25); }
.map-section .map-frame iframe { display: block; width: 100%; height: 450px; border: 0; }
.map-section .btn-directions { border-radius: 50px; border: 2px solid #4e7c5a; color: #4e7c5a; padding: .6rem 1.4rem; font-weight: 600; }
.map-section .btn-directions:hover { background: #4e7c5a; color: #fff; }
@media (max-width: 575.98px) { .map-section .map-frame iframe { height: 320px; } }

/* ===== Bouton thème & rendez-vous ===== */
.btn-theme { background: linear-gradient(135deg, #6ca16e, #4e7c5a); border: 0; color: #fff; border-radius: 50px; padding: .7rem 1.8rem; font-weight: 600; box-shadow: 0 8px 20px rgba(78,124,90,.35); transition: transform .3s ease, box-shadow .3s ease; }
.btn-theme:hover, .btn-theme:focus { color: #fff; transform: translateY(-3px); box-shadow: 0 12px 26px rgba(78,124,90,.45); }
.booking-section .booking-frame { background: #fff; border: 2px solid #6ca16e; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(78,124,90,.25); }
.booking-section .calendly-inline-widget { min-width: 320px; height: 700px; }
.booking-section .booking-fallback { padding: 3rem 1.5rem; }
.booking-section .booking-form { background: #fff; border: 2px solid #6ca16e; border-radius: 16px; padding: 1.75rem; box-shadow: 0 10px 30px rgba(78,124,90,.25); }
.booking-section .form-control:focus { border-color: #6ca16e; box-shadow: 0 0 0 .2rem rgba(108,161,110,.25); }
.booking-section .form-label { font-weight: 600; color: #355e41; }

/* ===== Cartes À propos ===== */
.about-card { background: #fff; border: 1px solid #dbe9db; border-radius: 16px; padding: 1.5rem 1rem; text-align: center; height: 100%; box-shadow: 0 6px 18px rgba(78,124,90,.12); transition: transform .3s ease, box-shadow .3s ease; }
.about-card:hover { transform: translateY(-6px); box-shadow: 0 12px 26px rgba(78,124,90,.22); }
.about-card i { font-size: 2rem; color: #6ca16e; margin-bottom: .75rem; display: block; }
.about-card h3 { margin: 0; color: #355e41; font-weight: 700; }

/* ===== RTL (arabe) ===== */
[dir=rtl] body, [dir=rtl] .section-title, [dir=rtl] .hero-title { letter-spacing: 0 !important; }
[dir=rtl] .navbar-nav { margin-right: auto !important; margin-left: 0 !important; padding-right: 0; }
[dir=rtl] .contact-info i { margin-left: .5rem; margin-right: 0 !important; }
[dir=rtl] .address-link, [dir=rtl] .phone-link { unicode-bidi: plaintext; }
