/* ──────────────────────────────────────────────────────────
   CNL · control plane (cnlsystems.com app) styles
   Builds on legal.css (which provides tokens, nav, footer,
   buttons, basic form controls). This file adds:
     - app shell + content padding
     - state banners (info / warning / red / muted)
     - dashboard cards + billing table
     - subscription pill, status dots
     - modals, toasts
     - wizard rail + step layout
     - dev-only "States" picker
   ────────────────────────────────────────────────────────── */

/* App layout — narrower content column than marketing pages */
.app {
  min-height: 60vh;
  padding: 32px 0 96px;
}
.app .container { max-width: 960px; }
.app h1.app-h {
  font-family: var(--sans); font-weight: 500;
  font-size: 26px; line-height: 1.15; letter-spacing: -0.02em;
  margin: 0 0 4px; color: var(--ink);
}
.app .app-sub {
  font-family: var(--mono); font-size: 12px;
  color: var(--muted); margin: 0 0 28px; letter-spacing: 0;
}

/* Auth pages — single centered column */
.auth {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 48px 24px 96px;
}
.auth-card {
  width: 100%; max-width: 420px;
}
.auth-card .auth-h {
  font-family: var(--sans); font-weight: 500;
  font-size: 24px; letter-spacing: -0.02em; margin: 0 0 8px;
}
.auth-card .auth-sub {
  font-size: 14px; color: var(--muted); margin: 0 0 28px;
  line-height: 1.55;
}
.auth-card .badge-trial {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  padding: 6px 12px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; color: var(--ink);
  margin-bottom: 22px;
}
.auth-card .badge-trial .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7be0b5;
}
.auth-card .footer-link {
  margin-top: 22px;
  font-size: 13px; color: var(--muted);
  text-align: center;
}
.auth-card .footer-link a {
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
}
.auth-card .form-legal {
  margin-top: 14px;
  font-size: 11.5px; color: var(--muted-2);
  text-align: center; line-height: 1.5;
}
.auth-card .form-legal a {
  color: var(--muted); border-bottom: 1px solid var(--rule);
}

.btn-block {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
}

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--ink);
  padding: 11px 18px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--rule-strong); border-radius: 8px;
  cursor: pointer; transition: border-color 120ms, background 120ms;
  font-family: var(--sans);
}
.btn-ghost:hover { border-color: #3a3a3a; background: #141414; }
.btn-link {
  background: transparent; border: 0;
  color: var(--muted); font-size: 13px;
  cursor: pointer; padding: 4px 0;
  font-family: var(--sans);
  text-decoration: underline; text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* ── State banners ───────────────────────────────────── */
.banner {
  margin: 20px 0 28px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--bg-card);
  display: flex; align-items: center; gap: 20px;
  padding: 16px 20px;
}
.banner.hidden { display: none; }
.banner .b-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
  box-shadow: 0 0 10px var(--muted);
}
.banner .b-body { flex: 1; }
.banner .b-eyebrow {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); margin: 0 0 3px; letter-spacing: 0;
}
.banner .b-msg {
  font-size: 14px; color: var(--ink); margin: 0;
  line-height: 1.5;
}
.banner .b-cta { flex-shrink: 0; }

.banner.info     { border-color: #2a3344; background: #0d121a; }
.banner.info     .b-dot { background: #6fa8ff; box-shadow: 0 0 10px #6fa8ff; }
.banner.info     .b-eyebrow { color: #6fa8ff; }

.banner.warning  { border-color: #4a3d1f; background: #1a1408; }
.banner.warning  .b-dot { background: #f4c77a; box-shadow: 0 0 10px #f4c77a; }
.banner.warning  .b-eyebrow { color: #f4c77a; }

.banner.danger   { border-color: #4a2424; background: #1a0c0c; }
.banner.danger   .b-dot { background: #e08585; box-shadow: 0 0 10px #e08585; }
.banner.danger   .b-eyebrow { color: #e08585; }

.banner.muted    { border-color: var(--rule-strong); background: var(--bg-card); }
.banner.muted    .b-dot { background: var(--muted-2); box-shadow: none; }
.banner.muted    .b-eyebrow { color: var(--muted-2); }

/* ── Cards ───────────────────────────────────────────── */
.card {
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.card-h {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 0 18px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0;
  color: var(--muted);
}
.card-h .pill {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--rule-strong); color: var(--ink);
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0;
}
.card-h .pill.active { background: #1a3d28; color: #7be0b5; }
.card-h .pill.warn   { background: #3d2f10; color: #f4c77a; }
.card-h .pill.danger { background: #3d1818; color: #e08585; }
.card-h .pill.muted  { background: #1f1f1f; color: var(--muted); }
.card-h .pill.info   { background: #1c2638; color: #6fa8ff; }

.card-row {
  display: grid; grid-template-columns: 160px 1fr auto;
  gap: 16px; align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.card-row:first-of-type { border-top: 0; padding-top: 0; }
.card-row .k {
  font-family: var(--mono); font-size: 11.5px;
  color: var(--muted); letter-spacing: 0;
}
.card-row .v {
  font-size: 14px; color: var(--ink);
}
.card-row .v.editable {
  border: 1px solid transparent; padding: 4px 6px; margin: -4px -6px;
  border-radius: 4px; cursor: text;
  transition: border-color 120ms, background 120ms;
}
.card-row .v.editable:hover { border-color: var(--rule-strong); background: #141414; }
.card-row .v.editable:focus { outline: none; border-color: #4a4a4a; background: #141414; }
.card-row .actions {
  display: flex; gap: 8px;
}

.plan-headline {
  display: flex; align-items: baseline; gap: 12px;
  flex-wrap: wrap;
}
.plan-headline .price {
  font-size: 28px; font-weight: 500; letter-spacing: -0.02em;
  color: var(--ink);
}
.plan-headline .price .per { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan-headline .plan-label {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}

.card-foot {
  margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}

/* Billing table */
.billing-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.billing-table thead th {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted); font-weight: 400; letter-spacing: 0;
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.billing-table thead th:last-child { text-align: right; }
.billing-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink); vertical-align: middle;
  font-variant-numeric: tabular-nums slashed-zero;
}
.billing-table tbody td:last-child { text-align: right; }
.billing-table tbody tr:last-child td { border-bottom: 0; }
.billing-table .status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px;
  padding: 3px 8px; border-radius: 999px;
  letter-spacing: 0;
}
.billing-table .status.paid    { background: #1a3d28; color: #7be0b5; }
.billing-table .status.failed  { background: #3d1818; color: #e08585; }
.billing-table .status.pending { background: #3d2f10; color: #f4c77a; }
.billing-table .invoice-link {
  font-family: var(--mono); font-size: 12px;
  color: var(--muted);
}
.billing-table .invoice-link:hover { color: var(--ink); }

/* Two-column cards */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 760px) {
  .two-col { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: 1fr; gap: 6px; }
  .card-row .actions { justify-self: start; }
}

/* ── Modals ──────────────────────────────────────────── */
.modal-veil {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-veil.open { display: flex; }
.modal {
  width: 100%; max-width: 480px;
  background: #0e0e0e;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.modal h3 {
  font-family: var(--sans); font-weight: 500;
  font-size: 18px; margin: 0 0 8px; letter-spacing: -0.015em;
}
.modal p {
  font-size: 14px; color: var(--muted); line-height: 1.6;
  margin: 0 0 22px;
}
.modal .actions {
  display: flex; gap: 10px; justify-content: flex-end;
  align-items: center; flex-wrap: wrap;
}
.modal-radio-group {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 22px;
}
.modal-radio-group label {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  border-radius: 6px;
  padding: 10px 14px; font-size: 13.5px;
  color: var(--ink); cursor: pointer;
  transition: border-color 120ms;
}
.modal-radio-group label:hover { border-color: #3a3a3a; }
.modal-radio-group input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--rule-strong);
  position: relative; cursor: pointer; flex-shrink: 0; margin: 0;
}
.modal-radio-group input[type="radio"]:checked { border-color: var(--ink); }
.modal-radio-group input[type="radio"]:checked::after {
  content: ''; position: absolute; inset: 3px;
  background: var(--ink); border-radius: 50%;
}
.modal-radio-group label:has(input:checked) {
  border-color: var(--ink); background: #141414;
}

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 200;
  background: #0e0e0e;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13.5px; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .ok { color: #7be0b5; }

/* ── Wizard ──────────────────────────────────────────── */
.wizard {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  padding: 48px 0 96px;
}
.wizard-rail {
  position: sticky; top: 92px;
  align-self: start;
  font-family: var(--mono); font-size: 12px;
}
.wizard-rail h4 {
  font-size: 11px; color: var(--muted-2); font-weight: 400;
  margin: 0 0 16px; letter-spacing: 0;
}
.wizard-rail ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.wizard-rail li {
  display: flex; gap: 12px; align-items: center;
  color: var(--muted-2);
}
.wizard-rail li .step-no {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--rule-strong);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted-2);
  flex-shrink: 0;
}
.wizard-rail li.done { color: var(--muted); }
.wizard-rail li.done .step-no { background: #1a3d28; border-color: #1a3d28; color: #7be0b5; }
.wizard-rail li.current { color: var(--ink); }
.wizard-rail li.current .step-no { background: var(--ink); border-color: var(--ink); color: #000; }
.wizard-body {
  max-width: 560px;
}
.wizard-body .step-eyebrow {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted-2); margin: 0 0 14px; letter-spacing: 0;
}
.wizard-body h1 {
  font-family: var(--sans); font-weight: 500;
  font-size: 28px; letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.wizard-body p.lede {
  font-size: 15px; color: var(--muted); line-height: 1.6;
  margin: 0 0 32px; max-width: 52ch;
}
.wizard-actions {
  display: flex; gap: 10px; align-items: center;
  margin-top: 32px; flex-wrap: wrap;
}
.wizard-actions .skip {
  margin-left: auto;
}
@media (max-width: 880px) {
  .wizard { grid-template-columns: 1fr; gap: 32px; padding: 32px 0 80px; }
  .wizard-rail {
    position: static;
    display: flex; align-items: center; gap: 8px;
    overflow-x: auto;
  }
  .wizard-rail h4 { display: none; }
  .wizard-rail ol { flex-direction: row; gap: 8px; }
  .wizard-rail li { white-space: nowrap; }
}

/* Stripe-style card field mock */
.stripe-field {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  border: 1px solid var(--rule-strong);
  background: #141414;
  border-radius: 8px;
  padding: 14px 16px;
}
.stripe-field input {
  background: transparent; border: 0;
  font-family: var(--mono); font-size: 14px; color: var(--ink);
  padding: 0; outline: none;
  font-variant-numeric: tabular-nums slashed-zero;
}
.stripe-field input::placeholder { color: var(--muted-2); }
.stripe-field .row {
  display: grid; grid-template-columns: 1fr 100px 80px;
  gap: 10px; align-items: center;
}
.stripe-field .row input { border-left: 1px solid var(--rule); padding-left: 10px; }
.stripe-field .row input:first-child { border-left: 0; padding-left: 0; }

/* DNS code block */
.dns-block {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0 24px;
}
.dns-block table { width: 100%; border-collapse: collapse; }
.dns-block th {
  text-align: left; padding: 10px 14px;
  font-size: 10.5px; color: var(--muted); font-weight: 400;
  letter-spacing: 0;
  background: #131313;
  border-bottom: 1px solid var(--rule);
}
.dns-block td {
  padding: 12px 14px;
  color: var(--ink);
  border-top: 1px solid var(--rule);
}
.dns-block td:first-child { color: var(--muted); }
.dns-block .copy { color: var(--muted-2); cursor: pointer; }
.dns-block .copy:hover { color: var(--ink); }

/* ── Cancel done / reactivate pages ──────────────────── */
.center-card {
  max-width: 520px; margin: 80px auto 96px;
  text-align: center;
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  border-radius: 14px;
  padding: 48px 36px;
}
.center-card .check, .center-card .pause {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin: 0 auto 22px;
}
.center-card .check { background: #1a3d28; color: #7be0b5; }
.center-card .pause { background: #1f1f1f; color: var(--muted); }
.center-card h1 {
  font-family: var(--sans); font-weight: 500;
  font-size: 22px; margin: 0 0 10px; letter-spacing: -0.02em;
}
.center-card p {
  font-size: 14.5px; color: var(--muted); margin: 0 0 28px;
  line-height: 1.6;
}

/* ── Dev "States" picker ─────────────────────────────── */
.dev-picker {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  background: #0a0a0a;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
  font-family: var(--mono); font-size: 11px;
}
.dev-picker .label {
  color: var(--muted-2); padding: 0 10px;
  letter-spacing: 0;
  border-right: 1px solid var(--rule);
  margin-right: 2px;
  line-height: 1.4;
}
.dev-picker select {
  background: transparent; border: 0;
  color: var(--ink); font-family: var(--mono); font-size: 11px;
  padding: 6px 8px; cursor: pointer;
  outline: none;
}
.dev-picker select option { background: #0a0a0a; color: var(--ink); }

/* ── Admin (cnlmodel) mock ───────────────────────────── */
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
}
.admin-side {
  border-right: 1px solid var(--rule);
  padding: 24px 16px;
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg);
}
.admin-side .biz {
  padding: 4px 12px 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.admin-side .biz .name {
  font-family: var(--sans); font-weight: 500;
  font-size: 14px; color: var(--ink); margin: 0 0 2px;
  letter-spacing: -0.005em;
}
.admin-side .biz .url { color: var(--muted); font-size: 11.5px; }
.admin-side ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.admin-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  color: var(--muted); border-radius: 6px;
  transition: background 120ms, color 120ms;
}
.admin-side a:hover { background: var(--bg-card); color: var(--ink); }
.admin-side a.current { background: var(--bg-card); color: var(--ink); }
.admin-side a .ic {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--muted-2);
}
.admin-main {
  padding: 28px 32px 80px;
}
.admin-main.suspended {
  position: relative;
}
.admin-main.suspended::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  pointer-events: none;
  z-index: 1;
}
.admin-main.suspended .admin-content {
  pointer-events: none;
  filter: grayscale(0.6);
  opacity: 0.5;
}
.admin-content {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px;
  margin-top: 20px;
}
.metric {
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 20px;
}
.metric .k { font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 0 0 10px; letter-spacing: 0; }
.metric .v { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); }
.metric .v .delta { font-size: 12px; color: #7be0b5; margin-left: 8px; }
.admin-list-card {
  grid-column: 1 / -1;
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 20px 24px;
}
.admin-list-card h3 {
  font-family: var(--sans); font-weight: 500;
  font-size: 15px; margin: 0 0 14px; letter-spacing: -0.01em;
}
.admin-list-card .row {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto;
  gap: 16px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--rule);
  font-size: 13.5px;
}
.admin-list-card .row:first-of-type { border-top: 0; }
.admin-list-card .row .name { color: var(--ink); font-weight: 500; }
.admin-list-card .row .when { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.admin-list-card .row .svc { color: var(--muted); }
.admin-list-card .row .pill {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--rule-strong); color: var(--ink);
  padding: 3px 8px; border-radius: 999px;
}
.admin-list-card .row .pill.confirmed { background: #1a3d28; color: #7be0b5; }

@media (max-width: 760px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    border-right: 0; border-bottom: 1px solid var(--rule);
    padding: 16px;
  }
  .admin-side ul { flex-direction: row; overflow-x: auto; gap: 4px; }
  .admin-content { grid-template-columns: 1fr; }
  .admin-list-card .row { grid-template-columns: 1fr; gap: 4px; }
}

/* ── Privacy editor ──────────────────────────────────── */
.editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}
.editor .pane {
  border: 1px solid var(--rule-strong);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
}
.editor .pane h3 {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0; margin: 0 0 18px; font-weight: 400;
}
.editor .preview-pane {
  max-height: 640px; overflow-y: auto;
  background: var(--bg-elev);
}
.editor .preview-pane::-webkit-scrollbar { width: 6px; }
.editor .preview-pane::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 3px; }
.editor .preview-body {
  font-size: 13.5px; line-height: 1.65; color: #d4d4d4;
}
.editor .preview-body h2 {
  font-family: var(--sans); font-weight: 500;
  font-size: 16px; margin: 24px 0 10px; color: var(--ink);
  letter-spacing: -0.012em;
}
.editor .preview-body h2:first-child { margin-top: 0; }
.editor .preview-body p { margin: 0 0 14px; }
.editor .preview-body strong { color: var(--ink); }
.editor-foot {
  margin-top: 18px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.editor-foot .preview-live {
  margin-left: auto;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.editor-foot .preview-live:hover { color: var(--ink); }
.editor-disclaimer {
  margin-top: 24px;
  font-size: 12.5px; color: var(--muted-2);
  line-height: 1.5;
}
.editor-disclaimer a { color: var(--muted); border-bottom: 1px solid var(--rule); }
@media (max-width: 880px) {
  .editor { grid-template-columns: 1fr; }
}
