/* Composer Assistant — the account pages. 1 Oct 2026 (Fede, session ACCOUNT).
   ---------------------------------------------------------------------------
   Sign in (/login), check your email, signed in / download (/login/done) and
   plugin sign-in (/plugin-auth, "Plugin signed in"). They read like the public
   site's home: the same tight Bricolage headline, Plex Sans for sentences,
   Plex Mono only for the email address, the version and the step numbers, one
   column with one width for every field and button.

   ⚠️ ITS OWN FILE, LOADED ONLY BY THOSE FOUR TEMPLATES ({% block head %}), AND
   THAT IS THE WHOLE SAFETY OF IT. main.css is shared with the checkout, the
   receipt, the upsell, /plans and the site, and stays byte-for-byte Marc's: the
   page that takes money cannot move because of anything written here.
   scripts/test_theme_system.py [11d] holds this file to main.css's own
   discipline — no raw colour, every token defined in tokens.css, no selector
   declared twice, no selector main.css owns redeclared here, no accent fill
   used as a text colour — and proves the checkout never loads it.

   ⚠️ LOADED AFTER main.css (base.html's head block follows its links), so
   `.account` beats `.page__body` on order alone; everything else here is
   scoped two classes deep (`.account .x`) or uses account-only names.

   ⚠️ THE DOWNLOAD'S `class="download"` WRAPPER IS MARC'S HOOK, NOT OURS. His
   tests look for exactly that class (test_downloads §11, test_theme_system
   §11c), so it stays as a bare wrapper and his two rules still match it —
   `.download { margin: 0 0 2.5rem }` collapses with the steps section's own
   2.5rem, and `.download .buy { margin-top: 0 }` agrees with `.account .buy`.
   Every style of ours goes on account-download* names below.
   --------------------------------------------------------------------------- */

.account {
  max-width: 36rem;
  padding: 3.5rem 1.5rem 4rem;
}

.account .eyebrow { margin-bottom: 1rem; }

.account .page__title {
  font-size: clamp(2.25rem, 5.5vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -.045em;
  margin: 0 0 .9rem;
  text-wrap: balance;
}

/* A sentence under the headline reads in the reading voice; mono is for the
   email address (page__summary--email below), as it is for every number. */
.account .page__summary {
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 2.25rem;
}

.account .page__summary--email {
  font-family: var(--data);
  font-size: .95rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

/* One width for every field and button in the column. .buy--fit's 22rem cap
   is for the pages that set a lone button under prose; here the column is the
   measure. */
.account .buy {
  width: 100%;
  max-width: none;
  margin-top: 0;
  padding: 1.05rem 1.3rem;
  border-radius: 10px;
  font-size: 1rem;
}

.account .field { margin-bottom: 1.4rem; }

.account .field__label {
  font-size: .9rem;
  margin-bottom: .5rem;
}

.account .field__input {
  padding: .95rem 1rem;
  border-radius: 10px;
}

.account .field__help {
  margin-top: .6rem;
  font-size: .85rem;
  line-height: 1.5;
}

/* Calm, not alarmed: a panel of the page's own tone. Only a refusal keeps a
   coloured edge. */
.account .notice {
  background: var(--bg-panel);
  border: 0;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1.75rem;
  font-size: .93rem;
}

.account .notice--bad { border-left: 3px solid var(--danger); }

/* /plugin-auth signed out ends its form on a button, then the "keep the plugin
   open" note — without this the two touch. */
.account form + .notice { margin-top: 1.75rem; }

/* Since #492 (5 Oct 2026) the CC door follows the email form, so the same note
   can come after the door instead — the same gap, the same reason. */
.account .account__door + .notice { margin-top: 1.75rem; }

/* The two doors of /login and /plugin-auth: either one signs you in. */
.account__or {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
  font-family: var(--data);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account__or::before,
.account__or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-subtle);
}

/* "Check your email": the address and what happens next, in one card. */
.account__card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.5rem;
  margin: 0 0 1.75rem;
}

.account__card .page__summary--email { margin: 0 0 .75rem; }

.account__card-text {
  margin: 0;
  font-size: .95rem;
  color: var(--text-muted);
}

.account__card-text strong { color: var(--text-primary); font-weight: 500; }

/* A way back that is findable, never loud — .skip's treatment. */
.account__link {
  display: inline-block;
  font-size: .93rem;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}

.account__link:hover { text-decoration-color: currentColor; }

/* Who is signed in, and Sign out beside it. ⚠️ Sign out is a POST form styled
   as a quiet link: it used to carry the same weight as Download. */
.account__who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem 1.25rem;
  margin: 0 0 2.25rem;
}

.account__who .page__summary { margin: 0; }

.account__signout { margin: 0; }

.account__signout-button {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--body);
  font-size: .9rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.account__signout-button:hover { color: var(--text-primary); }

/* The plan rows: the same facts, the reading voice for the labels. */
.account .receipt {
  padding: .4rem 1.5rem;
  margin: 0 0 2rem;
}

.account .receipt__row {
  padding: .9rem 0;
  font-family: var(--body);
  font-size: .93rem;
}

/* "Plugin signed in" opens on the receipt's mark — the one result here. */
.account .done__mark {
  width: 56px;
  height: 56px;
  margin: 0 0 1.75rem;
  box-shadow: 0 0 24px var(--accent-glow);
}

.account .done__mark svg { width: 28px; height: 28px; }

/* Plugin sign-in, three steps (templates/_plugin_steps.html). Numbered because
   it IS a sequence: the plugin sent them here, they sign in here, the plugin
   signs itself in. */
.account-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  counter-reset: account-step;
}

.account-steps__item {
  position: relative;
  counter-increment: account-step;
  padding-top: 2.2rem;
  font-size: .85rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.account-steps__item::before {
  content: counter(account-step);
  position: absolute;
  top: 0;
  left: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-base);
  font-family: var(--data);
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* The thread from one step to the next. */
.account-steps__item::after {
  content: "";
  position: absolute;
  top: .8rem;
  left: 2.1rem;
  right: .4rem;
  height: 1px;
  background: var(--border-subtle);
}

.account-steps__item:last-child::after { content: none; }

.account-steps__item--done::before {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.account-steps__item--now {
  color: var(--text-primary);
  font-weight: 500;
}

.account-steps__item--now::before {
  border: 2px solid var(--accent-text);
  color: var(--text-primary);
}

/* ── The download (templates/login_done.html) ─────────────────────────────────
   The page's hero: a card whose top line is set like the plugin's own header
   rail ("COMPOSER ASSISTANT 1.0.11", spaced mono caps) beside "What's new in
   1.0.11"; the detected platform's button; the OTHER platform as a real
   (quiet) button; then "After you download", three steps quoted from the
   manual. Still ONE button component — both buttons are .buy, the page picks
   the accent. The closed state gets no decoration: it shows no card. */

.account-download {
  margin: 0 0 2.75rem;
  padding: 1.4rem 1.5rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* After `.account .buy` (margin-top: 0), and the same two classes deep, so the
   second button keeps its gap. */
.account-download .account-download__other { margin-top: .75rem; }

.account-download__rail {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem 1rem;
  margin: 0 0 1.25rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.account-download__product {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.account-download__whatsnew {
  font-size: .88rem;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.account-download__whatsnew:hover { color: var(--text-primary); }

/* After you download — a real sequence, so it is numbered. Its 2.5rem bottom
   margin collapses with the `.download` wrapper's own (Marc's) 2.5rem. */
.account-download__next { margin: 0 0 2.5rem; }

.account-download__next-title {
  margin: 0 0 .25rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -.015em;
}

.account-download__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: account-download-step;
}

.account-download__step {
  position: relative;
  counter-increment: account-download-step;
  padding: 1.1rem 0 1.1rem 2.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.account-download__step:last-child { border-bottom: 0; }

.account-download__step::before {
  content: counter(account-download-step);
  position: absolute;
  top: 1.05rem;
  left: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  font-family: var(--data);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.account-download__step-title {
  margin: 0 0 .25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.account-download__step-text {
  margin: 0 0 .4rem;
  font-size: .93rem;
  color: var(--text-muted);
}

.account-download__step-text strong { color: var(--text-primary); font-weight: 500; }

.account-download__step-link {
  font-size: .85rem;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.account-download__step-link:hover { color: var(--text-primary); }

/* templates/_account_help.html — the way out to the rest of the product, at
   the foot of every account page. In the page, never in the shared chrome. */
.account-help {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1.4rem;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: .92rem;
}

.account-help__label {
  font-family: var(--data);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.account-help__link {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
}

.account-help__link:hover { text-decoration-color: currentColor; }

/* ── Small screens ────────────────────────────────────────────────────────────
   The plan rows stack exactly as the receipt's do (main.css, same 40rem), for
   the same reason — "Included — no monthly limit" cannot share a line with its
   label at 390px without folding into a narrow column. */
@media (max-width: 40rem) {
  .account { padding: 2.25rem 1.5rem 3rem; }

  .account .receipt { padding: .3rem 1.15rem; }

  .account .receipt__row { display: block; }

  .account .receipt__value {
    display: block;
    text-align: left;
    margin-top: .15rem;
  }

  .account-download { padding: 1.15rem 1.15rem 1.25rem; }

  .account-steps__item { font-size: .8rem; }
}
