:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-warm: #f4f1eb;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e7e2d8;
  --accent: #164e3f;
  --accent-hover: #113d31;
  --accent-soft: #e6f0ec;
  --success: #15803d;
  --success-soft: #dcfce7;
  --warning: #b45309;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --radius: 12px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}
.nav-links {
  display: flex;
  gap: 26px;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.92rem;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.btn-lg { padding: 13px 24px; font-size: 0.98rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-warm); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-warm); color: var(--text); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: wait; }

/* Editorial Hero */
.hero {
  padding: 72px 0 56px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.25rem, 4.2vw, 3.25rem);
  line-height: 1.08;
  margin: 18px 0 18px;
  letter-spacing: -0.02em;
}
.hero p.lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 520px;
}
.hero-note {
  margin-top: 14px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* Realistic Product Preview Card in Hero */
.preview-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(28, 25, 23, 0.08);
  overflow: hidden;
}
.preview-bar {
  background: var(--surface-warm);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.preview-body { padding: 18px; display: grid; gap: 12px; }
.preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 12px;
}
.preview-row strong { display: block; font-size: 0.92rem; }
.preview-row small { color: var(--muted); font-size: 0.8rem; }
.stock-pair {
  display: flex;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 600;
}
.stock-box {
  background: var(--surface-warm);
  padding: 4px 10px;
  border-radius: 7px;
  white-space: nowrap;
}
.stock-box.synced { background: var(--success-soft); color: var(--success); }

/* Sections */
.section { padding: 64px 0; }
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.section-sub { color: var(--muted); margin: 0 0 36px; max-width: 600px; }

.cms-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.cms-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.cms-item strong { display: block; font-size: 0.95rem; }
.cms-item span { font-size: 0.8rem; color: var(--muted); }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin: 0 0 8px; font-size: 1.06rem; }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.pill-green { background: var(--success-soft); color: var(--success); }
.pill-amber { background: var(--warning-soft); color: var(--warning); }
.pill-slate { background: var(--surface-warm); color: var(--muted); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }

/* Forms */
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 6px; }

/* Wizard Setup */
.wizard-wrap {
  max-width: 620px;
  margin: 36px auto;
}
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}
.wizard-step-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wizard-step-dot.active { color: var(--accent); }
.wizard-step-dot.done { color: var(--success); }

.platform-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.platform-choice {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.platform-choice:hover { border-color: var(--accent); background: var(--bg); }
.platform-choice.selected { border-color: var(--accent); background: var(--accent-soft); }
.platform-choice strong { display: block; font-size: 0.94rem; }
.platform-choice small { color: var(--muted); font-size: 0.78rem; }

/* Workspace Tabs */
.workspace-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.seg-tabs {
  display: inline-flex;
  background: var(--surface-warm);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 7px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.status-strip {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 0.88rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-pill.active { background: var(--text); color: #fff; border-color: var(--text); }

/* Responsive Table (modern-web-guidance: container query + sticky headers) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(540px, 75vh);
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--surface-warm);
}
th, td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}
thead th:first-child {
  min-width: 230px;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  font-size: 0.9rem;
}

@container (width < 620px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  tr {
    margin: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
  }
  tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 1;
    background: var(--surface-warm);
  }
  td { border-bottom: 1px solid var(--border); padding: 8px 14px; }
  td:last-child { border-bottom: none; }
  td:nth-child(2)::before { content: "SKU : "; font-weight: 600; color: var(--muted); }
  td:nth-child(3)::before { content: "Stock site : "; font-weight: 600; color: var(--muted); }
  td:nth-child(4)::before { content: "Stock Etsy : "; font-weight: 600; color: var(--muted); }
  td:nth-child(5)::before { content: "État : "; font-weight: 600; color: var(--muted); }
}

/* Native Modal <dialog> with smooth Top-Layer Entry/Exit (modern-web-guidance) */
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  width: min(460px, 92vw);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(28, 25, 23, 0.24);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) {
  dialog { transform: translateY(8px) scale(0.96); }
}
:is(dialog[open]):where(:not([data-closing])) {
  opacity: 1;
}
:is(dialog[open]):where(:not([data-closing]))::backdrop {
  background: rgba(28, 25, 23, 0.45);
}
@starting-style {
  :is(dialog[open]):where(:not([data-closing])) {
    opacity: 0;
  }
  :is(dialog[open]):where(:not([data-closing]))::backdrop {
    background: rgba(28, 25, 23, 0);
  }
}
@media (prefers-reduced-motion: no-preference) {
  :is(dialog[open]):where(:not([data-closing])) {
    transform: translateY(0) scale(1);
  }
  @starting-style {
    :is(dialog[open]):where(:not([data-closing])) {
      transform: translateY(8px) scale(0.96);
    }
  }
}
dialog:modal {
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: rgba(28, 25, 23, 0);
  backdrop-filter: blur(3px);
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition-duration: 0.1s; }
}

/* Dropzone & Toast */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
  cursor: pointer;
  margin-top: 10px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 11px 16px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(28, 25, 23, 0.22);
}
.toast.success { background: var(--accent); }
.toast.error { background: var(--danger); }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
}
.faq-item summary { font-weight: 600; cursor: pointer; }
.faq-item p { margin: 8px 0 0; color: var(--muted); font-size: 0.92rem; }

footer.disclaimer {
  margin-top: 64px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

@media (max-width: 820px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* App Shell (World-class SaaS Workspace) */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 61px);
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.side-link:hover { background: var(--surface-warm); color: var(--text); }
.side-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(22, 78, 63, 0.25);
}
.side-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side-badge {
  margin-left: auto;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.74rem;
  padding: 1px 7px;
  border-radius: 999px;
}
.app-main {
  padding: 28px 32px;
  max-width: 1100px;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-main-content {
  flex: 1;
}
.app-footer {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.nowrap { white-space: nowrap; }
.sku-pill {
  display: inline-block;
  white-space: nowrap;
  background: var(--surface-warm);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.table-wrapper tbody tr:hover th,
.table-wrapper tbody tr:hover td {
  background: #fbfaf7;
}
.log-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.log-row:last-child {
  border-bottom: none;
}
.qty-stepper.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Visual Sync Flow Banner */
.sync-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.sync-endpoint {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.sync-endpoint small { display: block; color: var(--muted); font-size: 0.78rem; }
.sync-endpoint strong { font-size: 0.96rem; }
.sync-link-arrow {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

/* Product Thumbnail & Inline Stock Stepper */
.prod-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.prod-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-warm);
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.qty-stepper button {
  border: none;
  background: var(--surface-warm);
  color: var(--text);
  width: 28px;
  height: 28px;
  font-weight: 700;
  cursor: pointer;
}
.qty-stepper button:hover { background: var(--border); }
.qty-stepper span {
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
}

.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--warning-soft);
  border: 1px solid #fcd34d;
  color: #78350f;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.price-preview-box {
  background: var(--accent-soft);
  border: 1px solid rgba(22, 78, 63, 0.2);
  color: var(--accent);
  padding: 14px 16px;
  border-radius: 10px;
  margin: 14px 0;
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
  }
  .side-link { width: auto; white-space: nowrap; }
  .app-main { padding: 20px 16px; }
  .sync-banner { grid-template-columns: 1fr; }
  .sync-link-arrow { transform: rotate(90deg); }
}

/* Premium Motion & Micro-interactions (compositor-only, reduced-motion safe) */
@media (prefers-reduced-motion: no-preference) {
  .btn:active {
    transform: scale(0.98);
  }
  .card, .platform-choice, .cms-item {
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, border-color 0.15s ease;
  }
  .platform-choice:hover, .cms-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(28, 25, 23, 0.06);
  }
  .view-enter {
    animation: viewFadeUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes viewFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .toast {
    animation: toastIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes toastIn {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  .stock-flash {
    animation: stockPop 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes stockPop {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
  }
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  display: inline-block;
  position: relative;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: 999px;
    background: var(--success);
    opacity: 0.35;
    animation: pulseRing 2s ease-out infinite;
  }
  @keyframes pulseRing {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.9); opacity: 0; }
  }
}

.char-counter {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}
.char-counter.over { color: var(--danger); font-weight: 600; }
