/* Styles de base pour WinDevExpert */
:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #3b82f6;
  --primary-700: #1d4ed8;
  --accent: #22c55e;
  --border: #1f2937;
  --shadow: 0 10px 30px rgba(0,0,0,0.25);
  --header-offset: 80px; /* hauteur approximative du header collant */
}

[data-theme="light"] {
  --bg: #f7fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-700: #1e40af;
  --accent: #16a34a;
  --border: #e5e7eb;
  --shadow: 0 10px 25px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), #0b1023 60%);
  font-size: 17px; /* base plus confortable */
  line-height: 1.6; /* aération et lisibilité */
}

/* Défilement lisse global + compensation du header collant pour les ancres */
html { scroll-behavior: smooth; scroll-padding-top: var(--header-offset); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
/* Évite que le header collant masque le début des sections ciblées */
section, [id] { scroll-margin-top: var(--header-offset); }

/* Police Cairo pour la version arabe */
html[lang="ar"] body {
  font-family: Cairo, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

/* Fond blanc en thème clair */
/* Fond blanc en thème clair */
[data-theme="light"] body { background: #ffffff; }

/* Header clair */
[data-theme="light"] .site-header { background: rgba(255,255,255,0.9); border-bottom-color: var(--border); }
[data-theme="light"] .site-nav a:hover { background: rgba(0,0,0,0.04); }
[data-theme="light"] .theme-toggle { background: rgba(0,0,0,0.04); }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-wrap { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.brand { color: var(--text); text-decoration: none; font-weight: 900; letter-spacing: 0.2px; display: inline-block; line-height: 1; }
.brand .brand-text { font-weight: 900; color: #fff; font-size: clamp(1.5rem, 2.4vw, 1.9rem); letter-spacing: 0.3px; }
/* En thème clair, le logo texte doit être foncé pour rester lisible */
[data-theme="light"] .site-header .brand .brand-text { color: var(--text); }
.site-nav ul { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.site-nav a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 8px; }
.theme-toggle { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text); padding: 8px 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { background: rgba(255,255,255,0.08); }
.icon-sun { display: inline-block; }
[data-theme="light"] .icon-sun { display: none; }
.icon-moon { display: none; }
[data-theme="light"] .icon-moon { display: inline-block; }

/* Nav layout: left links + right controls */
.site-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-nav .nav-left, .site-nav .nav-right { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; align-items: center; }
.lang-switch { display: inline-flex; gap: 6px; align-items: center; }
.lang-switch button { background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.lang-switch button:hover { background: rgba(255,255,255,0.08); }
.lang-switch button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Bouton Espace Clients — pill premium, parfaitement aligné */
.site-nav a.clients-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; font-weight: 700; letter-spacing: 0.2px; line-height: 1; color: #fff;
  background: var(--primary); border: 1px solid var(--primary); box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.site-nav a.clients-btn .icon { width: 16px; height: 16px; }
.site-nav a.clients-btn:hover { background: var(--primary-700); border-color: var(--primary-700); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,0.35); }
[data-theme="light"] .site-nav a.clients-btn { color: #fff; }

/* Aligner visuellement avec le switcher de langues */
.site-nav .nav-right > li { display: flex; align-items: center; }

/* Zone client: header pleine largeur et logo collé à gauche */
.client-zone .container.header-wrap { max-width: 100%; padding-left: 0; padding-right: 20px; }
[dir="rtl"] .client-zone .container.header-wrap { padding-left: 20px; padding-right: 0; }
.client-zone .site-nav .nav-left { display: none !important; }

/* Menu utilisateur (dropdown) */
.user-menu-wrap { position: relative; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); min-width: 220px; display: grid; gap: 4px; z-index: 100; }
.user-menu a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.user-menu a:hover { background: rgba(255,255,255,0.06); }
[data-theme="light"] .user-menu { background: #fff; }
[dir="rtl"] .user-menu { left: 0; right: auto; }


/* Hero */
.hero { padding: 96px 0 64px; background:
  radial-gradient(600px 600px at calc(10% + var(--hero-x, 0px)) calc(10% + var(--hero-y, 0px)), rgba(59,130,246,0.12), transparent 60%),
  radial-gradient(500px 500px at calc(90% + var(--hero-x2, 0px)) calc(0% + var(--hero-y2, 0px)), rgba(34,197,94,0.1), transparent 60%);
  will-change: background-position;
}
.hero-content { text-align: left; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: stretch; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1.2; margin: 0 0 16px; font-weight: 800; letter-spacing: 0.3px; }
.hero p { max-width: 720px; margin: 0 0 24px; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; }
.hero-aside { display: grid; gap: 12px; align-content: start; align-self: stretch; }
.badge-pro { width: fit-content; padding: 6px 10px; border-radius: 999px; background: rgba(34,197,94,0.18); color: var(--accent); font-weight: 700; font-size: 0.9rem; border: 1px solid var(--border); }
.aside-card { background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }

/* Mockup d’écran KPI */
.screen-mockup { position: relative; display: grid; place-items: center; height: 100%; align-items: stretch; }
.screen-frame { width: 100%; height: 100%; border-radius: 18px; background: #0b1220; border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0,0,0,0.35); overflow: hidden; }
.screen-content { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); }
.dashboard-svg { width: 100%; height: 100%; display: block; }
.screen-shadow { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); width: min(60%, 420px); height: 22px; background: radial-gradient(closest-side, rgba(0,0,0,0.35), transparent 70%); filter: blur(10px); opacity: 0.9; pointer-events: none; }

/* Effet de flottaison subtil */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.floating { animation: float 8s ease-in-out infinite; will-change: transform; }
.floating ~ .screen-shadow { animation: floatShadow 8s ease-in-out infinite; }
@keyframes floatShadow {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
  50% { transform: translateX(-50%) scale(0.96); opacity: 0.8; }
}

/* Buttons */
.btn { display: inline-block; text-decoration: none; padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: transform 150ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease; font-size: 16px; line-height: 1.2; }
.btn { position: relative; overflow: hidden; }
/* Sheen (même effet que les cards) sur tous les boutons */
.social-btn, .lang-switch button, .theme-toggle, .nav-toggle { position: relative; overflow: hidden; }
.btn::after, .social-btn::after, .lang-switch button::after, .theme-toggle::after, .nav-toggle::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 70%);
  background-size: 200% 100%; opacity: 0; transition: opacity 200ms ease;
}
.btn:hover::after, .social-btn:hover::after, .lang-switch button:hover::after, .theme-toggle:hover::after, .nav-toggle:hover::after {
  opacity: 0.6; animation: sheen 800ms cubic-bezier(.22,.61,.36,1) forwards;
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover::after, .social-btn:hover::after, .lang-switch button:hover::after, .theme-toggle:hover::after, .nav-toggle:hover::after { animation: none; }
}
.btn .ripple { position: absolute; width: 12px; height: 12px; background: currentColor; opacity: 0.25; border-radius: 999px; transform: translate(-50%, -50%) scale(0); animation: ripple 600ms ease-out forwards; pointer-events: none; mix-blend-mode: screen; }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(18); opacity: 0; } }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-700); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: rgba(255,255,255,0.06); transform: translateY(-1px); }

/* Loading spinner — état professionnel pour attentes lors des actions */
/* Conserver le centrage pendant la rotation en combinant translate + rotate */
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.btn.is-loading, .btn:disabled { pointer-events: none; opacity: 0.92; }
.btn.is-loading::before {
  content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 800ms linear infinite;
}
/* Confort visuel en thème clair: spinner plus sombre sur boutons bleus */
[data-theme="light"] .btn-primary.is-loading::before { border-color: rgba(17,24,39,0.65); border-right-color: transparent; }

/* Boutons — police dédiée pour l'arabe + légère augmentation de taille */
html[lang="ar"] .btn {
  font-family: Cairo, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 17px;
  font-weight: 700; /* rendre le libellé plus lisible en arabe */
}

/* État d'erreur sur les champs de formulaire */
.input-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.checkbox input.input-error + span { color: #ef4444; }

/* Bouton retour en haut */
.to-top { position: fixed; bottom: 20px; right: 20px; width: 46px; height: 46px; border-radius: 999px; border: none; background: var(--primary); color: #fff; box-shadow: 0 8px 24px rgba(37,99,235,0.35); display: grid; place-items: center; font-weight: 800; font-size: 18px; cursor: pointer; opacity: 0; transform: translateY(12px); transition: opacity 250ms ease, transform 250ms ease, background 200ms ease, box-shadow 200ms ease; z-index: 1000; }
.to-top .icon-up { width: 20px; height: 20px; }
.to-top.show { opacity: 1; transform: translateY(0); }
.to-top:hover { background: var(--primary-700); box-shadow: 0 10px 30px rgba(37,99,235,0.45); }

/* Sections */
section { padding: 96px 0; }
.features .grid, .pricing .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.solutions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.card { 
  /* Teinte par défaut (bleu) ; sera surchargée via nth-child */
  --card-tint: 59,130,246; /* rgb */
  background: linear-gradient(180deg, rgba(var(--card-tint),0.08), rgba(var(--card-tint),0.04));
  border: 1px solid rgba(var(--card-tint),0.22);
  padding: 18px; border-radius: 14px; text-align: center;
  transition: transform 150ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
  /* Ombre pro, multi-couches (douce et diffuse) */
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 2px 8px rgba(var(--card-tint),0.10);
  will-change: transform, box-shadow;
  position: relative; overflow: hidden; /* pour l’effet de sheen subtil */
}
.card:hover { 
  transform: translateY(-4px) scale(1.02);
  /* Élévation élégante en hover, sans excès */
  box-shadow: 0 8px 22px rgba(0,0,0,0.14), 0 16px 36px rgba(var(--card-tint),0.16);
  background: linear-gradient(180deg, rgba(var(--card-tint),0.12), rgba(var(--card-tint),0.06));
  border-color: rgba(var(--card-tint),0.32);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0) 70%);
  background-size: 200% 100%; opacity: 0; transition: opacity 200ms ease;
}
.card:hover::after { opacity: 0.6; animation: sheen 800ms cubic-bezier(.22,.61,.36,1) forwards; }

@keyframes sheen { from { background-position: -100% 0; } to { background-position: 100% 0; } }
.card:focus-visible, .card:focus-within {
  outline: none;
  /* Anneau de focus subtil + ombre douce pour UX pro */
  box-shadow: 0 0 0 2px rgba(var(--card-tint),0.35), 0 6px 18px rgba(0,0,0,0.12), 0 10px 28px rgba(var(--card-tint),0.14);
  border-color: rgba(var(--card-tint),0.36);
}
.card-icon { 
  width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; 
  background: rgba(var(--card-tint), 0.14);
  color: rgb(var(--card-tint));
  margin-bottom: 10px; 
}

/* Palette discrète, répartie par position pour chaque grille de cartes */
.features .grid .card:nth-child(1) { --card-tint: 59,130,246; }   /* bleu */
.features .grid .card:nth-child(2) { --card-tint: 34,197,94; }    /* vert */
.features .grid .card:nth-child(3) { --card-tint: 168,85,247; }   /* violet */
.features .grid .card:nth-child(4) { --card-tint: 245,158,11; }   /* amber */
.features .grid .card:nth-child(5) { --card-tint: 6,182,212; }    /* cyan */
.features .grid .card:nth-child(6) { --card-tint: 244,63,94; }    /* rose */

.solutions-grid .card:nth-child(1) { --card-tint: 59,130,246; }
.solutions-grid .card:nth-child(2) { --card-tint: 34,197,94; }
.solutions-grid .card:nth-child(3) { --card-tint: 168,85,247; }
.solutions-grid .card:nth-child(4) { --card-tint: 245,158,11; }

/* Projets: palette cyclique douce sur 6 items */
.projects-grid .card:nth-child(6n+1) { --card-tint: 59,130,246; }
.projects-grid .card:nth-child(6n+2) { --card-tint: 34,197,94; }
.projects-grid .card:nth-child(6n+3) { --card-tint: 168,85,247; }
.projects-grid .card:nth-child(6n+4) { --card-tint: 245,158,11; }
.projects-grid .card:nth-child(6n+5) { --card-tint: 6,182,212; }
.projects-grid .card:nth-child(6n)   { --card-tint: 244,63,94; }

/* Mode contraste réduit: garder la sobriété */
@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
  .card:hover::after { opacity: 0; animation: none; }
}
.card-title { margin: 8px 0 6px; font-size: 1.05rem; font-weight: 700; }
.card-title { letter-spacing: 0.2px; font-size: 1.15rem; }
.card-text { color: var(--muted); margin: 0; }
.card h3 { margin-top: 0; }
.pricing-card .price { font-weight: 700; color: var(--accent); }

/* About */
.about p { max-width: 80ch; margin: 0 auto; text-align: center; color: var(--muted); line-height: 1.7; }

/* Contact */
.contact-form { display: grid; gap: 12px; max-width: 720px; }
.form-row { display: grid; gap: 6px; }
.form-row input, .form-row textarea {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text);
}
.form-row input::placeholder, .form-row textarea::placeholder { color: #6b7280; }
.contact .btn { width: fit-content; }

/* Footer */
.site-footer { background: rgba(15,23,42,0.95); border-top: 1px solid var(--border); padding: 40px 0 28px; color: #cbd5e1; }
[data-theme="light"] .site-footer { background: #0f172a; color: #e5e7eb; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.footer-col .brand { display: inline-block; margin-bottom: 10px; font-weight: 900; color: #fff; }
.brand-text { font-weight: 900; color: #fff; }
.footer-mission { margin: 8px 0 12px; color: #94a3b8; max-width: 44ch; }
.social-links { display: none; }

/* Bas de page centré */
.footer-bottom { text-align: center; }

/* Boutons sociaux rectangulaires */
.social-buttons { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: visible; padding: 6px 0; min-height: 48px; align-items: center; }
.social-btn {
  --brand: 59,130,246; /* par défaut */
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px;
  background: rgba(var(--brand), 0.14);
  border: 1px solid rgba(var(--brand), 0.35);
  color: #fff; font-weight: 600; letter-spacing: 0.2px;
  transition: transform 150ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
  text-decoration: none; min-height: 36px;
}
.social-btn:hover { 
  transform: translateY(-2px);
  background: rgba(var(--brand), 0.22);
  border-color: rgba(var(--brand), 0.5);
  /* halo moins large pour éviter le clipping vertical */
  box-shadow: 0 0 0 4px rgba(var(--brand), 0.14), 0 8px 20px rgba(var(--brand), 0.20);
  text-decoration: none;
}
.social-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(var(--brand), 0.35); }
.social-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.social-btn span { text-decoration: none; }

/* Couleurs de marque */
.social-btn.whatsapp { --brand: 37,211,102; }
.social-btn.youtube  { --brand: 255,0,0; }
.social-btn.facebook { --brand: 24,119,242; }
.social-btn.reddit   { --brand: 255,69,0; }
.social-btn.linkedin { --brand: 10,102,194; }

/* Footer contact: empêcher les retours à la ligne disgracieux sur email/téléphone */
.site-footer .footer-col .footer-links li {
  display: flex;
  gap: 6px;
  align-items: baseline;
  line-height: 1.6;
}
.site-footer .footer-col .footer-links li a[href^="mailto"],
.site-footer .footer-col .footer-links li a[href^="tel"] {
  white-space: nowrap;
}

/* Liens légaux en ligne au-dessus du copyright */
.legal-inline { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.legal-inline a { color: #cbd5e1; text-decoration: none; }
.legal-inline a:hover { text-decoration: underline; }
.legal-inline .sep { color: #64748b; }

/* Responsive footer: passer à 1 colonne sur tablette/mobile */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Footer mobile: centrer contenu et wrapper les boutons sociaux */
@media (max-width: 640px) {
  .site-footer .footer-col { text-align: center; }
  .footer-mission { margin: 8px auto 12px; }
  .social-buttons { flex-wrap: wrap; justify-content: center; overflow-x: visible; }
  .social-btn { min-width: 140px; }
  .legal-inline { gap: 8px; }
}

/* Très petit écran: éviter les séparateurs isolés */
@media (max-width: 480px) {
  .legal-inline .sep { display: none; }
}

/* Sur petits écrans, autoriser le retour à la ligne pour éviter l’overflow */
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .site-footer .footer-col .footer-links li { flex-wrap: wrap; }
  .site-footer .footer-col .footer-links li a[href^="mailto"],
  .site-footer .footer-col .footer-links li a[href^="tel"] { white-space: normal; overflow: visible; text-overflow: clip; }
}
.social-links a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; color: #cbd5e1; background: rgba(255,255,255,0.04); }
.social-links a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.footer-title { font-weight: 800; margin: 6px 0 8px; color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-links a { color: #cbd5e1; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-sep { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.footer-bottom { text-align: center; color: #94a3b8; }
.footer-bottom p { margin: 0; }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal-visible { opacity: 1; transform: translateY(0); }

/* Apparition plus douce avec décalage */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.reveal-visible .section-title,
.reveal-visible .hero-actions,
.reveal-visible .screen-mockup { animation: fadeUp 600ms cubic-bezier(.22,.61,.36,1) both; }
.reveal-visible .card { animation: fadeUp 600ms cubic-bezier(.22,.61,.36,1) both; }
.solutions-grid .card:nth-child(1) { animation-delay: 0ms; }
.solutions-grid .card:nth-child(2) { animation-delay: 80ms; }
.solutions-grid .card:nth-child(3) { animation-delay: 160ms; }
.solutions-grid .card:nth-child(4) { animation-delay: 240ms; }
.projects-grid .card:nth-child(1) { animation-delay: 0ms; }
.projects-grid .card:nth-child(2) { animation-delay: 80ms; }
.projects-grid .card:nth-child(3) { animation-delay: 160ms; }
.projects-grid .card:nth-child(4) { animation-delay: 240ms; }
.projects-grid .card:nth-child(5) { animation-delay: 320ms; }
.projects-grid .card:nth-child(6) { animation-delay: 400ms; }

/* Accessibilité: réduire les animations si demandé */
@media (prefers-reduced-motion: reduce) {
  .floating, .floating ~ .screen-shadow { animation: none; }
  .reveal, .reveal-visible .section-title, .reveal-visible .card, .reveal-visible .hero-actions, .reveal-visible .screen-mockup { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 960px) {
  .features .grid, .pricing .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .solutions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  /* Sur écrans moyens et petits, le mockup revient à un ratio maîtrisé */
  .screen-frame { height: auto; aspect-ratio: 16 / 10; }
}
@media (max-width: 640px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; }
  .site-nav.open { display: block; position: absolute; top: 56px; right: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
  .site-nav ul { flex-direction: column; padding: 10px; }
  .site-nav a.clients-btn { width: 100%; justify-content: center; }
  .features .grid, .pricing .grid { grid-template-columns: 1fr; }
  .solutions-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
.section-title { text-align: center; font-size: clamp(2rem, 3.4vw, 2.6rem); margin: 0 0 28px; letter-spacing: 0.6px; font-weight: 800; }
.section-title::after { content: ""; display: block; width: 64px; height: 3px; margin: 12px auto 0; border-radius: 2px; background: linear-gradient(90deg, var(--primary), var(--accent)); animation: underlineMove 4s ease-in-out infinite; }
@keyframes underlineMove { 0%,100% { filter: brightness(1); transform: translateX(0); } 50% { filter: brightness(1.15); transform: translateX(8px); } }

/* Alternance discrète des fonds de sections */
main > section { transition: background-color 250ms ease; }
/* Thème sombre: subtile variation */
main > section:nth-of-type(even) { background-color: rgba(255,255,255,0.03); }
/* Thème clair: gris très pâle sur les sections paires */
[data-theme="light"] main > section:nth-of-type(even) { background-color: #f6f7fb; }

/* RTL support */
[dir="rtl"] body { text-align: right; }
/* En RTL: ordre souhaité de droite à gauche = Brand, Menu principal, Lang switch, Theme switch */
/* On inverse l’ordre des blocs du header pour obtenir Brand (à droite), puis nav-toggle, puis site-nav */
[dir="rtl"] .header-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-direction: row-reverse; }
/* Ne pas inverser la site-nav en RTL: garder nav-left (menu principal) avant nav-right (lang, thème) */
[dir="rtl"] .site-nav { flex-direction: row; }
[dir="rtl"] .site-nav .nav-left, [dir="rtl"] .site-nav .nav-right { flex-direction: row; }
[dir="rtl"] .hero-content { text-align: right; }
[dir="rtl"] .hero-actions { justify-content: flex-end; }
[dir="rtl"] .features .grid, [dir="rtl"] .solutions-grid, [dir="rtl"] .pricing .grid { direction: rtl; }
[dir="rtl"] .card-text { text-align: right; }
[dir="rtl"] .footer-bottom { text-align: center; }
[dir="rtl"] .footer-links { text-align: right; }

/* Formulaire de devis multi-étapes */
.quote-form { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.quote-progress { display: grid; gap: 8px; margin-bottom: 16px; }
.quote-progress .progress-bar { position: relative; height: 6px; background: rgba(255,255,255,0.08); border-radius: 999px; overflow: hidden; }
.quote-progress .progress-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 33%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; }
.quote-progress .progress-steps { display: flex; gap: 8px; align-items: center; }
.quote-progress .step-dot { width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; background: rgba(255,255,255,0.1); border: 1px solid var(--border); }
.quote-progress .step-dot.active { background: var(--primary); border-color: var(--primary); }

.form-step h3 { margin: 0 0 8px; font-weight: 800; }
.form-step .step-desc { margin: 0 0 12px; color: var(--muted); }
.simple-grid { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
.simple-grid .form-row { display: grid; gap: 6px; }
.form-row input, .form-row select, .form-row textarea { background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; }
.form-row textarea { resize: vertical; }
.help { color: var(--muted); }
.form-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.quote-form .form-actions .btn { width: 100%; max-width: 420px; padding: 12px 16px; font-weight: 700; }

.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 18px; justify-items: stretch; align-items: stretch; }
.service-option { position: relative; }
.service-option input { position: absolute; opacity: 0; pointer-events: none; }
.service-option label { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--text); cursor: pointer; user-select: none; transition: transform 150ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease; width: 100%; height: 64px; text-align: center; }
.service-option label:hover { transform: translateY(-2px); background: rgba(255,255,255,0.08); box-shadow: var(--shadow); }
.service-option input:checked + label { background: rgba(59,130,246,0.18); border-color: var(--primary); border-width: 2px; color: #fff; box-shadow: 0 0 0 4px rgba(59,130,246,0.15); }
.service-option input:checked + label::after { content: "✓"; position: absolute; right: 10px; top: 8px; font-weight: 900; color: #fff; background: var(--primary); border-radius: 999px; width: 20px; height: 20px; display: grid; place-items: center; }
.service-option svg { opacity: 0.9; }

@media (max-width: 860px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } }

.quote-confirm { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.35); color: #d1fae5; border-radius: 12px; padding: 16px; margin-top: 12px; }
/* Ajustements page d'authentification pour taille et lisibilité */
.auth-page .quote-form { max-width: 720px; margin: 0 auto; }
.auth-page .auth-tabs { margin-bottom: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-page main { background: #f3f4f6; }
.auth-page .auth-tabs .btn { border: 1px solid var(--border); }
[data-theme="light"] .auth-page .auth-tabs .btn { background: #e5e7eb; color: #111827; }
[data-theme="light"] .auth-page .auth-tabs .btn:hover { background: #dfe3ea; }
[data-theme="light"] .auth-page .auth-tabs .btn-primary { background: #ffffff; color: #111827; border-color: #d1d5db; }
[data-theme="light"] .auth-page .auth-tabs .btn-secondary { background: #e5e7eb; color: #111827; border-color: #d1d5db; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }
.form-error { color: #ef4444; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.35); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.auth-page .form-actions .btn { max-width: 280px; }

/* Garantir que l’attribut hidden masque toujours l’élément */
[hidden] { display: none !important; }

/* Panneaux des onglets (login / signup) avec transition douce */
.auth-page .pane-host { min-height: 220px; transition: transform 180ms ease, opacity 180ms ease; will-change: transform, opacity; }
.auth-page .pane-host.swap-out { opacity: 0; transform: translateY(6px); }
.auth-page .pane-host.swap-in { opacity: 1; transform: translateY(0); }

/* Auth: responsivité mobile — utiliser le comportement global du burger menu */
/* On supprime la forcing de la navigation visible pour éviter l’overflow sur petit écran. */

/* Affinage responsive du panneau d’authentification */
@media (max-width: 640px) {
  .auth-page section { padding: 56px 0; }
  .auth-page .quote-form { padding: 16px; border-radius: 12px; }
  .auth-page .section-title { font-size: clamp(1.9rem, 6.8vw, 2.3rem); line-height: 1.25; }
}
@media (max-width: 480px) {
  .auth-page .auth-tabs { grid-template-columns: 1fr; }
  .auth-page .form-actions .btn { width: 100%; max-width: none; }
  .auth-page .container { padding: 0 14px; }
}

/* Zone client — mise en page large avec barre latérale gauche */
main.client-wide .container { max-width: 100%; }
section.client-area { padding: 24px 0; }
.client-layout { display: grid; grid-template-columns: 280px 1fr; gap: 20px; align-items: start; }
.client-sidebar { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; position: sticky; top: calc(var(--header-offset) + 12px); height: calc(100vh - var(--header-offset) - 24px); overflow: auto; }
.client-menu { display: flex; flex-direction: column; gap: 6px; }
.client-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.client-menu a:hover { background: rgba(255,255,255,0.06); }
.client-menu a.active { background: rgba(37,99,235,0.12); border-color: rgba(37,99,235,0.30); color: var(--primary); }
.client-content { min-height: calc(100vh - var(--header-offset) - 24px); }

/* Dashboard temporaire: KPIs et panneaux */
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: none; display: grid; gap: 6px; text-align: left; }
.kpi-label { color: var(--muted); font-weight: 700; letter-spacing: 0.2px; }
.kpi-value { font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--text); }
.kpi-card.kpi-ok { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); }
.kpi-card.kpi-warn { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.35); }

.dashboard-panels { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.panel-title { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: 0.2px; }
.panel-list { list-style: none; margin: 0; padding: 10px 0 0; display: grid; gap: 8px; }
.panel-list li { color: var(--muted); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.quick-actions .btn { flex: 1 1 180px; }

/* Thème clair: fonds neutres plus doux pour KPI/panneaux */
[data-theme="light"] .kpi-card { background: #ffffff; }
[data-theme="light"] .panel { background: #ffffff; }

/* Responsive dashboard */
@media (max-width: 960px) {
  .dashboard-panels { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .quick-actions .btn { flex: 1 1 100%; }
}

/* RTL: alignements pour KPI et panneaux */
[dir="rtl"] .kpi-card { text-align: right; }
[dir="rtl"] .panel-header { justify-content: flex-start; }
[dir="rtl"] .panel-title { text-align: right; }
[dir="rtl"] .panel-list { text-align: right; }
[dir="rtl"] .quick-actions { justify-content: flex-end; }

/* Badge utilisateur (avatar + nom) en haut à droite */
.user-badge { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); background: rgba(255,255,255,0.05); }
.user-badge:hover { background: rgba(255,255,255,0.08); }
.user-avatar { width: 28px; height: 28px; border-radius: 999px; background: rgba(255,255,255,0.08); border: 1px solid var(--border); object-fit: cover; }
.user-name { font-weight: 700; }

@media (max-width: 960px) {
  .client-layout { grid-template-columns: 1fr; }
  .client-sidebar { position: static; height: auto; }
  .user-name { display: none; }
}

/* Page Profil: panneaux neutres sans hover ni effets scintillants */
.profile-page .card { 
  background: var(--panel); 
  border: 1px solid var(--border);
  box-shadow: none; 
  transition: none; 
  text-align: left;
}
.profile-page .card:hover { 
  transform: none; 
  box-shadow: none; 
  background: var(--panel); 
  border-color: var(--border);
}
.profile-page .card::after, 
.profile-page .card:hover::after { 
  opacity: 0; 
  animation: none; 
}

.profile-page .form-actions { display:flex; gap:12px; justify-content:flex-start; }

/* RTL: aligner correctement les libellés et le contenu sur la page profil */
[dir="rtl"] .profile-page .card { text-align: right; }
[dir="rtl"] .profile-page .form-row label { text-align: right; direction: rtl; }
[dir="rtl"] .profile-page .form-row input:not([type="email"]):not([type="url"]):not([type="number"]),
[dir="rtl"] .profile-page .form-row textarea { text-align: right; direction: rtl; }
[dir="rtl"] .profile-page .form-row select { direction: rtl; }
[dir="rtl"] .profile-page .form-actions { justify-content: flex-end; flex-direction: row-reverse; }
/* Upload avatar — dropzone moderne et accessible */
.upload-dropzone { position: relative; display: grid; gap: 10px; align-items: center; justify-items: center; padding: 16px; border: 2px dashed var(--border); border-radius: 14px; background: rgba(255,255,255,0.04); }
.upload-dropzone:hover { background: rgba(255,255,255,0.06); }
.upload-dropzone.is-dragover { background: rgba(59,130,246,0.12); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(59,130,246,0.18); }
.upload-preview { width: 120px; height: 120px; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); background: rgba(255,255,255,0.06); display: grid; place-items: center; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-placeholder { width: 100%; height: 100%; border-radius: 999px; background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)); position: relative; }
.avatar-placeholder::after { content: ""; position: absolute; inset: 0; margin: auto; width: 46%; height: 46%; border-radius: 999px; border: 2px solid rgba(255,255,255,0.18); box-shadow: inset 0 0 0 4px rgba(255,255,255,0.06); }
.upload-instructions { margin: 0; display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.upload-instructions .sep { opacity: 0.7; }
[data-theme="light"] .upload-dropzone { background: #f9fafb; }
[data-theme="light"] .upload-dropzone:hover { background: #f3f4f6; }
[data-theme="light"] .upload-preview { background: #eef2f7; }
[dir="rtl"] .upload-instructions { direction: rtl; }
[dir="rtl"] .upload-instructions .sep { padding-inline: 4px; }