/* ===== Variables ===== */
:root {
  --teal: #197282;
  --teal-dark: #135a66;
  --teal-light: #f2f7f8;
  --orange: #f2bb16;
  --accent-text: #bf820f;
  --black: #111111;
  --text: #2e2e2e;
  --text-light: #f5f5f5;
  --gray-bg: #f4f4f2;
  --max-width: 1100px;
  --radius: 10px;
  --font: "Poppins", Arial, Helvetica, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  background: #fff;
  overflow-anchor: none;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.highlight {
  color: var(--accent-text);
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 30px;
  background: var(--orange);
  color: #1a1a1a;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* ===== Header ===== */
.site-header {
  background: var(--teal);
  color: var(--text-light);
  padding: 18px 0 36px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  padding: 10px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.nav-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
  padding-bottom: 28px;
  transition: padding-bottom 0.3s ease;
}

.site-header.is-scrolled .nav-top {
  padding-bottom: 0;
}

.nav-top a {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.92;
  border-bottom: 2px solid transparent;
}

.nav-top a:hover,
.nav-top a.active {
  opacity: 1;
  border-bottom-color: var(--orange);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 26px;
  cursor: pointer;
}

.logo-block {
  text-align: center;
  margin-bottom: 28px;
  transition: margin-bottom 0.3s ease;
}

.site-header.is-scrolled .logo-block {
  margin-bottom: 0;
}

/* Logo compact dans la barre nav (masqué par défaut) */
.logo--compact {
  display: none;
  align-items: center;
  flex-shrink: 0;
  margin-right: auto;
}

.logo--compact img {
  height: 30px;
  width: auto;
}

/* Quand scrollé : logo compact à gauche */
.site-header.is-scrolled .logo--compact {
  display: flex;
  animation: logoFadeIn 0.4s ease forwards;
}

@keyframes logoFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.site-header.is-scrolled .header-bar {
  justify-content: space-between;
}

.site-header.is-scrolled .logo-block .logo img {
  height: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
}

.logo img {
  height: 78px;
  width: auto;
  transition: height 0.3s ease;
}

.tagline {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.9;
  max-height: 40px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.site-header.is-scrolled .tagline {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* ===== Tab selector ===== */
.tab-selector {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  display: flex;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  max-height: 100px;
  overflow: hidden;
  opacity: 1;
  transition: padding 0.3s ease, max-width 0.3s ease;
}

.site-header.is-scrolled .tab-selector {
  max-width: 360px;
  padding: 4px;
}

/* Chevauche la limite header/section suivante : la barre d'onglets
   "flotte" à cheval sur les deux fonds grâce à cette marge négative. */
.tab-selector-wrap {
  margin-bottom: -58px;
  position: relative;
  z-index: 2;
  transition: margin-bottom 0.3s ease;
}

.site-header.is-scrolled .tab-selector-wrap {
  margin-bottom: -26px;
  margin-top: -10px;
}

.tab-indicator {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  width: 0;
  border-radius: 10px;
  background: var(--orange);
  opacity: 1;
  transition: left 0.3s ease, width 0.3s ease, top 0.3s ease, bottom 0.3s ease, opacity 0.4s ease;
}

.tab-indicator.is-entering {
  opacity: 0;
}

/* Pendant le suivi continu (JS) lors du collapse/expand du header, left et
   width sont recalculés à chaque frame : leur propre transition CSS n'ajoute
   qu'un retard puisque la cible bouge déjà en douceur (padding/max-width/
   font-size animés ailleurs). On la désactive le temps du suivi. */
.tab-indicator.is-tracking {
  transition: top 0.3s ease, bottom 0.3s ease, opacity 0.4s ease;
}

.site-header.is-scrolled .tab-indicator {
  top: 4px;
  bottom: 4px;
}

.tab-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease, padding 0.3s ease, gap 0.3s ease, font-size 0.3s ease;
}

.tab-btn svg,
.tab-btn img {
  width: 20px;
  height: 20px;
  transition: width 0.3s ease, height 0.3s ease;
}

.site-header.is-scrolled .tab-btn {
  padding: 6px 6px;
  gap: 2px;
  font-size: 11px;
}

.site-header.is-scrolled .tab-btn svg,
.site-header.is-scrolled .tab-btn img {
  width: 16px;
  height: 16px;
}

.tab-btn.active {
  color: #1a1a1a;
}

/* ===== Video section ===== */
.video-section {
  background: var(--black);
  color: var(--text-light);
  text-align: center;
  padding: 56px 0;
}

.video-frame {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
}

.video-frame img,
.video-frame video {
  width: 100%;
  display: block;
  transition: opacity 0.2s ease;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.play-button:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.play-button svg {
  width: 26px;
  height: 26px;
  color: var(--teal-dark);
}

.video-watermark {
  position: absolute;
  bottom: 18px;
  right: 24px;
}

.video-watermark img {
  height: 28px;
  width: auto;
  opacity: 0.85;
}

.video-frame.is-playing .video-poster,
.video-frame.is-playing .play-button,
.video-frame.is-playing .video-watermark {
  display: none;
}

.video-frame video {
  display: none;
}

.video-frame.is-playing video {
  display: block;
}

/* ===== Feature sections ===== */
.feature-section {
  padding: 64px 0;
}

.feature-section.alt {
  background: var(--teal-light);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.feature-section.reverse .feature-text {
  text-align: right;
}

.feature-grid img {
  clip-path: url(#blob-mask);
  transition: opacity 0.2s ease;
}

#features-container {
  transition: opacity 0.2s ease;
}

#features-container.is-fading,
.video-poster.is-fading {
  opacity: 0;
}

/* Indicateur de chargement */
.loading-indicator {
  text-align: center;
  padding: 80px 24px;
  color: var(--teal);
}

.loading-spinner {
  display: block;
  width: 44px;
  height: 44px;
  border: 3px solid var(--teal-light);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

.loading-indicator p {
  font-size: 15px;
  font-weight: 500;
  color: var(--teal);
}

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

.feature-text h2 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 18px;
  text-wrap: balance;
}

.feature-text h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--teal);
  margin-top: 24px;
  margin-bottom: 10px;
}

.feature-text p {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-text strong {
  color: var(--accent-text);
  font-weight: inherit;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--teal);
  color: var(--text-light);
  padding: 40px 0;
}

.site-footer h3 {
  font-size: 17px;
  margin-bottom: 14px;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 15px;
}

.contact-list svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ===== Page hero (sub-pages) ===== */
.page-hero {
  background: var(--teal);
  color: var(--text-light);
  text-align: center;
  padding: 48px 0;
}

.page-hero h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
}

.page-hero p {
  opacity: 0.9;
  font-size: 15px;
}

/* ===== Pricing (Tarifs) ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e3e3e0;
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pricing-card .btn {
  margin-top: auto;
}

.pricing-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.pricing-card.featured {
  border-color: var(--orange);
  position: relative;
}

.pricing-card .badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--orange);
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
}

.pricing-card svg,
.pricing-card img {
  width: 36px;
  height: 36px;
  color: var(--teal);
  margin: 0 auto 16px;
}

.pricing-card h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.pricing-card .price {
  font-size: 28px;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 16px 0;
}

.pricing-card .price span {
  font-size: 14px;
  font-weight: 400;
  color: #777;
}

.pricing-card ul {
  margin: 20px 0;
  text-align: left;
  font-size: 14px;
  color: #555;
}

.pricing-card ul li {
  margin-bottom: 8px;
  padding-left: 22px;
  position: relative;
}

.pricing-card ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

/* ===== Services professionnels ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  padding: 64px 0;
}

.service-card {
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 28px;
}

.service-card svg {
  width: 32px;
  height: 32px;
  color: var(--teal);
  margin-bottom: 14px;
}

.service-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.service-card p {
  font-size: 14px;
  color: #555;
}

/* ===== Contact ===== */
.contact-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8d8d4;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.contact-form select:invalid {
  color: #9a9a96;
}

.contact-form textarea {
  min-height: 130px;
  resize: vertical;
}

.contact-form .form-status {
  font-size: 14px;
  color: var(--teal-dark);
  font-weight: 600;
}

.contact-info-block {
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 28px;
}

.contact-info-block h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

.contact-info-block .contact-list li {
  color: var(--text);
}

.contact-info-block .contact-list svg {
  color: var(--teal);
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal--on-top {
  z-index: 310;
}

.modal.is-open {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  animation: backdropIn 0.25s ease;
}

.modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  padding: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s ease;
}

.modal-body {
  overflow-y: auto;
  padding: 28px 32px 36px;
  flex: 1;
}

.modal-box--article {
  max-width: 720px;
}

.profile-photo {
  display: block;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin: 24px auto 20px;
  border: 3px solid var(--teal-light);
}

.modal-content h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--teal);
  margin: 32px 0 14px;
  padding-top: 20px;
  border-top: 2px solid var(--teal-light);
}

.modal-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--teal);
  margin: 22px 0 8px;
}

.modal-content p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 10px;
}

.modal-content strong {
  color: var(--accent-text);
  font-weight: inherit;
}

.modal-content em {
  font-style: italic;
  color: #666;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  padding: 20px 32px;
  background: #fff;
  border-bottom: 1px solid var(--teal-light);
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.modal-close {
  background: #fff;
  border: 2px solid var(--teal);
  color: var(--teal);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 22px;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  background: var(--teal);
  color: #fff;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes backdropOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

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

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

.modal.is-closing {
  display: flex;
}

.modal.is-closing .modal-box {
  animation: modalOut 0.22s ease forwards;
}

.modal.is-closing .modal-backdrop {
  animation: backdropOut 0.22s ease forwards;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .feature-grid,
  .contact-section {
    grid-template-columns: 1fr;
  }

  .feature-section.reverse .feature-grid img {
    order: -1;
  }

  .feature-section.reverse .feature-text {
    text-align: left;
  }

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

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

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-top {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--teal-dark);
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    z-index: 10;
  }

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

  .tab-selector {
    flex-wrap: wrap;
  }

  .logo img {
    height: 52px;
  }
}
