/* Accounts (public mode only): sign up, sign in, two-step sign-in, account page. The My Assets look: the same teal, cards,
   fonts and corners (my-assets.css), nothing new beyond the form parts. Linked only by research/pages/account.py. */
body:has(.acct) { background: color-mix(in srgb, var(--inset) 72%, var(--panel)); }

.acct {
  --acct-teal: #007b71;
  --acct-mint: color-mix(in srgb, var(--brand, #007b71) 11%, var(--panel));
  --acct-shadow: 0 3px 14px #152e4508;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 0 64px;
  color: var(--ink);
}

.acct-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 32px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--acct-shadow);
}
.acct-card.wide { max-width: 560px; }

.acct-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--acct-mint);
  color: var(--brand, #007b71);
}

.acct h1 {
  font-family: var(--f-brand);
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.15;
  margin: 0 0 8px;
}

.acct-intro { margin: 0 0 22px; color: var(--muted); font-size: 16px; }

.acct-form { display: grid; gap: 16px; margin: 0; }

.acct-field { display: grid; gap: 6px; }
.acct-field > span { font-size: 15px; font-weight: 600; color: var(--ink); }
.acct-field small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.acct .input { height: 48px; font-size: 16px; border-color: var(--line-strong); }
.acct .input:focus-visible,
.acct :is(a, button, summary, input[type=checkbox]):focus-visible { outline: 2px solid var(--brand, #007b71); outline-offset: 2px; }
.acct .input[name=code] { font-family: var(--f-mono); font-size: 20px; letter-spacing: .18em; }

.acct-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--ink); }
.acct-check input { width: 20px; height: 20px; accent-color: var(--acct-teal); }

.acct .btn.primary {
  background: var(--acct-teal);
  border-color: var(--acct-teal);
  color: #fff;
}
.acct .btn.primary:hover { background: #00665e; border-color: #00665e; }
.acct-go { width: 100%; min-height: 48px; font-size: 16px; }
.acct .btn:disabled, .acct .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
.acct-card > .acct-go { margin-top: 6px; }

.acct-forgot { justify-self: center; font-size: 15px; color: var(--accent-strong); }
.acct-alt { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.acct-alt a, .acct-small a, .acct-more a { color: var(--accent-strong); font-weight: 600; }
.acct-small { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.acct-error, .acct-ok {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.45;
}
.acct-error { background: var(--error-soft); color: var(--error); border: 1px solid color-mix(in srgb, var(--error) 30%, transparent); }
.acct-ok { background: var(--acct-mint); color: var(--ink); border: 1px solid color-mix(in srgb, var(--brand, #007b71) 30%, transparent); }
.acct-error svg, .acct-ok svg { flex: none; margin-top: 2px; }
.acct-ok svg { color: var(--brand, #007b71); }

/* two-step setup */
.acct-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 14px; }
.acct-steps li {
  counter-increment: s;
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 14px 14px 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 68%, var(--inset));
}
.acct-steps li::before {
  content: counter(s);
  position: absolute;
  left: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--acct-teal);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.acct-steps b { font-size: 16px; }
.acct-steps span { color: var(--muted); font-size: 15px; line-height: 1.5; }
.acct-key {
  display: block;
  margin: 4px 0 2px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  font: 600 18px/1.4 var(--f-mono);
  letter-spacing: .06em;
  color: var(--ink);
  word-break: break-word;
  user-select: all;
}
.acct-more { margin-top: 18px; font-size: 14px; color: var(--muted); }
.acct-more summary { cursor: pointer; font-weight: 600; color: var(--accent-strong); min-height: 44px; display: flex; align-items: center; gap: 8px; }
.acct-more summary::before { content: ""; width: 0; height: 0; border-left: 6px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform .15s; }
.acct-more[open] summary::before { transform: rotate(90deg); }
.acct-link { display: block; font: 13px/1.5 var(--f-mono); word-break: break-all; user-select: all; color: var(--ink); }

/* backup codes */
.acct-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 68%, var(--inset));
  list-style-position: inside;
  font-variant-numeric: tabular-nums;
}
.acct-codes code { font: 600 16px/1.6 var(--f-mono); letter-spacing: .04em; user-select: all; }

/* account page */
.acct-head { max-width: 620px; margin: 0 auto 24px; text-align: center; }
.acct-head p { margin: 0; color: var(--muted); font-size: 16px; }
.acct > .acct-ok { max-width: 620px; margin: 0 auto 18px; }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.acct-block {
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--acct-shadow);
}
.acct-block h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font-size: 18px; }
.acct-block h2 svg { color: var(--brand, #007b71); }
.acct-block > p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.acct-block .acct-go { width: auto; justify-self: start; padding: 0 20px; }
.acct-block.danger h2 svg { color: var(--error); }
.acct-block.danger .btn.primary { background: var(--error); border-color: var(--error); }
.acct-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 16px; }
.acct-dl dt { color: var(--muted); }
.acct-dl dd { margin: 0; font-weight: 600; word-break: break-word; }

/* signed-out My Assets */
.acct-gate .assets-empty { border-top: 0; padding: 44px 20px; }
.acct-gate h3 { max-width: 440px; margin-left: auto !important; margin-right: auto !important; }
.acct-gate-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 6px; }
.acct-gate-btns .btn.primary { background: #007b71; border-color: #007b71; color: #fff; }
.acct-gate-btns .btn { min-height: 44px; font-size: 15px; padding: 0 18px; }
.acct-gate .acct-small { margin-top: 20px; }

/* top bar: "Sign in", or the account menu */
.acct-in {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  margin-left: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill, 999px);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.acct-in:hover { background: var(--hover); }
.acct-menu { position: relative; margin-left: 6px; }
.acct-menu > summary { gap: 8px !important; }
.acct-dot {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #007b71;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.acct-name { font-weight: 600; color: var(--ink); }
.acct-menu .acct-panel { position: absolute; left: auto; right: 0; top: calc(100% + 6px); width: 280px; max-width: calc(100vw - 24px); padding: 8px; z-index: 60; display: grid; grid-template-columns: 1fr; gap: 2px; }
.acct-panel a, .acct-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.acct-panel a:hover, .acct-panel button:hover { background: var(--hover); }
.acct-panel form { margin: 0; }
.acct-who { display: grid; gap: 2px; margin: 4px 12px 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.acct-who small { color: var(--muted); font-size: 13px; word-break: break-all; }

@media (max-width: 900px) {
  .acct-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .acct { padding: 16px 12px 40px; }
  .acct-card { padding: 24px 18px 22px; border-radius: 14px; }
  .acct-name { display: none; }
  .acct-phone-only { display: block !important; }
  .acct-open { display: inline-flex !important; width: 100%; }
  .acct-qr { width: min(200px, 100%); }
  .acct-menu .acct-panel { position: fixed; top: 64px; right: 12px; left: auto; }
  .acct-in { padding: 0 12px; min-height: 40px; }
  .acct-in svg { display: none; }
  .acct-codes { grid-template-columns: minmax(0, 1fr); }
  .acct-block { padding: 18px 16px; }
  .acct-block .acct-go { width: 100%; }
}

/* progress: 1 Your details -> 2 Set up your phone -> 3 Save backup codes */
.acct-progress { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 22px; }
.acct-progress li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 3px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}
.acct-progress li.done, .acct-progress li.now { border-top-color: var(--acct-teal); color: var(--ink); }
.acct-step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--inset);
  color: var(--muted);
  font-size: 12px;
}
.acct-progress li.now .acct-step-n, .acct-progress li.done .acct-step-n { background: var(--acct-teal); color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* fields: show/hide, strength, messages */
.acct-field > label { font-size: 15px; font-weight: 600; color: var(--ink); }
.acct-input { position: relative; }
.acct-has-eye .input { padding-right: 76px; }
.acct-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 36px;
  min-width: 60px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--inset);
  color: var(--ink);
  font: 600 14px var(--f-body);
  cursor: pointer;
}
.acct-meter { display: flex; gap: 4px; height: 5px; }
.acct-meter i { flex: 1; border-radius: 3px; background: var(--line); }
.acct-meter[data-level="1"] i:nth-child(1) { background: var(--error); }
.acct-meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.acct-meter[data-level="3"] i { background: var(--acct-teal); }
.acct-strength:empty, .acct-msg:empty { display: none; }
.acct-msg { color: var(--error) !important; font-weight: 600; }
.acct .input[aria-invalid=true] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }

/* the 6-digit code: one box per digit, drawn behind one real field (paste and the phone's code suggestion both work) */
.acct .input.acct-code {
  --box: 46px;
  --gap: 8px;
  width: calc(6 * (var(--box) + var(--gap)) + (var(--box) - 1ch) / 2);
  max-width: 100%;
  height: 58px;
  padding: 0 0 0 calc((var(--box) - 1ch) / 2);
  border: 0;
  border-radius: 10px;
  background: repeating-linear-gradient(90deg, var(--inset) 0 var(--box), transparent var(--box) calc(var(--box) + var(--gap)))
    0 0 / calc(6 * (var(--box) + var(--gap)) - var(--gap)) 100% no-repeat;
  box-shadow: none;
  color: var(--ink);
  font: 600 26px/58px var(--f-mono);
  letter-spacing: calc(var(--box) + var(--gap) - 1ch);
  caret-color: var(--acct-teal);
}
.acct .input.acct-code:focus-visible { outline: 2px solid var(--acct-teal); outline-offset: 4px; }
.acct .input.acct-code[aria-invalid=true] { box-shadow: none; outline: 2px solid var(--error); outline-offset: 4px; }

/* the QR code: big and centred; on a phone, the button that opens the authenticator app instead */
.acct-steps li.acct-scan { gap: 8px; }
.acct-qr { margin: 10px auto 4px; padding: 12px; width: min(260px, 100%); border-radius: 14px; background: #fff; border: 1px solid var(--line); box-sizing: border-box; }
.acct-qr svg { display: block; width: 100%; height: auto; }
.acct-open { justify-self: start; min-height: 48px; padding: 0 18px; background: #007b71 !important; border-color: #007b71 !important; color: #fff !important; }
.acct-phone-only, .acct-open { display: none !important; }
.acct-typed { display: grid; gap: 6px; margin-top: 4px; }
.acct-scan .acct-more { margin-top: 6px; }

/* backup codes buttons, the saved check */
.acct-code-btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 2px; }
.acct-code-btns .btn { min-height: 44px; }
.acct-saved { margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--acct-mint); }
.acct-center { text-align: center; }

/* account page extras */
.acct-block.wide { grid-column: 1 / -1; }
.acct-sub { margin: 16px 0 8px; font-size: 15px; }
.acct-badge-ok { display: inline-block; margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--acct-mint); font-weight: 600; font-size: 14px; }
.acct-warn { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-size: 15px; }
.acct-table-wrap { overflow-x: auto; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.acct-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.acct-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.acct-devices { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.acct-devices li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.acct-devices li span { display: grid; }
.acct-devices small { color: var(--muted); }
.acct-devices .acct-form .acct-go { width: auto; min-height: 40px; padding: 0 14px; background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.acct .btn.primary.danger { background: var(--error); border-color: var(--error); }

/* signed-out My Assets: what an account gives you; asset pages: the invitation */
.acct-perks { list-style: none; padding: 0; margin: 18px auto 0; display: grid; gap: 8px; max-width: 430px; text-align: left; font-size: 15px; color: var(--ink); }
.acct-perks li { position: relative; padding-left: 26px; }
.acct-perks li::before { content: "✓"; position: absolute; left: 0; color: var(--brand, #007b71); font-weight: 700; }
.acct-invite p { margin: 0 0 12px; font-size: 15px; }
.acct-invite .cx-btn.primary { background: #007b71; border-color: #007b71; color: #fff; }

@media (max-width: 600px) {
  .acct-progress li span:last-child:not(.sr) { font-size: 12px; }
  .acct .input.acct-code { --box: 42px; --gap: 7px; font-size: 24px; }
  .acct-table th:nth-child(3), .acct-table td:nth-child(3) { display: none; }
}

@media print {
  body * { visibility: hidden; }
  #acct-code-list, #acct-code-list * { visibility: visible; }
  #acct-code-list { position: absolute; left: 0; top: 0; border: 0; }
}
@media (pointer: coarse) {   /* any touch screen (a phone on its side too) gets the button to open the app */
  .acct-phone-only { display: block !important; }
  .acct-open { display: inline-flex !important; }
}
@media (max-width: 600px) {  /* a phone: it can't scan its own screen, so the button that opens the authenticator app */
  .acct-phone-only { display: block !important; }
  .acct-open { display: inline-flex !important; width: 100%; }
  .acct-qr { width: min(200px, 100%); }
}
