/* ═══════════════════════════════════════════════════════════════
   OPTI — Site web · style.css
   Thème clair par défaut, thème sombre via [data-theme="dark"]
═══════════════════════════════════════════════════════════════ */

/* ─── VARIABLES ─────────────────────────────────────────────── */
:root {
  --bg:           #ffffff;
  --bg-alt:       #f8fafc;
  --bg-card:      #ffffff;
  --bg-card-hover:#f1f5f9;
  --border:       #e2e8f0;
  --border-soft:  #f1f5f9;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --text-dim:     #94a3b8;
  --accent:       #4d9ef5;
  --accent-dark:  #2563eb;
  --accent-light: #eff6ff;
  --accent-glow:  rgba(77,158,245,0.15);
  --success:      #10b981;
  --warning:      #f59e0b;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:    0 20px 40px rgba(0,0,0,0.10), 0 8px 16px rgba(0,0,0,0.06);
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    20px;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Preview panel (dark toujours) */
  --pv-bg:        #1e1e2e;
  --pv-bg-light:  #2b2b3d;
  --pv-bg-lighter:#353547;
  --pv-border:    #44445a;
  --pv-text:      #e0e0e0;
  --pv-muted:     #888899;
  --pv-accent:    #4d9ef5;
}

[data-theme="dark"] {
  --bg:           #0f0f17;
  --bg-alt:       #13131f;
  --bg-card:      #1a1a2e;
  --bg-card-hover:#1f1f38;
  --border:       #2a2a45;
  --border-soft:  #1e1e35;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;
  --accent:       #60aeff;
  --accent-dark:  #3b82f6;
  --accent-light: #1e3a5f;
  --accent-glow:  rgba(96,174,255,0.12);
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:    0 20px 40px rgba(0,0,0,0.5);
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-dark); }
code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 1px 6px;
  border-radius: 4px;
}
[data-theme="dark"] code { color: var(--accent); }

/* ─── LAYOUT ─────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── BOUTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 14px var(--accent-glow); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); border-color: var(--text-dim); }
.btn-sm  { padding: 7px 16px; font-size: 14px; }
.btn-lg  { padding: 13px 26px; font-size: 15px; border-radius: 10px; }
.btn-xl  { padding: 16px 36px; font-size: 16px; border-radius: 12px; }

/* ─── NAV ────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s;
}
[data-theme="dark"] .nav {
  background: rgba(15,15,23,0.85);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}
.nav-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent);
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── THEME TOGGLE ────────────────────────────────────────────── */
.theme-toggle {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-dim); }
.icon-sun  { display: block; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ─── HERO ────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  background: var(--bg);
  overflow: hidden;
}
.hero-inner { text-align: center; }

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
  border: 1px solid rgba(77,158,245,0.2);
}
[data-theme="dark"] .hero-badge { color: var(--accent); }

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 60px;
}

/* ─── HERO PREVIEW ───────────────────────────────────────────── */
.hero-preview {
  max-width: 860px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  border: 1px solid var(--border);
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #1a1a2a;
  border-bottom: 1px solid #333;
}
.preview-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #555;
}
.preview-dot:nth-child(1) { background: #ff5f57; }
.preview-dot:nth-child(2) { background: #febc2e; }
.preview-dot:nth-child(3) { background: #28c840; }
.preview-title {
  margin-left: 8px;
  font-size: 12px;
  color: #888;
  flex: 1;
  text-align: center;
}
.preview-body {
  display: flex;
  background: #1e1e2e;
}
.preview-panel {
  width: 220px;
  flex-shrink: 0;
  background: var(--pv-bg);
  border-right: 1px solid var(--pv-border);
  display: flex;
  flex-direction: column;
  font-size: 11px;
}
.preview-header {
  padding: 8px 10px 6px;
  background: var(--pv-bg-light);
  border-bottom: 1px solid var(--pv-border);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.preview-label-accent {
  font-size: 13px;
  font-weight: 700;
  color: var(--pv-accent);
  letter-spacing: 1.5px;
}
.preview-label-muted { font-size: 10px; color: var(--pv-muted); }
.preview-tabs {
  display: flex;
  background: var(--pv-bg-light);
  border-bottom: 1px solid var(--pv-border);
}
.preview-tab {
  flex: 1;
  padding: 5px 2px;
  font-size: 9px;
  color: var(--pv-muted);
  text-align: center;
  cursor: default;
}
.preview-tab.active { color: var(--pv-accent); border-bottom: 2px solid var(--pv-accent); }
.preview-content { padding: 8px; flex: 1; }
.preview-row { margin-bottom: 6px; }
.preview-field-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--pv-muted);
  margin-bottom: 3px;
}
.preview-field-input {
  background: var(--pv-bg-lighter);
  border: 1px solid var(--pv-border);
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 10px;
  color: var(--pv-text);
}
.preview-field-list {
  background: var(--pv-bg-lighter);
  border: 1px solid var(--pv-border);
  border-radius: 3px;
  overflow: hidden;
}
.preview-list-item {
  padding: 4px 6px;
  font-size: 10px;
  color: var(--pv-muted);
  border-bottom: 1px solid var(--pv-border);
}
.preview-list-item:last-child { border-bottom: none; }
.preview-list-item.selected { background: var(--pv-accent); color: #fff; }
.preview-footer {
  padding: 6px 8px;
  background: var(--pv-bg-light);
  border-top: 1px solid var(--pv-border);
  display: flex;
  gap: 6px;
  justify-content: center;
}
.preview-btn-secondary {
  padding: 4px 10px;
  background: var(--pv-bg-lighter);
  border: 1px solid var(--pv-border);
  border-radius: 3px;
  color: var(--pv-text);
  font-size: 10px;
  cursor: default;
}
.preview-btn-primary {
  padding: 4px 14px;
  background: var(--pv-accent);
  border: none;
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  cursor: default;
}
.preview-status {
  padding: 3px 8px;
  font-size: 9px;
  color: var(--pv-muted);
  background: var(--pv-bg);
  border-top: 1px solid var(--pv-border);
}
.preview-visual {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.visual-label {
  font-size: 11px;
  color: var(--pv-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.visual-board {
  flex: 1;
  background: var(--pv-bg-light);
  border: 1px solid var(--pv-border);
  border-radius: 6px;
  position: relative;
  min-height: 90px;
  overflow: hidden;
}
.visual-obj {
  position: absolute;
  border-radius: 3px;
  opacity: 0.85;
}
.obj-a { background: #4d9ef5; }
.obj-b { background: #a78bfa; }
.obj-c { background: #34d399; }
.obj-d { background: #f59e0b; }
.obj-e { background: #f87171; }
.visual-saving {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.4);
  color: #10b981;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
}

/* ─── ANIMATED DEMO ───────────────────────────────────────────── */
.visual-anim-label {
  position: relative;
  height: 16px;
  margin-bottom: 4px;
}
.val-avant, .val-apres {
  position: absolute;
  font-size: 11px;
  font-weight: 500;
  color: var(--pv-muted);
}
.anim-board { min-height: 130px; }

/* Label fade in/out — 8s loop */
.val-avant  { animation: lbl-avant  8s linear infinite; }
.val-apres  { animation: lbl-apres  8s linear infinite; opacity: 0; }
@keyframes lbl-avant {
  0%,22%  { opacity: 1; }
  32%,82% { opacity: 0; }
  88%,100%{ opacity: 1; }
}
@keyframes lbl-apres {
  0%,30%  { opacity: 0; }
  42%,76% { opacity: 1; }
  84%,100%{ opacity: 0; }
}

/* Saving badge */
.anim-saving { animation: badge-show 8s linear infinite; opacity: 0; }
@keyframes badge-show {
  0%,44%  { opacity: 0; }
  54%,74% { opacity: 1; }
  82%,100%{ opacity: 0; }
}

/* Objects — before → after → (snap) → before */
/* obj-a: 8%,8%,40%,20% → 2%,5%,40%,20% */
.anim-obj-a {
  left:8%; top:8%; width:40%; height:20%;
  animation: move-a 8s linear infinite;
}
@keyframes move-a {
  0%,25%  { left:8%;  top:8%;  width:40%; height:20%; }
  50%,80% { left:2%;  top:5%;  width:40%; height:20%; }
  86%,100%{ left:8%;  top:8%;  width:40%; height:20%; }
}

/* obj-b: 60%,5%,26%,30% → 2%,30%,24%,24% */
.anim-obj-b {
  left:60%; top:5%; width:26%; height:30%;
  animation: move-b 8s linear infinite;
}
@keyframes move-b {
  0%,25%  { left:60%; top:5%;  width:26%; height:30%; }
  50%,80% { left:2%;  top:30%; width:24%; height:24%; }
  86%,100%{ left:60%; top:5%;  width:26%; height:30%; }
}

/* obj-c: 8%,38%,30%,18% → 68%,5%,28%,20% */
.anim-obj-c {
  left:8%; top:38%; width:30%; height:18%;
  animation: move-c 8s linear infinite;
}
@keyframes move-c {
  0%,25%  { left:8%;  top:38%; width:30%; height:18%; }
  50%,80% { left:68%; top:5%;  width:28%; height:20%; }
  86%,100%{ left:8%;  top:38%; width:30%; height:18%; }
}

/* obj-d: 55%,44%,28%,16% → 44%,5%,22%,20% */
.anim-obj-d {
  left:55%; top:44%; width:28%; height:16%;
  animation: move-d 8s linear infinite;
}
@keyframes move-d {
  0%,25%  { left:55%; top:44%; width:28%; height:16%; }
  50%,80% { left:44%; top:5%;  width:22%; height:20%; }
  86%,100%{ left:55%; top:44%; width:28%; height:16%; }
}

/* obj-e: 40%,68%,42%,16% → 28%,30%,40%,20% */
.anim-obj-e {
  left:40%; top:68%; width:42%; height:16%;
  animation: move-e 8s linear infinite;
}
@keyframes move-e {
  0%,25%  { left:40%; top:68%; width:42%; height:16%; }
  50%,80% { left:28%; top:30%; width:40%; height:20%; }
  86%,100%{ left:40%; top:68%; width:42%; height:16%; }
}

/* Smooth easing on movement phases */
.anim-obj-a { animation-timing-function: ease-in-out; }
.anim-obj-b { animation-timing-function: ease-in-out; }
.anim-obj-c { animation-timing-function: ease-in-out; }
.anim-obj-d { animation-timing-function: ease-in-out; }
.anim-obj-e { animation-timing-function: ease-in-out; }

/* ─── SECTIONS ────────────────────────────────────────────────── */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* ─── FEATURES ────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.2s ease;
}
.feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-glow);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dark);
  margin-bottom: 16px;
}
[data-theme="dark"] .feature-icon { color: var(--accent); }
.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ─── STEPS ───────────────────────────────────────────────────── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 680px;
  margin: 0 auto 48px;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 44px;
  width: 2px;
  background: var(--border);
}
.step {
  display: flex;
  gap: 24px;
  padding: 20px 0;
  position: relative;
}
.step-number {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--bg-alt);
}
.step-content { padding-top: 8px; }
.step-content h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-content p { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

.install-cta { text-align: center; }
.install-req {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ─── FAQ ─────────────────────────────────────────────────────── */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--accent); }
.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.15s;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { background: var(--bg-card-hover); }
.faq-chevron {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.25s ease;
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  padding: 0 22px 18px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
}

/* ─── DOWNLOAD ────────────────────────────────────────────────── */
.section-download {
  background: var(--bg-alt);
}
.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 64px 40px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.download-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
}
.download-badge {
  display: inline-block;
  background: rgba(16,185,129,0.1);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.3);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.download-card h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.download-card p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 16px;
}
.download-meta {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.download-note {
  margin-top: 16px;
  font-size: 12px !important;
  color: var(--text-dim) !important;
}

/* ─── FOOTER ──────────────────────────────────────────────────── */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer-logo {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--accent);
}
.footer-copy {
  font-size: 13px;
  color: var(--text-dim);
}
.footer-right {
  display: flex;
  gap: 24px;
}
.footer-right a {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-right a:hover { color: var(--text); }

/* ─── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .hero { padding: 56px 0 40px; }
  .preview-panel { width: 160px; }
  .preview-visual { display: none; }
  .section { padding: 64px 0; }
  .features-grid { grid-template-columns: 1fr; }
  .steps::before { display: none; }
  .download-card { padding: 40px 24px; border-radius: var(--radius-xl); }
  .footer-inner { flex-direction: column; text-align: center; }
  .hero-meta { flex-wrap: wrap; gap: 6px; }
}
