:root {
  --primary: #a83e2b;
  --primary-d: #7f2c1d;
  --gold: #b88a3e;
  --bg: #f4efe8;
  --card: #ffffff;
  --ink: #241f1b;
  --muted: #8c8377;
  --line: #e8e0d4;
  --ok: #2e7d4f;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --shadow: 0 8px 26px rgba(60,40,20,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); background: var(--bg); color: var(--ink); }
button { font-family: inherit; cursor: pointer; }
h1,h2,h3 { font-family: var(--serif); font-weight: 600; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--primary), var(--primary-d));
  color: #fdf6ef; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3); display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px;
}
.brand b { font-size: 16px; display: block; }
.brand small { font-size: 11.5px; opacity: .85; }
nav#nav { display: flex; flex-direction: column; gap: 3px; }
.navitem {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 10px;
  color: #fdf6ef; background: transparent; border: none; text-align: left; font-size: 13.5px; width: 100%;
}
.navitem:hover { background: rgba(255,255,255,.1); }
.navitem.active { background: rgba(255,255,255,.18); font-weight: 600; }
.navitem .ic { width: 18px; height: 18px; flex: 0 0 18px; opacity: .95; }
.navitem .ic svg { width: 100%; height: 100%; }
.side-foot { margin-top: auto; padding: 10px 8px 2px; font-size: 12px; opacity: .85; }
.side-foot .pill { background: rgba(255,255,255,.16); padding: 4px 10px; border-radius: 999px; }

/* ---------- Content ---------- */
.content { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--card);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 20px; }
#view { padding: 22px 24px 60px; max-width: 1000px; }

/* ---------- Composants ---------- */
.btn { background: var(--primary); color: #fff; border: none; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.btn:hover { background: var(--primary-d); }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn.soft { background: #f3ebe1; color: var(--ink); }
.btn.sm { padding: 7px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card2 { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-family: var(--serif); font-size: 26px; color: var(--primary); }
.stat .lbl { font-size: 12.5px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=tel], input[type=email], input[type=time], input[type=number], textarea, select {
  font-family: inherit; font-size: 13.5px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; padding: 8px 13px; border-radius: 999px;
  font-size: 12.5px; user-select: none;
}
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.sw.on { box-shadow: 0 0 0 2px var(--ink); }

.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.section-title { font-size: 16px; margin: 4px 0 12px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.note { background: #f8f1e6; border: 1px solid #ecdcc4; color: #7a5a2e; padding: 11px 13px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; }
.badge-ok { color: var(--ok); font-weight: 600; font-size: 12.5px; }

/* ---------- Wizard ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #efe6da; color: var(--muted); }
.step-dot.on { background: var(--primary); color: #fff; }
.step-dot.done { background: var(--gold); color: #fff; }
.wizard-actions { display: flex; justify-content: space-between; margin-top: 18px; }

/* ---------- Aperçu site (iframe) ---------- */
.preview-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.editor-panel { max-height: 640px; overflow: auto; }

/* ---------- Post preview ---------- */
.post-card { width: 300px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.post-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.post-head .av { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 13px; }
.post-img { aspect-ratio: 1; background: linear-gradient(135deg,#f1e9dd,#e6dccc); display: grid; place-items: center; color: #c4b29a; }
.post-img img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 10px 12px; font-size: 13px; line-height: 1.5; }

/* ---------- Connect cards ---------- */
.net { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 10px; }
.net .left { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,14,10,.6); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 16px; padding: 20px; max-width: 560px; width: 100%; position: relative; max-height: 88vh; overflow: auto; }
.modal-card #modalClose, .modal-card .x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: none; background: #f0e9df; }

/* ---------- Écran de connexion (auth) ---------- */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 22px;
  background:
    radial-gradient(58% 52% at 16% 12%, rgba(255,255,255,.17), transparent 60%),
    radial-gradient(48% 50% at 86% 84%, rgba(255,255,255,.12), transparent 55%),
    linear-gradient(135deg, var(--primary), var(--primary-d) 68%, #571d12);
  background-attachment: fixed; }
.auth-card { width: 100%; max-width: 432px; background: #fffdfb; border-radius: 22px;
  box-shadow: 0 30px 80px -22px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.08);
  padding: 30px 28px 24px; animation: authIn .5s cubic-bezier(.2,.7,.2,1); }
@keyframes authIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.auth-brand .dot { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; display: grid; place-items: center; font-family: "Fraunces", var(--serif); font-weight: 700; font-size: 22px;
  box-shadow: 0 10px 22px -8px var(--primary); }
.auth-brand b { font-family: "Fraunces", var(--serif); font-size: 21px; letter-spacing: -.01em; }
.auth-card h1.auth-title { font-family: "Fraunces", var(--serif); font-weight: 600; font-size: clamp(25px, 5.4vw, 31px);
  line-height: 1.08; margin: 6px 0 6px; letter-spacing: -.015em; }
.auth-card .auth-sub { color: #6b6358; font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }
.auth-card .field label { font-weight: 600; }
.auth-feats { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-feats span { font-size: 12px; color: var(--primary); background: #fbeee9; border: 1px solid #f1d8cf; padding: 5px 11px; border-radius: 999px; font-weight: 600; }
.pw-eye:hover { color: var(--primary) !important; }

/* ---------- Onboarding ---------- */
.onboard { max-width: 560px; margin: 8vh auto; }
.type-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 16px 0; }
.type-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; text-align: center; }
.type-card.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.type-card .big { font-size: 30px; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  nav#nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: none; }
  .preview-wrap { grid-template-columns: 1fr; }
}
