@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --paper: #fff;
  --ink: #111;
  --muted: #666;
  --line: #e5e5e5;
  --quiet: #f7f7f5;
  font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a, input, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .45; }
:is(a, button, input, summary):focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
[hidden] { display: none !important; }
svg { stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

/* One quiet header and one focused form share the main marketplace's identity. */
.auth-shell { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.auth-header {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px clamp(24px, 4.5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.auth-brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.auth-brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; flex: none; }
.auth-brand-mark svg { width: 21px; height: 21px; }
.auth-brand strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.4; }
.auth-brand small { display: none; }
.auth-top a { min-height: 36px; display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.auth-top svg { width: 17px; height: 17px; flex: none; }
.auth-top a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.auth-main { flex: 1; width: 100%; padding: clamp(48px, 7vh, 80px) 24px 56px; display: flex; flex-direction: column; align-items: center; }
.auth-panel, .auth-about { width: 100%; max-width: 408px; }
.auth-form-heading h1 { margin: 0 0 12px; font-size: 36px; line-height: 1.25; font-weight: 500; letter-spacing: -1px; }
.auth-form-heading p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.auth-tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--line); margin: 32px 0 28px; }
.auth-tabs a { position: relative; min-height: 44px; padding: 8px 0 14px; color: var(--muted); font-size: 14px; }
.auth-tabs a:hover, .auth-tabs a[aria-current="page"] { color: var(--ink); }
.auth-tabs a[aria-current="page"] { font-weight: 600; }
.auth-tabs a[aria-current="page"]::after { position: absolute; content: ""; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }

/* Clear labels, generous targets and a visible focus ring in every form state. */
.auth-field { margin-bottom: 22px; }
.auth-field label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 500; }
.auth-field label > span { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.auth-field input {
  width: 100%;
  height: 52px;
  border: 1px solid #d1d1d1;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
}
.auth-field input::placeholder { color: #767676; font-size: 14px; }
.auth-field input:hover { border-color: #999; }
.auth-field input:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 3px; }
.auth-field input[aria-invalid="true"] { border-color: var(--ink); border-width: 2px; padding-left: 15px; }
.auth-field small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 56px; }
.password-toggle { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--quiet); color: var(--ink); }
.password-toggle svg { width: 20px; height: 20px; }
.auth-checkbox { display: flex; align-items: center; gap: 10px; width: fit-content; min-height: 32px; margin: -2px 0 24px; color: var(--muted); font-size: 13px; cursor: pointer; }
.auth-checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.auth-submit { width: 100%; min-height: 52px; margin-top: 4px; padding: 13px 24px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 500; line-height: 1.6; }
.auth-submit:hover:not(:disabled) { background: #333; border-color: #333; }
.auth-form-note { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
.auth-switch { margin: 28px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.auth-switch a { margin-left: 6px; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.auth-switch a:hover { text-decoration-thickness: 2px; }
.continue-verification { display: block; min-height: 44px; margin: 8px auto 0; padding: 10px 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; }
.continue-verification:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.auth-oauth-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 13px 20px; border: 1px solid #d1d1d1; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; }
.auth-oauth-button:hover { background: var(--quiet); border-color: #999; }
.auth-oauth-button svg { width: 20px; height: 20px; flex: none; }
.auth-oauth-divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: var(--muted); font-size: 12px; }
.auth-oauth-divider::before, .auth-oauth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* Status remains readable without decorative success or warning color panels. */
.auth-message, .auth-notice { margin: 0 0 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--quiet); color: var(--ink); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.auth-error { border-color: #aaa; border-left: 3px solid var(--ink); }
.verification-address { margin: 28px 0; }
.verification-address > span { display: block; color: var(--muted); font-size: 13px; }
.verification-address strong { display: block; margin: 6px 0 12px; overflow-wrap: anywhere; font-size: 16px; font-weight: 500; }
.verification-address p { margin: 0; color: var(--muted); font-size: 14px; }
#verifyForm { margin-top: 32px; }
#verifyForm .verification-address { margin-top: 0; }
.verify-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; }
.verify-actions button { min-height: 44px; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-size: 13px; }
.verify-actions button:last-child { color: var(--muted); }
.verify-actions button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 4px; }
.development-code { margin: 0 0 22px; padding: 12px 16px; border-radius: 8px; background: var(--quiet); color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
#verificationCode { height: 56px; letter-spacing: 8px; font-size: 24px; }
#verificationCode::placeholder { font-size: 14px; letter-spacing: 1px; }

.auth-about { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.auth-about summary { width: fit-content; min-height: 36px; padding: 6px 0; font-size: 12px; }
.auth-about summary:hover { color: var(--ink); }
.auth-about-content { padding-top: 16px; font-size: 13px; line-height: 1.9; }
.auth-about-content h2 { margin: 0 0 16px; color: var(--ink); font-size: 18px; font-weight: 500; line-height: 1.6; }
.auth-about-content p { margin: 0 0 16px; }
.auth-about-content p:last-child { margin-bottom: 0; }
.auth-footer { padding: 16px 24px 28px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
.auth-footer span { padding: 0 6px; }

@media (max-width: 600px) {
  .auth-header { padding: 20px 24px; gap: 16px; }
  .auth-top a { font-size: 12px; gap: 6px; }
  .auth-top svg { width: 15px; height: 15px; }
  .auth-main { padding-top: 44px; padding-bottom: 40px; }
  .auth-form-heading h1 { font-size: 32px; letter-spacing: -.7px; }
  .auth-form-heading p { font-size: 14px; }
  .auth-tabs { margin-top: 28px; }
  .auth-about { margin-top: 40px; }
  .auth-footer { font-size: 11px; padding-bottom: 24px; }
}

@media (max-width: 360px) {
  .auth-header { padding-right: 20px; padding-left: 20px; gap: 12px; }
  .auth-brand { gap: 7px; }
  .auth-brand strong { font-size: 14px; }
  .auth-top a { font-size: 11px; }
  .auth-main { padding-right: 20px; padding-left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
