/* Account pages. Colours, type sizes and spacing come from the brand
   variables (packages/design, served as brand-tokens.css); phone rules as in
   packages/design/README.md: 16px inputs, 44px tap targets, safe areas. */
@font-face {
  font-family: Outfit;
  src: url('/assets/Outfit-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--pj-paper);
  color: var(--pj-ink);
  font: 400 var(--pj-fs-body) / 1.6 var(--pj-sans);
}
html[lang='zh-CN'] body {
  line-height: 1.75;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--pj-blue);
  outline-offset: 2px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pj-space-4) var(--pj-gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--pj-space-2);
  min-height: var(--pj-tap);
  font-size: 20px;
  font-weight: 500;
  text-decoration: none;
}
.language {
  display: inline-flex;
  align-items: center;
  min-height: var(--pj-tap);
  padding: 0 var(--pj-space-3);
  color: var(--pj-muted);
  text-decoration: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--pj-space-4);
  width: min(100% - 2 * var(--pj-gutter), 440px);
  margin: var(--pj-space-6) auto;
  padding: var(--pj-space-6);
  background: var(--pj-surface);
  border: 1px solid var(--pj-line);
  border-radius: 20px;
}
h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.25;
}
h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}
.intro,
.note,
section p,
dialog p {
  margin: 0;
  color: var(--pj-muted);
}
form,
section {
  display: flex;
  flex-direction: column;
  gap: var(--pj-space-3);
}
section {
  padding-top: var(--pj-space-4);
  border-top: 1px solid var(--pj-line);
}
label {
  font-weight: 500;
}
input[type='email'],
input[inputmode='numeric'] {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--pj-space-4);
  border: 1px solid var(--pj-line);
  border-radius: 12px;
  background: var(--pj-paper);
  color: var(--pj-ink);
  font: inherit;
  font-size: 16px;
}
#code {
  font-size: 24px;
  letter-spacing: 0.4em;
}
.check,
.switch {
  display: flex;
  gap: var(--pj-space-3);
  align-items: flex-start;
  min-height: var(--pj-tap);
  font-weight: 400;
  color: var(--pj-muted);
}
.check {
  font-size: var(--pj-fs-meta);
}
.check input,
.switch input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--pj-blue);
}
.switch strong {
  display: block;
  color: var(--pj-ink);
  font-weight: 500;
}

.primary,
.secondary,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--pj-space-5);
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.primary {
  background: var(--pj-ink);
  color: var(--pj-paper);
}
.secondary {
  background: transparent;
  border-color: var(--pj-line);
  color: var(--pj-ink);
}
.danger-button {
  background: transparent;
  border-color: #6b2f2f;
  color: #ff8a80;
}
button:disabled {
  opacity: 0.6;
  cursor: default;
}
.text {
  min-height: var(--pj-tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--pj-muted);
  font: inherit;
  font-size: var(--pj-fs-meta);
  text-decoration: underline;
  cursor: pointer;
}
.text:disabled {
  text-decoration: none;
}
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--pj-space-3);
}
.error {
  margin: 0;
  color: #ff8a80;
  font-size: var(--pj-fs-meta);
}
.saved {
  color: #7ddc9a;
}
.banner {
  display: flex;
  flex-direction: column;
  gap: var(--pj-space-3);
  padding: var(--pj-space-4);
  border-radius: 12px;
  background: var(--pj-tint);
}
.banner p {
  margin: 0;
}
.captcha {
  min-height: 65px;
}
/* The Turnstile widget is 300px wide: on the narrowest phones the card gives
   up some padding so it still fits. */
@media (max-width: 400px) {
  .card {
    padding: var(--pj-space-4);
  }
}

dialog {
  width: min(100% - 2 * var(--pj-gutter), 420px);
  padding: var(--pj-space-6);
  border: 1px solid var(--pj-line);
  border-radius: 20px;
  background: var(--pj-surface);
  color: var(--pj-ink);
}
dialog[open] {
  display: flex;
  flex-direction: column;
  gap: var(--pj-space-4);
}
dialog::backdrop {
  background: rgb(5 6 8 / 0.62);
}

.foot {
  display: flex;
  justify-content: center;
  gap: var(--pj-space-5);
  margin-top: auto;
  padding: var(--pj-space-5) var(--pj-gutter);
  color: var(--pj-muted);
  font-size: var(--pj-fs-meta);
}
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: var(--pj-tap);
}
