/* Espace client Sonyna. Même design system que la vitrine : lavande, encre,
   violet, titrage serif (Lora), labels mono. Light mode uniquement. */

@font-face {
  font-family: "Lora";
  src: url("../fonts/lora.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --bg: #f6f6fb;
  --bg-2: #f0f0f6;
  --ink: #16172a;
  --ink-2: #3a3b52;
  --muted: #5f6178;
  --muted-2: #6a6c83;
  --line: #e7e7f0;
  --line-2: #dadae6;
  --violet: #5a34d6;
  --violet-deep: #3f259f;
  --violet-050: #f2effc;
  --violet-100: #e7e1fa;
  --ok: #2f9e6f;
  --warn: #b3701e;
  --err: #b3372f;
  --font-display: "Lora", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(22, 23, 42, 0.04), 0 8px 22px -16px rgba(22, 23, 42, 0.16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.012em; line-height: 1.15; margin: 0; color: var(--ink); }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
p { margin: 0 0 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 6px; }

.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--violet); font-weight: 500; }
.ext::after { content: "↗"; display: inline-block; margin-left: 4px; font-size: 0.82em; transform: translateY(-1px); }

/* ------------------------------- topbar ---------------------------------- */
.preview-note { background: var(--violet); color: #fff; font-size: 13px; padding: 8px 16px; text-align: center; }
.preview-note a { color: #fff; text-decoration: underline; font-weight: 600; }
.topbar { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 18px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.topbar-logo img { height: 26px; width: auto; }
.topbar-account { font-family: var(--font-mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; background: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-name { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.topbar-out { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); transition: color 0.2s ease, border-color 0.2s ease; }
.topbar-out:hover { color: var(--err); border-color: var(--line-2); }
.topbar-out svg { width: 17px; height: 17px; }
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 10px; }
.burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ------------------------------- cadre ------------------------------------ */
.frame { display: grid; grid-template-columns: 232px 1fr; gap: 0; max-width: 1280px; margin: 0 auto; min-height: calc(100vh - 60px); }
.sidenav { padding: 22px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; }
.sidenav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--muted); transition: background 0.15s ease, color 0.15s ease; }
.sidenav a svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: 0.85; }
.sidenav a:hover { background: var(--bg-2); color: var(--ink); }
.sidenav a[aria-current="page"] { background: var(--violet-050); color: var(--violet); font-weight: 600; }
.sidenav-site { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 16px !important; font-size: 13px !important; }
.content { padding: 30px 34px 60px; min-width: 0; }

/* ------------------------------ composants -------------------------------- */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin: 6px 0 24px; }
.pagehead h1 { font-size: clamp(24px, 3vw, 32px); margin-top: 6px; }
.pagehead-actions { display: flex; gap: 10px; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px 24px; margin-bottom: 18px; }
.content > .grid-2, .content > .grid-3, .content > .table-wrap { margin-bottom: 18px; }
.card h2 { font-size: 19px; margin-bottom: 6px; }
.card h3 { font-size: 16px; }
.card-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.stat b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat small { display: block; font-size: 12px; color: var(--muted-2); margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14px; padding: 10px 18px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.btn svg { width: 16px; height: 16px; }
.btn-solid { background: var(--violet); color: #fff; box-shadow: 0 1px 2px rgba(63, 37, 159, 0.3), 0 8px 20px -10px rgba(90, 52, 214, 0.5); }
.btn-solid:hover { background: var(--violet-deep); transform: translateY(-1px); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }
.btn-danger { background: var(--paper); color: var(--err); border-color: var(--line-2); }
.btn-danger:hover { border-color: var(--err); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; background: var(--bg-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge--ok { background: #ecf7f1; color: var(--ok); border-color: #d4ecdf; }
.badge--warn { background: #fdf4e7; color: var(--warn); border-color: #f3e2c8; }
.badge--violet { background: var(--violet-050); color: var(--violet); border-color: var(--violet-100); }
.badge--err { background: #fdeeee; color: var(--err); border-color: #f4d4d2; }

.flash { border-radius: 10px; padding: 12px 16px; font-size: 14px; margin: 0 0 18px; border: 1px solid; }
.flash--ok { background: #ecf7f1; color: var(--ok); border-color: #d4ecdf; }
.flash--err { background: #fdeeee; color: var(--err); border-color: #f4d4d2; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.list th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.list td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .row-actions { display: flex; gap: 8px; justify-content: flex-end; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; background: #fff; border: 1px solid var(--line-2); border-radius: 9px; color: var(--ink); font: inherit; font-size: 16px; padding: 10px 13px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(90, 52, 214, 0.12); }
.field-hint { font-size: 12.5px; color: var(--muted-2); margin: 6px 0 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; cursor: pointer; }
.check-line input { width: 17px; height: 17px; accent-color: var(--violet); }

.gauge { margin: 6px 0 4px; }
.gauge-track { height: 10px; border-radius: 6px; background: var(--violet-100); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 6px; background: var(--violet); transition: width 0.4s ease; }
.gauge--warn .gauge-fill { background: var(--warn); }
.gauge-label { display: block; font-size: 12.5px; color: var(--muted); margin-top: 7px; }

.copy-line { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 8px 8px 13px; }
.copy-line code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.copy-line button { flex: 0 0 auto; }

pre.snippet { margin: 0; background: #14152a; color: #cfd0e8; border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; }

/* ------------------------------- auth ------------------------------------- */
body.auth { display: grid; place-items: center; min-height: 100vh; background:
  radial-gradient(700px 420px at 85% -10%, rgba(90, 52, 214, 0.07), transparent 60%), var(--bg); }
.auth-wrap { width: 100%; max-width: 420px; padding: 40px 22px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-logo img { height: 34px; width: auto; }
.auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 30px 28px; }
.auth-card h1 { font-size: 23px; margin-bottom: 4px; }
.auth-card .card-sub { margin-bottom: 20px; }
.auth-alt { text-align: center; font-size: 13.5px; color: var(--muted); margin: 18px 0 0; }
.auth-alt a { color: var(--violet); font-weight: 600; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--muted-2); margin-top: 22px; }
.auth-foot a { color: var(--muted); }
.btn-sso { width: 100%; margin-top: 12px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12px; margin: 16px 0 4px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------- aperçu marque -------------------------------- */
.wl-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 20px; align-items: start; }
.wl-preview { position: sticky; top: 84px; }
.wl-stage { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); background: var(--wl-bg, #f6f6fb); }
.wl-bar { display: flex; align-items: center; gap: 8px; background: #fff; border-bottom: 1px solid var(--line); padding: 9px 12px; }
.wl-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.wl-bar span { margin-left: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-room { padding: 18px; }
.wl-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.wl-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--wl-accent, #5a34d6); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.wl-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.wl-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wl-tile { aspect-ratio: 4/3; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.wl-tile--on { outline: 2px solid var(--wl-accent, #5a34d6); outline-offset: -2px; }
.wl-tile svg { width: 34%; height: auto; color: var(--line-2); }
.wl-toolbar { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.wl-dot { width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.wl-dot svg { width: 15px; height: 15px; }
.wl-dot--accent { background: var(--wl-accent, #5a34d6); border-color: transparent; color: #fff; }
.wl-join { display: flex; justify-content: center; margin-top: 14px; }
.wl-join span { background: var(--wl-accent, #5a34d6); color: #fff; font-size: 13px; font-weight: 600; border-radius: 8px; padding: 9px 18px; }
.color-duo { display: flex; gap: 10px; align-items: center; }
.color-duo input[type="color"] { width: 42px; height: 38px; padding: 3px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; cursor: pointer; }
.color-duo input[type="text"] { flex: 1; }

.dns-steps { list-style: none; counter-reset: d; margin: 0; padding: 0; display: grid; gap: 12px; }
.dns-steps li { counter-increment: d; padding-left: 40px; position: relative; font-size: 14px; color: var(--ink-2); }
.dns-steps li::before { content: counter(d); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 8px; background: var(--violet-050); color: var(--violet); font-family: var(--font-mono); font-size: 12px; font-weight: 600; display: grid; place-items: center; }

/* ------------------------------ responsive -------------------------------- */
@media (max-width: 900px) {
  .frame { grid-template-columns: 1fr; }
  .burger { display: flex; }
  .sidenav { display: none; position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); background: var(--paper); }
  .sidenav[data-open="true"] { display: flex; }
  .content { padding: 22px 18px 50px; }
  .grid-2, .grid-3, .field-row, .wl-grid { grid-template-columns: 1fr; }
  .wl-preview { position: static; order: -1; }
  .topbar-name { display: none; }
  .topbar-account { max-width: 34vw; }
}
