/* =============================================================================
   @elements/style — terminal

   Dark CLI command bar with a prompt glyph on the left, the command
   middle-flexing with ellipsis overflow, and a copy button on the right.

   Background is softened near-black (#1d1d22), NOT pure ink — this is what
   visually distinguishes a terminal block from an ink button.

   Usage:
     <div class="terminal">
       <span class="terminal-prompt">&gt;</span>
       <span class="terminal-cmd">elements license checkout lic_xxx</span>
       <button class="terminal-copy">
         <span class="terminal-copy-default">copy</span>
         <span class="terminal-copy-done">✓ copied</span>
       </button>
     </div>

   Add `.is-copied` to the copy button to flip into the confirmed state.
============================================================================= */

.terminal {
  background: var(--term-bg);
  color: var(--term-ink);
  padding: 0.875rem 1rem 0.875rem 1.125rem;    /* 14 16 14 18 */
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: text;
  margin-bottom: var(--space-2-5);
  overflow: hidden;        /* clip, don't scroll the whole box */
}

.terminal-prompt {
  color: var(--term-dim);
  flex-shrink: 0;
  user-select: none;
  font-weight: var(--font-regular);
}

.terminal-cmd {
  flex: 1;
  min-width: 0;            /* critical — lets flex child actually shrink/scroll */
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  user-select: text;
  -webkit-user-select: text;
  scrollbar-width: none;   /* Firefox */
}
.terminal-cmd::-webkit-scrollbar { display: none; width: 0; height: 0; }  /* Chrome/Safari */
.terminal-cmd::selection,
.terminal-cmd *::selection {
  background: #3a3a3a;
  color: inherit;
}

/* ─── Copy button inside a terminal bar ──────────────────────────── */

.terminal-copy {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: #d8d6d0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--font-medium);
  padding: 0.3125rem 0.6875rem;
  border-radius: var(--radius-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  flex-shrink: 0;
  transition:
    background var(--duration-slow) var(--ease-out),
    border-color var(--duration-slow) var(--ease-out),
    color var(--duration-slow) var(--ease-out);
  width: 6.5rem;          /* fixed width so `✓ copied` doesn't cause layout shift */
  text-align: center;
}

.terminal-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
}

.terminal-copy:focus-visible {
  outline: 2px solid var(--term-ink);
  outline-offset: 2px;
}

.terminal-copy-done { display: none; }
.terminal-copy.is-copied {
  background: #1f3a1c;
  color: var(--term-green);
  border-color: rgba(127, 168, 116, 0.3);
}
.terminal-copy.is-copied .terminal-copy-default { display: none; }
.terminal-copy.is-copied .terminal-copy-done    { display: inline; }

/* ─── Command label ───────────────────────────────────────────────
   Small prose-style caption that sits above a terminal block to
   describe what the command does. Used on /purchase/success and
   /account license management. */

.terminal-caption {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--ink-soft);
  margin: var(--space-4) 0 var(--space-2);
}

/* ─── Light token row ───────────────────────────────────────────────
   Inline label + mono value + copy button, on soft bg. Used for the
   license token on /purchase/success and /account. */

.token-row {
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3-5, 0.875rem);
  background: var(--bg-soft);
  margin-bottom: var(--space-3-5, 0.875rem);
}
.token-row-label {
  font-family: var(--font-mono);
  font-size: 0.78125rem;       /* 12.5px */
  color: var(--ink-soft);
  flex-shrink: 0;
}
.token-row-val {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
