/* /account (src/account/views.tsx, public/account-page.js). Only layout and the six code cells: everything else is the
   site's own (app.css: .btn, .input, .page-head, .skeleton, solid boxes like the watch page's .about-box). Ported from
   FashionTube's account.css (11-29), cut to what this page has. */
.acct-page {
  max-inline-size: 640px;
  --acct-danger: #c5221f;
}
@media (prefers-color-scheme: dark) {
  .acct-page {
    --acct-danger: #ff8a80;
  }
}
.acct-stack {
  display: grid;
  gap: 16px;
}
.acct-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-l);
  corner-shape: squircle;
  background: var(--bg-2);
}
.acct-card p {
  margin: 0;
  line-height: var(--lh-body);
}
.acct-card__h {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.acct-muted {
  color: var(--text-2);
}
.acct-muted:empty {
  display: none;
}
.acct-fine {
  font-size: 13px;
  color: var(--text-3);
}
.acct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.acct-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-inline-start: -8px;
}

/* the skeleton: the sign-in card's size while /api/me answers */
.acct-skel {
  min-block-size: 214px;
  align-content: start;
}
.acct-skel__h {
  inline-size: 60%;
  block-size: 20px;
}
.acct-skel__field {
  block-size: 40px;
  border-radius: calc(10px * var(--sq, 1));
}

/* sign-in */
.acct-signin__head {
  display: grid;
  gap: 6px;
}
.acct-signin__mark {
  display: inline-grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--text);
}
.acct-signin[data-step="code"] .acct-signin__how,
.acct-signin[data-step="link"] .acct-signin__how {
  display: none;
}
.acct-form {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.acct-field {
  display: grid;
  gap: 6px;
  inline-size: 100%;
  max-inline-size: 360px;
}
.acct-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.acct-input {
  inline-size: 100%;
  font-size: 16px; /* 16 px or more: iOS does not zoom into the field */
}
.acct-signin[data-error] .acct-input {
  box-shadow: 0 0 0 1.5px var(--acct-danger);
}
.acct-status:empty {
  display: none;
}
.acct-status[data-kind="error"] {
  color: var(--acct-danger);
}
.acct-ts:empty {
  display: none;
}

/* six cells, one input: the input lies over the cells, invisible but focused, so typing, pasting and the phone's
   suggested code all go into it; account-page.js draws its digits into the cells */
.otp {
  position: relative;
  display: block;
  inline-size: 100%;
  max-inline-size: 360px;
}
.otp__input {
  position: absolute;
  inset: 0;
  z-index: 1;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  letter-spacing: 1em;
  outline: none;
  -webkit-text-fill-color: transparent;
}
.otp__input::selection {
  background: transparent;
}
.otp__cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.otp__cell {
  position: relative;
  display: grid;
  place-items: center;
  block-size: 52px;
  border-radius: calc(12px * var(--sq, 1));
  corner-shape: squircle;
  background: var(--fill);
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: box-shadow var(--dur-press), background-color var(--dur-press);
}
.otp:focus-within .otp__cell.is-next {
  box-shadow: 0 0 0 2px var(--focus);
  background: var(--bg);
}
.otp:focus-within .otp__cell.is-next:empty::after {
  content: "";
  inline-size: 2px;
  block-size: 24px;
  border-radius: 1px;
  background: var(--text);
  animation: acct-caret 1s steps(1) infinite;
}
.otp__cell.is-full {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--separator);
}
.acct-signin[data-error] .otp__cell {
  box-shadow: inset 0 0 0 1.5px var(--acct-danger);
}
.acct-signin[data-error="shake"] .otp__cells {
  animation: acct-shake 320ms var(--ease-out);
}
@keyframes acct-caret {
  50% {
    opacity: 0;
  }
}
@keyframes acct-shake {
  20% {
    transform: translateX(-6px);
  }
  45% {
    transform: translateX(5px);
  }
  70% {
    transform: translateX(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .otp:focus-within .otp__cell.is-next:empty::after,
  .acct-signin[data-error="shake"] .otp__cells {
    animation: none;
  }
}

/* signed in */
.acct-who__row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.acct-avatar {
  inline-size: 44px;
  block-size: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 18px;
  font-weight: 600;
}
.acct-who__text {
  min-inline-size: 0;
}
.acct-email {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.acct-confirm {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  corner-shape: squircle;
  background: var(--bg);
}
.acct-danger-zone {
  display: grid;
  gap: 8px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--separator);
}
.acct-danger {
  color: var(--acct-danger);
}
.acct-danger--solid,
.acct-danger--solid:hover {
  background: var(--acct-danger);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .acct-danger--solid,
  .acct-danger--solid:hover {
    color: #1a1a1a;
  }
}
