/*
 * Quiet Instrument — secondary pages (pricing, legal, thanks, account, auth).
 *
 * Loaded by app/_components/QiPageShell.tsx after quiet-instrument.css. Colour comes only from
 * the token custom properties in quiet-instrument-tokens.css; nothing here introduces a value.
 * Reuses qi- classes wherever they exist — this file carries only what the secondary pages
 * need beyond the base sheet.
 */

/* ------------------------------------------------------------ shell */

/*
 * Short pages (thanks, sign-in) would otherwise leave the footer floating mid-viewport with
 * the site's light body colour beneath it. html:has(.qi) already paints the root dark; this
 * pins the footer to the bottom as well.
 */
.qi-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.qi-page main {
  flex: 1;
}

/* Same skip link as the homepage's inline copy — a state selector cannot be an inline style. */
.qi .qi-skip {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.qi .qi-skip:focus {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  width: auto; height: auto;
  margin: 0; padding: 10px 16px;
  overflow: visible;
  clip-path: none;
  border-radius: 6px;
  background: var(--qi-accent);
  color: var(--qi-on-accent);
  font-size: 14px;
  font-weight: 600;
}

/* The slim footer is only the base line; it does not need the rule that separates the base
 * line from the link grid it doesn't have. */
.qi-footer--slim .qi-footer-base {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.qi .qi-footer-base a {
  color: var(--qi-label);
}

.qi .qi-footer-base a:hover {
  color: var(--qi-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------ prose (privacy, terms, returns) */

.qi-prose {
  max-width: 65ch;
}

.qi-prose h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--qi-ink);
  margin-top: 34px;
}

.qi-prose p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--qi-label);
}

.qi .qi-prose a {
  color: var(--qi-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--qi-edge-strong);
}

.qi .qi-prose a:hover {
  text-decoration-color: var(--qi-accent);
}

/* The page head sits above the prose: eyebrow, title, dateline. */
.qi-page-head {
  margin-bottom: 28px;
}

/* ------------------------------------------------------------ plan cards (pricing, from the homepage's inline rules) */

.qi ul.qi-plan-features { margin-block: 16px; }
.qi .qi-plan-cta { margin-top: auto; display: grid; gap: 8px; }
.qi .qi-plan-cta .action-stack { display: grid; gap: 8px; width: 100%; }
.qi .qi-plan-cta .qi-btn { width: 100%; }
.qi .qi-plan-cta .action-error { font-size: 12px; line-height: 1.4; color: var(--qi-fault); }

/* CheckoutButton/PortalButton wrap their button in .action-stack outside a plan card too. */
.qi .action-stack { display: grid; gap: 8px; }
.qi .action-error { font-size: 12px; line-height: 1.4; color: var(--qi-fault); }

/* ------------------------------------------------------------ billing-interval toggle */

.qi .qi-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--qi-edge-strong);
  border-radius: 6px;
  background: var(--qi-raised);
}

.qi .qi-toggle button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--qi-label);
  cursor: pointer;
}

.qi .qi-toggle button.is-on {
  background: var(--qi-line);
  color: var(--qi-ink);
}

.qi-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

/* ------------------------------------------------------------ key-value rows (account) */

.qi .qi-kv {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
}

.qi .qi-kv li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 9px;
  border-top: 1px solid var(--qi-line);
  font-size: 13px;
  color: var(--qi-label);
}

.qi .qi-kv strong {
  font-weight: 600;
  color: var(--qi-ink);
  font-variant-numeric: tabular-nums;
}

.qi .qi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.qi-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .qi-grid--2 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ narrow card (thanks, auth fallback) */

.qi-card--narrow {
  max-width: 560px;
  margin-inline: auto;
  padding: 28px;
}

.qi code {
  font-family: var(--qi-mono);
  font-size: 0.92em;
  color: var(--qi-ink);
}

/* ------------------------------------------------------------ auth (Clerk island) */

.qi-auth {
  display: grid;
  justify-items: center;
  padding-block: 24px;
}
