/* Guided-flow redesign for account.html — layered ON TOP of platform.css tokens. */

/* ===== Flow shell ===== */
#account.dashboard {
  display: block;
  padding: 0;
}

.flow-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 0 90px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
}

.flow-rail {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 2px;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.flow-rail-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.flow-step-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.flow-step-link:hover { color: var(--ink); background: var(--surface-soft); }

.flow-step-link.current {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(242, 102, 28, 0.35);
}

.flow-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
}

.flow-step-link.current .flow-step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1505;
}

.flow-step-link.done .flow-step-num {
  background: rgba(127, 174, 143, 0.2);
  border-color: rgba(127, 174, 143, 0.5);
  color: #9fd0b4;
}

.flow-identity {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.flow-identity strong { color: var(--ink); display: block; overflow-wrap: anywhere; }

.flow-rail .signout-row { margin-top: 12px; }

/* ===== Steps ===== */
.flow-step {
  padding: 36px 0 8px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.flow-step:first-of-type { border-top: 0; padding-top: 0; }

.flow-step-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.flow-step-head .step-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.flow-step-head h2 { margin: 0; font-size: 24px; }

.flow-step-lede {
  margin: 4px 0 22px;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 62ch;
}

/* ===== Top status strip ===== */
.flow-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 26px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13.5px;
}

.flow-status .fs-item { color: var(--muted); }
.flow-status .fs-item strong { color: var(--ink); margin-left: 6px; }

/* ===== Metric cards (kept, tightened) ===== */
.flow-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; }

.flow-metric {
  min-width: 0;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.flow-metric .metric-value { font-size: clamp(21px, 2.6vw, 27px); font-weight: 820; line-height: 1.15; overflow-wrap: anywhere; }

/* ===== Model hero cards ===== */
.model-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.model-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 150ms ease, transform 150ms ease;
}

.model-card:hover { border-color: rgba(242, 102, 28, 0.5); transform: translateY(-1px); }

.model-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.model-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7ecf9b;
}

.model-live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #7ecf9b;
  box-shadow: 0 0 8px rgba(126, 207, 155, 0.8);
}

.model-owned {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.model-slug {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  text-align: left;
  font-family: var(--mono);
}

.model-slug:hover { color: var(--accent-strong); }

.model-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}

.model-card-actions { display: flex; gap: 8px; }

.model-card-actions .ghost-btn {
  flex: 1;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.model-card-actions .ghost-btn:hover { border-color: var(--accent); color: var(--accent-strong); }

.models-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12.5px;
}

/* Model brand logo & badges */
.model-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.model-brand-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: none;
}

.model-brand-logo.logo-monochrome {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.model-brand-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Real-time sync badge */
.live-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #7fae8f;
  background: rgba(127, 174, 143, 0.12);
  border: 1px solid rgba(127, 174, 143, 0.28);
  border-radius: 999px;
  padding: 3px 9px;
}

.live-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7fae8f;
  box-shadow: 0 0 8px #7fae8f;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Key Management Section */
.keys-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.keys-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.keys-title {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
}

.key-reveal-box {
  background: rgba(242, 102, 28, 0.08);
  border: 1px solid rgba(242, 102, 28, 0.35);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}

.key-reveal-input-wrap {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.key-reveal-input {
  font-family: var(--mono);
  font-size: 13.5px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 6px;
  flex: 1;
}

.keys-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.keys-table th {
  padding: 10px 14px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}

.keys-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.keys-table tr:last-child td {
  border-bottom: 0;
}

.key-status-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.key-status-pill.active {
  background: rgba(127, 174, 143, 0.15);
  color: #9fd0b4;
  border: 1px solid rgba(127, 174, 143, 0.3);
}

.key-status-pill.revoked {
  background: rgba(220, 53, 69, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.btn-revoke {
  background: transparent;
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: #f87171;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-revoke:hover {
  background: rgba(220, 53, 69, 0.2);
  border-color: #f87171;
}

.btn-revoke:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Step cta row ===== */
.step-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.ghost-btn.primary-ghost { border-color: rgba(242,102,28,.45); color: var(--accent-strong); }

/* Responsive */
@media (max-width: 900px) {
  .flow-shell { grid-template-columns: 1fr; padding-top: 20px; }
  .flow-rail { position: static; }
  .flow-grid-3 { grid-template-columns: 1fr; }
}

/* ===== Gentle entrance animations (human-paced, not flashy) ===== */
@keyframes flowRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.flow-step > *, .flow-status, .auth-card > *, .auth-copy > * {
  animation: flowRise 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.flow-step > *:nth-child(2) { animation-delay: 60ms; }
.flow-step > *:nth-child(3) { animation-delay: 120ms; }
.flow-step > *:nth-child(4) { animation-delay: 180ms; }

.model-card {
  animation: flowRise 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.model-card:nth-child(2) { animation-delay: 50ms; }
.model-card:nth-child(3) { animation-delay: 100ms; }
.model-card:nth-child(4) { animation-delay: 150ms; }

/* Live-state micro-feedback: status strip breathes once */
@keyframes flowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 102, 28, 0); }
  50% { box-shadow: 0 0 0 4px rgba(242, 102, 28, 0.12); }
}

.flow-status { animation: flowRise 0.5s both, flowPulse 1.6s ease 0.6s 1; }

/* Copy affordance: slug glows when copied */
.model-slug { transition: color 140ms ease, text-shadow 140ms ease; }
.model-slug:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .flow-step > *, .flow-status, .auth-card > *, .auth-copy > *, .model-card {
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
