/* ============ LINK-DEVICE PAGE ============ */
/* Single-page device-approval flow. Layered on top of account.css —
   only adds what the four states need (code panel + two-card stack +
   block buttons + helper links + the "linked" success state).
   IBM Plex stays. */

.link-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: 560px;
  margin: 0 auto;
}

/* ─── Prominent device-code panel ─── */
.link-code-panel {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.link-code {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 24px;
  min-width: 220px;
  user-select: all;            /* whole code is selectable in one click */
  -webkit-user-select: all;
}
.link-code-caption {
  margin: 0;
}

/* ─── Each state card (authed / guest / forgot / linked) ─── */
.link-card {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  gap: 18px;
}
.link-card.is-hidden {
  display: none;
}

/* Bigger headline reuses .account-* typography — fall back here in
   case the page is loaded without account.css for some reason. */
.link-card h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}
.link-card h2 em {
  color: var(--amber);
  font-style: italic;
}

/* ─── Form rows ─── */
.account-form label > span {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
}

.form-row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: -6px 0 2px;
}

/* ─── Buttons ─── */
.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-link {
  background: transparent;
  border: 0;
  padding: 6px 0;
  font: inherit;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  text-align: left;
}
@media (hover: hover) {
  .btn-link:hover { color: var(--ink); }
}

.link-quiet {
  font-size: 13px;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (hover: hover) {
  .link-quiet:hover { color: var(--ink); }
}

/* ─── Status pill row (below the cards) ─── */
.link-status {
  display: flex;
  justify-content: center;
}

/* Status pill tones — match .account-status conventions */
.status-pill.is-error {
  background: rgba(196, 106, 44, 0.10);
  border-color: rgba(196, 106, 44, 0.40);
  color: var(--amber-deep, #8a4c1f);
}

/* ─── Success state ─── */
.account-kicker.is-success {
  color: var(--green, #2E8854);
}
.link-card[data-state="linked"] h2 em {
  color: var(--green, #2E8854);
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .link-shell { gap: 18px; }
  .link-code-panel,
  .link-card { padding: 22px; }
  .link-code { font-size: 30px; padding: 12px 18px; min-width: 0; }
  .link-card h2 { font-size: 26px; }
  .form-row-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
