/* Customer portal — extends the marketing design system (checkout.css provides .panel/.field/.notice) */

.portal-body { min-height: 100vh; display: flex; flex-direction: column; }

.portal-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,7,12,0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.portal-topbar__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.portal-topbar__inner nav { display: flex; gap: 22px; margin-left: 14px; }
.portal-topbar__inner nav a { font-size: 13.5px; font-weight: 500; color: var(--muted); transition: color .2s; }
.portal-topbar__inner nav a:hover { color: var(--text); }
.portal-topbar__inner nav a.is-active { color: #d8ccff; }
.portal-user {
  margin-left: auto;
  display: flex; align-items: center; gap: 14px;
  font-size: 13px; color: var(--faint);
}
.portal-user button { font-size: 12.5px; color: var(--faint); font-weight: 500; transition: color .2s; }
.portal-user button:hover { color: var(--rose); }

.portal-main { flex: 1; padding: 48px 0 90px; }
.portal-greeting { margin-bottom: 34px; }
.portal-greeting h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 750; letter-spacing: -0.025em; }
.portal-greeting p { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- License cards ---------- */
.license-card { margin-bottom: 20px; }
.license-card__top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.license-card__top .key {
  font-family: var(--font-mono); font-size: 15.5px; font-weight: 700; letter-spacing: .05em;
  color: #e9e4ff;
}
.license-card__meta {
  display: flex; gap: 22px; flex-wrap: wrap;
  font-size: 12px; color: var(--faint);
  margin-bottom: 14px;
}
.license-card__meta b { color: var(--muted); font-weight: 600; }

.machine-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.machine-table th {
  text-align: left; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.machine-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.machine-table tr:last-child td { border-bottom: 0; }
.machine-table .mono { font-size: 11px; color: var(--muted); }

.seat-bar { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--faint); margin-top: 12px; }
.seat-bar .bar { flex: 1; max-width: 200px; }

/* ---------- Sections & orders ---------- */
.portal-section-title {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint);
  margin: 40px 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.portal-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.order-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.order-table th {
  text-align: left; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.order-table td { padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.order-table tr:last-child td { border-bottom: 0; }

.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.status-dot--paid, .status-dot--active { color: var(--emerald); }
.status-dot--paid::before, .status-dot--active::before { background: var(--emerald); }
.status-dot--pending { color: var(--amber); }
.status-dot--pending::before { background: var(--amber); }
.status-dot--revoked, .status-dot--refunded, .status-dot--failed { color: var(--rose); }
.status-dot--revoked::before, .status-dot--refunded::before, .status-dot--failed::before { background: var(--rose); }

.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.resource-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  display: block;
  transition: transform .25s var(--ease), border-color .25s;
}
.resource-card:hover { transform: translateY(-3px); border-color: rgba(124,58,237,0.45); }
.resource-card h3 { font-size: 14.5px; font-weight: 650; margin-bottom: 6px; }
.resource-card p { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.resource-card .go { font-size: 11.5px; color: var(--violet-2); font-weight: 600; margin-top: 12px; display: inline-block; }

.copy-btn.copied { color: var(--emerald); border-color: rgba(52,211,153,0.5); }

/* ---------- Docs ---------- */
.docs-layout { display: grid; grid-template-columns: 230px 1fr; gap: 48px; align-items: start; }
.docs-toc {
  position: sticky; top: 96px;
  border-left: 1px solid var(--border);
  padding-left: 0;
  display: grid; gap: 2px;
}
.docs-toc a {
  font-size: 13px; color: var(--faint);
  padding: 7px 0 7px 16px;
  border-left: 2px solid transparent;
  margin-left: -1.5px;
  transition: color .2s, border-color .2s;
}
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-active { color: #d8ccff; border-left-color: var(--violet-2); }
.docs-content { max-width: 760px; min-width: 0; }
.docs-content h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 750; letter-spacing: -0.025em; margin-bottom: 14px; }
.docs-content > .docs-lede { color: var(--muted); font-size: 15.5px; line-height: 1.7; margin-bottom: 40px; }
.docs-content h2 {
  font-size: 21px; font-weight: 700; letter-spacing: -0.02em;
  margin: 48px 0 14px; padding-top: 20px; border-top: 1px solid var(--border);
}
.docs-content h2:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.docs-content h3 { font-size: 15.5px; font-weight: 650; margin: 24px 0 8px; }
.docs-content p, .docs-content li { font-size: 14px; color: var(--muted); line-height: 1.75; }
.docs-content p { margin-bottom: 12px; }
.docs-content ul { padding-left: 20px; margin-bottom: 14px; }
.docs-content ul li { list-style: disc; margin-bottom: 6px; }
.docs-content ol { padding-left: 20px; margin-bottom: 14px; }
.docs-content ol li { list-style: decimal; margin-bottom: 6px; }
.docs-content b, .docs-content strong { color: var(--text); font-weight: 600; }
.docs-content code {
  font-family: var(--font-mono); font-size: 12px;
  background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.25);
  padding: 1.5px 6px; border-radius: 5px; color: #d8ccff;
}
.docs-content pre {
  background: rgba(0,0,0,0.35); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin: 14px 0;
  overflow-x: auto;
}
.docs-content pre code { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.docs-callout {
  border: 1px solid rgba(124,58,237,0.35);
  background: var(--violet-soft);
  border-radius: 10px; padding: 14px 17px; margin: 16px 0;
  font-size: 13.5px; color: #d8ccff; line-height: 1.65;
}
.docs-callout.amber { border-color: rgba(251,191,36,0.35); background: rgba(251,191,36,0.07); color: #fde9b8; }

.login-wrap .back-note { margin-top: 16px; font-size: 12.5px; color: var(--faint); }
.login-wrap .back-note a { color: var(--violet-2); }

/* ---------- Docs figures (real app screenshots) ---------- */
.docs-figure { margin: 20px 0 28px; }
.docs-figure .window { border-radius: 14px; }
.docs-figure img { width: 100%; height: auto; display: block; }
.docs-figure figcaption {
  margin-top: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .04em;
  color: var(--faint);
  text-align: center;
}

/* ---------- Folder map (replaces ASCII tree) ---------- */
.folder-map { display: grid; gap: 7px; margin: 16px 0; }
.folder-map__row {
  display: grid; grid-template-columns: minmax(200px, auto) 1fr; gap: 16px; align-items: baseline;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  padding: 10px 14px;
}
.folder-map__row .fname {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: #cdb9ff;
}
.folder-map__row .fdesc { font-size: 12.5px; color: var(--muted); }
.folder-map__row--root { border-style: dashed; }
.folder-map__row--root .fname { color: var(--text); }
.folder-map__row--hot { border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.05); }
.folder-map__row--hot .fname { color: #b8f4dd; }

/* ---------- Filename anatomy (replaces ASCII diagram) ---------- */
.filename-anatomy {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 20px 18px 16px;
  margin: 16px 0;
}
.filename-anatomy__name {
  font-family: var(--font-mono);
  font-size: clamp(13px, 2vw, 16.5px);
  font-weight: 700;
  text-align: center;
  word-break: break-all;
}
.filename-anatomy__name .seg { border-bottom: 2px solid; padding-bottom: 3px; }
.seg--round { color: var(--violet-2); border-color: var(--violet-2); }
.seg--name { color: var(--emerald); border-color: var(--emerald); }
.seg--role { color: var(--blue); border-color: var(--blue); }
.seg--ext { color: var(--faint); border-color: transparent; }
.filename-anatomy__legend {
  display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
  margin-top: 14px;
  font-size: 11.5px; color: var(--muted);
}
.filename-anatomy__legend span::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px;
  margin-right: 7px; background: currentColor;
}
.filename-anatomy__legend .l-round { color: var(--violet-2); }
.filename-anatomy__legend .l-name { color: var(--emerald); }
.filename-anatomy__legend .l-role { color: var(--blue); }

@media (max-width: 860px) {
  .resource-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; border-left: 0; }
  .docs-toc a { padding: 4px 0; border-left: 0; }
  .portal-topbar__inner nav { display: none; }
}
