/* Moqura UI — brand-guide palette (navy / royal blue / gradient accents). */

:root {
  /* Moqura brand guide palette (normalized) */
  --bg: #f8fafd;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --border: #e6eaf0;
  --border-strong: #d5dce6;
  --ink: #06152e;
  --ink-2: #35435c;
  --muted: #667085;
  --brand: #173ff2;
  --brand-2: #087cfa;
  --brand-soft: #e9effe;
  --grad: linear-gradient(120deg, #087CFA 0%, #173FF2 25%, #7B45F5 52%, #E23FD2 72%, #FF6478 87%, #FF914D 100%);
  --green: #10a35a;
  --amber: #d4a72c;
  --red: #d93025;
  --red-soft: #fceae8;
  --r: 6px;
  --font-ui: "Geist", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--font-ui);
  font-size: 13px; line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--brand); }
::selection { background: #d6e4ff; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 18px; margin: 0; }
h2 { font-size: 13px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
  padding: 12px 10px;
  position: sticky; top: 0; height: 100vh;
}
.main { flex: 1; min-width: 0; background: var(--surface); }
.main-inner { max-width: 920px; margin: 0 auto; padding: 32px 36px 80px; }

.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
  color: var(--ink); padding: 4px 8px 14px;
}
.brand:hover { color: var(--ink); }
.brand .mark {
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; line-height: 1;
  font-family: var(--font-mono);
}

.ws-switch { position: relative; margin-bottom: 12px; }
.ws-switch select {
  width: 100%; appearance: none;
  font: inherit; font-weight: 500; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 6px 28px 6px 10px;
  cursor: pointer;
}
.ws-switch select:hover { border-color: #b6c0d0; }
.ws-switch::after {
  content: ""; position: absolute; right: 11px; top: 50%;
  width: 7px; height: 7px; transform: translateY(-65%) rotate(45deg);
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  pointer-events: none;
}

.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav .label {
  font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); padding: 16px 8px 5px;
}
.side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: var(--r);
  color: var(--ink-2); font-weight: 400; font-size: 13px;
}
.side-link:hover { background: #eaf0f8; color: var(--ink); }
.side-link.active { background: var(--brand-soft); color: var(--ink); font-weight: 500; }
.side-link .count { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { padding: 0; }
.topbar .spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 500; font-size: 13px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  padding: 5px 12px; cursor: pointer; white-space: nowrap;
  transition: border-color 0.1s, background 0.1s;
}
.btn:hover { border-color: #b6c0d0; color: var(--ink); }
.btn:active { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #1233c8; border-color: #1233c8; color: #fff; }
.btn-gradient { background: var(--grad); border: none; color: #fff; padding: 6px 13px; }
.btn-gradient:hover { color: #fff; filter: brightness(1.06); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eaf0f8; border-color: transparent; color: var(--ink); }
.btn-sm { padding: 3px 9px; font-size: 12px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px; overflow: hidden;
}
.card-pad { padding: 16px 18px; }
.card-head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { margin: 0; }
.card-head .grow { flex: 1; }

/* ---------- Page rows ---------- */
.page-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px; border-top: 1px solid var(--border);
  transition: background 0.08s;
}
.page-row:first-of-type { border-top: none; }
.page-row:hover { background: #fafcfe; }
.page-row .name { font-weight: 500; color: var(--ink); font-family: var(--font-mono); font-size: 12.5px; }
.page-row .name:hover { text-decoration: underline; }
.page-row .meta { margin-left: auto; display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Badges: dot + word, no pill ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); font-weight: 400;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.badge-public::before { background: var(--green); }
.badge-private::before { background: var(--amber); }
.badge-plain {
  font-size: 11px; color: var(--muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 0 6px; font-family: var(--font-mono);
}
.badge-plain::before { display: none; }

/* ---------- Forms ---------- */
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 6px 10px;
  transition: border-color 0.1s, box-shadow 0.1s;
}
input:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(8,124,250,0.12); }
input::placeholder, textarea::placeholder { color: #9aa5b5; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin: 13px 0 5px; }
.field-error { color: var(--red); font-size: 12px; margin-top: 4px; }
.inline-form { display: flex; align-items: center; gap: 8px; }

/* ---------- Tables ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list td {
  padding: 8px 18px; border-top: 1px solid var(--border);
  vertical-align: middle; font-size: 12.5px;
}
table.list tr:first-child td { border-top: none; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; bottom: 18px; right: 18px;
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  margin: 0; padding: 0; list-style: none; max-width: 360px;
}
.toasts li {
  background: var(--ink); color: #fafafa;
  border-radius: 8px; padding: 9px 14px;
  font-size: 12.5px;
  animation: toast-in 0.18s ease-out both, toast-out 0.25s ease 5s forwards;
}
.toasts li.error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .glyph {
  font-family: var(--font-mono); font-size: 16px;
  width: 40px; height: 40px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border: 1px dashed var(--border-strong); border-radius: 8px;
}
.empty b { color: var(--ink-2); font-weight: 500; }
.empty code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-block; width: 32px; height: 18px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: #d4d4d4; border-radius: 99px;
  transition: background 0.13s; cursor: pointer;
}
.switch .slider:before {
  content: ""; position: absolute; height: 14px; width: 14px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: transform 0.13s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--brand-2); }
.switch input:checked + .slider:before { transform: translateX(14px); }

/* ---------- Viewer ---------- */
.viewer { display: flex; flex-direction: column; height: 100vh; }
.viewer-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; height: 46px; flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.viewer-bar .crumb { font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.viewer-bar .crumb .sep { color: var(--border-strong); }
.viewer-bar .crumb .slug { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.viewer-frame { flex: 1; border: none; width: 100%; background: #fff; }
.back-arrow {
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: var(--r); color: var(--ink-2); font-size: 14px;
}
.back-arrow:hover { background: #eaf0f8; color: var(--ink); }

/* ---------- Notes drawer ---------- */
.drawer {
  position: fixed; top: 46px; right: 0; bottom: 0; width: 340px;
  background: var(--surface); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.18s ease;
  z-index: 100; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.drawer-foot { padding: 12px 16px; border-top: 1px solid var(--border); }
.note {
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 9px 11px; margin-bottom: 8px;
}
.note.resolved { opacity: 0.45; }
.note .meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.note .actions { margin-top: 6px; }

/* ---------- Code blocks ---------- */
.token-reveal, pre.cmd {
  background: #0f0f0f; color: #d8d8d8;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.65;
  padding: 12px 14px; border-radius: var(--r);
  word-break: break-all; white-space: pre-wrap; margin: 0;
}
.token-reveal { color: #6be5a3; }

/* ---------- Auth ---------- */
.auth { max-width: 360px; margin: 6vh auto 0; padding: 0 18px; }
.auth .card-pad { padding: 24px; }
.auth h1 { font-size: 16px; margin-bottom: 2px; }
.auth .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 4px; }
.auth-brand { display: flex; justify-content: center; padding: 32px 0 16px; }

/* ---------- Landing ---------- */
.landing-nav { border-bottom: 1px solid var(--border); }
.hero { max-width: 640px; margin: 0 auto; padding: 88px 24px 30px; text-align: left; }
.hero h1 {
  font-size: clamp(30px, 5vw, 42px); line-height: 1.12;
  letter-spacing: -0.025em; margin: 0 0 16px; font-weight: 600;
}
.hero p { color: var(--ink-2); font-size: 15px; margin: 0 0 24px; max-width: 480px; }
.hero-cta { display: flex; gap: 8px; }
.hero-cta .btn { padding: 7px 16px; font-size: 13px; }
.hero-term {
  max-width: 640px; margin: 26px auto 0; padding: 0 24px 90px;
}
.hero-term .term {
  background: #0f0f0f; border-radius: 8px; overflow: hidden;
  border: 1px solid #232323;
}
.hero-term .term-bar {
  display: flex; gap: 5px; padding: 10px 12px;
  border-bottom: 1px solid #232323;
}
.hero-term .term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2e2e2e; }
.hero-term pre {
  margin: 0; padding: 14px 16px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.75;
  color: #c9c9c9; overflow-x: auto;
}
.hero-term .c { color: #6f6f6f; }
.hero-term .g { color: #6be5a3; }
@media (max-width: 720px) { .sidebar { display: none; } }

/* ---------- Misc ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- Marketing ---------- */
.mk-section { max-width: 960px; margin: 0 auto; padding: 72px 24px; border-top: 1px solid var(--border); }
.mk-section .kicker {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px;
}
.mk-section h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 8px; }
.mk-section .lede { color: var(--ink-2); font-size: 14px; max-width: 520px; margin: 0 0 36px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.feat { background: var(--surface); padding: 20px; }
.feat .fi {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: inline-block; margin-bottom: 10px;
}
.feat b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.feat p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.how .step { border-top: 1px solid var(--ink); padding-top: 14px; }
.how .step .n { font-family: var(--font-mono); font-size: 11px; color: var(--muted); display: block; margin-bottom: 8px; }
.how .step b { font-size: 13px; display: block; margin-bottom: 4px; }
.how .step p { margin: 0; color: var(--muted); font-size: 12.5px; }
.mk-cta { text-align: center; padding: 80px 24px; border-top: 1px solid var(--border); }
.mk-cta h2 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 20px; }
.footer {
  border-top: 1px solid var(--border); padding: 28px 24px; background: var(--bg);
}
.footer-inner {
  max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 22px;
  font-size: 12.5px; color: var(--muted);
}
.footer-inner .grow { flex: 1; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--ink); }
.mk-nav-links { display: flex; gap: 4px; margin-left: 16px; }
.mk-nav-links a { padding: 5px 10px; border-radius: var(--r); color: var(--ink-2); font-size: 13px; }
.mk-nav-links a:hover { background: #eaf0f8; color: var(--ink); }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
.plan {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 22px; display: flex; flex-direction: column;
}
.plan.featured {
  border: 2px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
}
.plan .pname { font-weight: 600; font-size: 13px; }
.plan .price { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 10px 0 2px; }
.plan .price span { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.plan .pdesc { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.plan ul { list-style: none; margin: 0 0 22px; padding: 0; flex: 1; }
.plan li { font-size: 12.5px; padding: 5px 0 5px 20px; position: relative; color: var(--ink-2); }
.plan li::before { content: "✓"; position: absolute; left: 2px; color: var(--ink); font-size: 11px; }
.plan .btn { width: 100%; }
@media (max-width: 760px) { .plans, .feat-grid, .how { grid-template-columns: 1fr; } }

/* ---------- Docs ---------- */
.docs { max-width: 720px; margin: 0 auto; padding: 48px 24px 90px; }
.docs h1 { font-size: 24px; margin-bottom: 6px; }
.docs .sub { color: var(--muted); margin: 0 0 34px; }
.docs h2 { font-size: 15px; margin: 38px 0 10px; padding-top: 22px; border-top: 1px solid var(--border); }
.docs p { color: var(--ink-2); font-size: 13.5px; }
.docs pre.cmd { margin: 12px 0; }
.docs table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 12px 0; }
.docs th { text-align: left; font-weight: 600; padding: 7px 10px; border-bottom: 1px solid var(--border-strong); font-size: 12px; }
.docs td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs td code { background: var(--surface-2); border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; font-size: 11.5px; white-space: nowrap; }

/* ---------- Billing (mock) ---------- */
.plan-line { display: flex; align-items: center; gap: 14px; }
.plan-line .pill {
  font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 1px 7px;
}
.usage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.usage .u { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.usage .u .uv { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.usage .u .ul { font-size: 12px; color: var(--muted); }
.meter { height: 4px; background: var(--surface-2); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }

/* ---------- Brand mark ---------- */
.brand .logo-mark, .logo-mark { width: 24px; height: auto; display: block; }
.auth-brand .logo-mark { width: 30px; }
.hero .tagline {
  font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--muted); margin-bottom: 14px;
}

/* ---------- Client tabs ---------- */
.client-tabs {
  display: flex; gap: 2px; padding: 8px 14px 0;
  border-bottom: 1px solid var(--border);
}
.client-tabs .tab {
  font: inherit; font-size: 12.5px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 7px 10px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.client-tabs .tab:hover { color: var(--ink); }
.client-tabs .tab.active { color: var(--brand); border-bottom-color: var(--brand); }
