/* ============================================================================
   ACCOUNT PAGE + THE NIMBUS PRO WORDMARK
   ========================================================================== */

/* ---------------------------------------------------------------------------
   THE WORDMARK
   ----------------------------------------------------------------------------
   A gradient that cycles through the accent. It is the one piece of pure
   decoration in either product, so it has to earn its place and stay inside
   the design contract:

   - It is ONE accent, not a rainbow. Every stop is a step of --brand that
     already exists in tokens.css (300, 400, brand, 600, and the sky tints),
     so it reads as the Nimbus blue moving rather than as a second colour
     arriving. AGENTS.md section 4 rule 1 survives.
   - It animates `background-position`, not the gradient itself. Animating
     colour stops re-rasterises the gradient every frame on the main thread;
     sliding an oversized background is cheap and smooth.
   - 8 seconds, linear, infinite. Slow enough to read as a shimmer rather than
     a flash, and nothing in the page depends on where in the cycle it is.
   - It STOPS DEAD under prefers-reduced-motion, falling back to a static
     gradient. Rule 7: everything collapses. A looping animation behind text is
     exactly what that setting is for.
   - Fallback colour first, so a browser without background-clip: text shows
     solid brand rather than invisible text. That failure mode is total, so it
     is worth the two extra lines.
   ------------------------------------------------------------------------ */
.pro-word {
  /* Paint the text itself if the clip below is not supported. */
  color: var(--brand-text);

  background-image: linear-gradient(
    100deg,
    var(--brand-600) 0%,
    var(--brand) 18%,
    var(--brand-300) 34%,
    var(--sky-mid, var(--brand-200)) 46%,
    var(--brand-300) 58%,
    var(--brand) 76%,
    var(--brand-600) 100%
  );
  /* Wider than the text, which is what gives the slide somewhere to go. */
  background-size: 260% 100%;
  background-position: 0% 50%;

  -webkit-background-clip: text;
  background-clip: text;

  font-weight: 650;
  white-space: nowrap;
}

/* Only make the text transparent where the clip actually works, so the
   fallback colour above is never clipped away into nothing. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .pro-word {
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .pro-word { animation: pro-cycle 8s linear infinite; }
}

@keyframes pro-cycle {
  from { background-position: 0% 50%; }
  to   { background-position: 260% 50%; }
}

/* ---------------------------------------------------------------------------
   THE PAGE
   ------------------------------------------------------------------------ */
.account { max-width: 56ch; }

.account-sub {
  margin-top: var(--s-4);
  color: var(--body);
  line-height: 1.6;
}

.account-h2 { margin-top: var(--s-8); font: var(--t-title-lg); color: var(--ink); }

.account-list { margin-top: var(--s-4); }
.account-list li { margin-top: var(--s-3); line-height: 1.6; }
.account-list strong { color: var(--ink); }

.account-note {
  margin-top: var(--s-4);
  font: var(--t-body-sm);
  color: var(--muted);
  line-height: 1.6;
}

.account-flash {
  margin-bottom: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border-left: 3px solid var(--brand);
  background: var(--surface-2);
  color: var(--ink);
  font: var(--t-body-sm);
  line-height: 1.55;
}
.account-flash.is-ok   { border-left-color: var(--ok); }
.account-flash.is-err  { border-left-color: var(--err); }
.account-flash.is-warn { border-left-color: var(--warn); }

/* ------------------------------------------------------------- the form -- */
.account-tabs { margin-top: var(--s-6); }

.segmented {
  display: inline-flex;
  gap: 2px; padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--surface-2);
}
.segment {
  padding: 7px 18px;
  border: 0; border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font: var(--t-label);
  cursor: pointer;
}
.segment.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--e-1); }

.account-form { margin-top: var(--s-5); }

.field-label { display: block; margin-top: var(--s-4); font: var(--t-label); color: var(--ink); }
.field {
  width: 100%;
  margin-top: 5px;
  padding: 11px 13px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: var(--t-body-sm);
}
.field:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
.field-error { margin-top: var(--s-3); min-height: 1.2em; font: var(--t-caption); color: var(--err); }

.consent-block {
  display: flex; flex-direction: column; gap: var(--s-3);
  margin-top: var(--s-5);
  padding: var(--s-4);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.consent-check {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 10px; align-items: start;
  font: var(--t-body-sm); color: var(--ink); line-height: 1.5; cursor: pointer;
}
.consent-check input[type="checkbox"] {
  width: 17px; height: 17px; margin: 2px 0 0;
  accent-color: var(--brand); cursor: pointer;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font: var(--t-label);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-ghost { background: var(--surface); border-color: var(--hairline); color: var(--ink); }
.btn-block { width: 100%; margin-top: var(--s-5); }

/* ------------------------------------------------------------ the card -- */
.account-card {
  margin-top: var(--s-6);
  padding: var(--s-5);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--e-1);
}

.account-id { display: flex; align-items: center; gap: var(--s-4); }
.account-avatar {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  font: var(--t-title-md);
}
.account-name { font: var(--t-title-sm); color: var(--ink); }
.account-email { font: var(--t-body-sm); color: var(--muted); margin-top: 2px; }

.account-plan {
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--hairline);
}
.plan-badge {
  display: inline-block;
  padding: 4px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  color: var(--muted);
  font: var(--t-label);
}
.plan-badge.is-pro { border-color: var(--brand-300); background: var(--brand-50); }
.plan-detail { margin-top: var(--s-3); font: var(--t-body-sm); color: var(--body); line-height: 1.55; }

.account-actions { margin-top: var(--s-5); }

.account-foot {
  display: flex; gap: var(--s-5); flex-wrap: wrap;
  margin-top: var(--s-8); padding-top: var(--s-5);
  border-top: 1px solid var(--hairline);
}
.link-btn {
  padding: 0; border: 0; background: none;
  color: var(--muted); font: var(--t-body-sm);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover { color: var(--brand-text); }
