/* Account pages (plan 48, Р7): sign in, sign up, "check your inbox", the code step, the account itself and the
   app consent screen. Engine pages in the Powerful Matter theme — site/theme/templates/account.html, cabinet.html,
   consent.html. Built from the form and button primitives (components/form.css, button.css) and theme roles only,
   so light and dark follow the site; loaded on these pages alone (partials/pm-styles.html), not via main.css. */

.page-account {
  padding-top: clamp(112px, 18vh, 200px);
  padding-bottom: var(--sp-section);
}

/* The scripts show and hide blocks with the hidden attribute; layout rules below must not bring them back. */
.page-account [hidden] { display: none !important; }

.page-account__head {
  max-width: 720px;
  margin-bottom: var(--sp-7);
}

.page-account__eyebrow {
  font-size: var(--fs-100);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--c-accent-2);
  font-weight: 500;
  margin-bottom: var(--sp-3);
}

.page-account h1 {
  font-size: var(--fs-800);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
  text-wrap: balance;
}

.page-account__lead {
  margin-top: var(--sp-4);
  max-width: 56ch;
  font-size: var(--fs-400);
  line-height: var(--lh-snug);
  color: var(--c-text-2);
  text-wrap: pretty;
}

/* the greeting is a name or an address: long ones wrap instead of pushing the page sideways */
.page-account__hello { overflow-wrap: anywhere; }

.page-account__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: start;
}

/* the form card — the contact card's surface, without its glow: these are working screens */
.account-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  padding: clamp(var(--sp-5), 4vw, var(--sp-7));
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  min-width: 0;
}
.account-card.form { gap: var(--sp-4); }

.account-card__title {
  font-size: var(--fs-600);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
}

.account-card__lead {
  font-size: var(--fs-400);
  line-height: var(--lh-snug);
  color: var(--c-text-1);
  overflow-wrap: anywhere;
}

.account-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.account-card__clear { margin-inline-start: auto; padding: 12px; }
.account-card__clear svg {
  width: var(--icon-md);
  height: var(--icon-md);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-card__alt {
  font-size: var(--fs-200);
  color: var(--c-muted);
}

.page-account a:not(.btn) {
  color: var(--c-accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
@media (hover: hover) and (pointer: fine) { .page-account a:not(.btn):hover { color: var(--c-accent-2); } }

.page-account__side {
  padding-top: var(--sp-2);
  display: grid;
  gap: var(--sp-3);
  color: var(--c-text-3);
  font-size: var(--fs-300);
  line-height: var(--lh-loose);
}
.page-account__side h2 {
  font-size: var(--fs-500);
  letter-spacing: var(--ls-display);
  color: var(--c-text);
}

/* notes and refusals: a ruled line, not a coloured box */
.account-note {
  padding: var(--sp-3) var(--sp-4);
  border-inline-start: 2px solid var(--c-mark);
  background: var(--c-raise);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--fs-200);
  line-height: var(--lh-snug);
  color: var(--c-text-1);
}
.account-note--error { border-color: var(--c-error); }
.page-account__head + .account-note { max-width: 720px; margin-bottom: var(--sp-6); }

/* the honeypot field stays in the form for robots and out of sight for people */
.account-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-account select.form__input {
  appearance: none;
  cursor: pointer;
  padding-inline-end: 24px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.page-account select.form__input option { color: var(--c-text); background: var(--c-surface); }

.page-account .form__check { align-items: flex-start; line-height: var(--lh-snug); }
.page-account .form__check input { flex: none; margin-top: 2px; }

/* the account itself: one column of groups */
.account-groups {
  display: grid;
  gap: var(--sp-5);
  max-width: 820px;
}

.account-group {
  display: grid;
  gap: var(--sp-4);
  padding: clamp(var(--sp-5), 4vw, var(--sp-6));
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  min-width: 0;
}

.account-group__title {
  font-size: var(--fs-600);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-tight);
}

.account-group__lead {
  color: var(--c-text-3);
  font-size: var(--fs-300);
  line-height: var(--lh-snug);
  max-width: 60ch;
}

.account-group__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.account-group__foot--end { justify-content: flex-start; }
.account-group__foot form { display: contents; }

.account-email { color: var(--c-text-1); font-weight: 500; overflow-wrap: anywhere; }

.account-part {
  display: grid;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-raise-2);
}

.account-part__title {
  font-size: var(--fs-400);
  font-family: var(--ff-body);
  font-weight: 500;
  color: var(--c-text);
}

.account-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
}

.account-setup { display: grid; gap: var(--sp-3); }

/* the QR code stays dark on white in both themes: phone cameras read it that way round */
.account-qr svg {
  display: block;
  width: min(220px, 100%);
  height: auto;
  padding: 12px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
}

.account-key,
.account-codes__list {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.account-key { color: var(--c-text-1); }

.account-codes { display: grid; gap: var(--sp-3); }
.account-codes__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9em, 1fr));
  gap: 6px var(--sp-5);
  margin: 0;
  padding-inline-start: 1.5em;
  color: var(--c-text-1);
}

/* lists the scripts fill: access, apps, devices */
.page-account .cab-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.page-account .cab-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px var(--sp-3);
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--c-raise-2);
  min-width: 0;
}
.page-account .cab-list > li:last-child { border-bottom: 0; }
.page-account .cab-list b { font-weight: 500; color: var(--c-text); overflow-wrap: anywhere; min-width: 0; }
.page-account .cab-list form { margin-inline-start: auto; }
.page-account .cab-list .btn { padding: 8px 16px; font-size: var(--fs-200); }
.page-account .xs { font-size: var(--fs-200); }
.page-account .muted { color: var(--c-muted); }
.page-account .cab-warn { color: var(--c-error); font-size: var(--fs-200); }

@media (max-width: 880px) {
  .page-account__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .account-split { grid-template-columns: 1fr; }
  /* две формы второго шага одна под другой: у каждой своё поле «Code» — линия между ними */
  .account-split > form + form { border-top: 1px solid var(--c-raise-2); padding-top: var(--sp-4); }
}

@media (max-width: 480px) {
  .account-card__actions .btn:not(.account-card__clear) { flex: 1 1 auto; }
  .account-group__foot .btn { flex: 1 1 auto; }
}

/* a phone at 200 % zoom is about 195 CSS px wide: the card gives its padding to the content and each button takes a
   whole line, instead of wrapping its label over three */
@media (max-width: 360px) {
  .account-card,
  .account-group { padding: var(--sp-4); border-radius: var(--radius-md); }
  .account-card__actions .btn:not(.account-card__clear),
  .account-group__foot .btn { flex-basis: 100%; padding-inline: 16px; }
}
