@font-face {
  font-family: Manrope;
  src: url('accounts-auth/manrope-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: Manrope;
  src: url('accounts-auth/manrope-cyrillic.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0400-052F, U+2DE0-2DFF, U+A640-A69F;
}

:root {
  color-scheme: dark;
  --background: #0c0e12;
  --surface: #13161c;
  --raised: #1b2029;
  --inset: #101318;
  --border: #2a2e37;
  --control-border: #687384;
  --foreground: #f2f3f5;
  --muted: #a6adb9;
  --accent: #efbc75;
  --accent-hover: #f7ce96;
  --accent-ink: #20180d;
  --error: #efb9a7;
  font: 100%/1.5 Inter, system-ui, sans-serif;
  color: var(--foreground);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { color: var(--accent-ink); background: var(--accent); }
body { margin: 0; }

.account-site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 4.375rem;
  padding: .75rem clamp(1rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.account-site-header a {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  color: var(--foreground);
  font-size: 1.25rem;
  font-weight: 780;
  letter-spacing: -.025em;
}

.brand img { width: 2.25rem; height: 2.25rem; border-radius: .65rem; }

main {
  width: min(calc(100% - 2rem), 35rem);
  margin: clamp(1.375rem, 6vw, 4.5rem) auto;
  padding: clamp(1.25rem, 5vw, 2.375rem);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: 0 .875rem 2.5rem #0005;
}

h1, h2 { line-height: 1.17; overflow-wrap: anywhere; }
h1 { margin-top: 0; font-size: clamp(1.65rem, 6vw, 2rem); letter-spacing: -.035em; }
h2 { margin-top: 1.875rem; font-size: 1.25rem; }
p { color: var(--muted); }
a { color: var(--accent); text-underline-offset: .17em; }
a:hover { color: var(--accent-hover); }

:is(a, button, input, select):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

label {
  display: block;
  margin-bottom: .375rem;
  color: var(--foreground);
  font-weight: 650;
}

input:not([type="checkbox"]):not([type="hidden"]), select {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: .6rem .75rem;
  border: 1px solid var(--control-border);
  border-radius: .625rem;
  color: var(--foreground);
  background: var(--inset);
  font: inherit;
}

input[readonly] { color: var(--muted); }
input[aria-invalid="true"]:not([type="checkbox"]) { border-color: var(--error); }
input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 500; }
.check input { margin-top: .25em; flex: none; }

button {
  min-height: 2.75rem;
  padding: .6rem 1.2rem;
  border: 1px solid transparent;
  border-radius: .65rem;
  color: var(--accent-ink);
  background: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

button:not(:disabled):hover { background: var(--accent-hover); }
button:disabled { opacity: .55; cursor: default; }

button.secondary {
  border-color: var(--control-border);
  color: var(--foreground);
  background: var(--raised);
}

button.secondary:not(:disabled):hover { border-color: var(--accent); background: #282723; }

.helptext, form ul:not(.errorlist) { color: var(--muted); font-size: .875rem; }
.helptext { display: block; margin-top: .375rem; }
.errorlist, [role="alert"] { color: var(--error); }
.errorlist { padding-inline-start: 1rem; }
#preferences-status:empty { display: none; }

.qr {
  box-sizing: content-box;
  display: block;
  max-width: calc(100% - .75rem);
  height: auto;
  margin: .75rem 0 1.125rem;
  padding: .375rem;
  border-radius: .75rem;
  background: #fff;
  image-rendering: pixelated;
}

.auth-entry-page {
  width: min(calc(100% - 2rem), 72rem);
  margin: 0 auto;
  padding: 24px 0 55px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: Manrope, system-ui, sans-serif;
}

.auth-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  max-width: 440px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: .75rem;
}
.auth-breadcrumb a { color: var(--muted); text-decoration: none; }
.auth-breadcrumb a:hover { color: var(--accent); }

.auth-entry-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #14171d;
  box-shadow: 0 18px 60px #0002;
}

.auth-entry-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.auth-entry-heading h1 { margin: 0; font-size: 27px; line-height: 1.3; font-weight: 650; letter-spacing: -.04em; }
.auth-entry-heading p { margin: 7px 0 0; font-size: .8125rem; line-height: 1.8; }
.auth-entry-heading a { text-decoration: none; }
.auth-entry-heading a:hover { text-decoration: underline; }
.auth-entry-mark { width: 25px; height: 25px; flex: none; margin-top: 5px; color: var(--accent); }
.auth-entry-mark svg { display: block; width: 100%; height: 100%; }

.auth-method-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0 -4px 22px;
  border-bottom: 1px solid var(--border);
}
.auth-method-tabs > button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 65px;
  padding: 7px 3px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.6;
  font-weight: 550;
}
.auth-method-tabs > button svg { display: block; width: 21px; height: 21px; flex: none; }
.auth-method-tabs > button:not(:disabled):hover, .auth-method-tabs > button[aria-selected='true'] { color: var(--accent); background: transparent; }
.auth-method-tabs > button[aria-selected='true']::after { content: ''; position: absolute; inset: auto 13px -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.auth-method-tabs > button:disabled { opacity: .48; }

.auth-field { margin-bottom: 15px; min-width: 0; }
.auth-field > label { margin-bottom: 7px; color: var(--muted); font-size: .875rem; line-height: 1.6; font-weight: 550; }
.auth-input-wrap { position: relative; min-width: 0; }
.auth-form input:not([type='hidden']), .auth-challenge-code input {
  min-height: 48px;
  padding: 11px 12px;
  border-color: #343b48;
  border-radius: 6px;
  background: #0f1218;
  font-size: 1rem;
  line-height: 1.5;
}
.auth-form input[aria-invalid='true'] { border-color: var(--error); }
.auth-input-password input:not([type='hidden']) { padding-right: 48px; }

.auth-password-toggle, .auth-captcha-refresh {
  display: grid;
  place-items: center;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid #343b48;
  border-radius: 6px;
  background: var(--raised);
  color: var(--muted);
}
.auth-password-toggle { position: absolute; top: 1px; right: 1px; width: 46px; min-height: 46px; border: 0; background: transparent; }
.auth-password-toggle svg, .auth-captcha-refresh svg { width: 19px; height: 19px; }
.auth-password-toggle:not(:disabled):hover, .auth-captcha-refresh:not(:disabled):hover { background: #282723; color: var(--accent); }
.auth-password-toggle[aria-pressed='true'] { color: var(--accent); }
.auth-captcha, .auth-captcha-answer { width: 320px; max-width: 100%; margin-inline: auto; }
.auth-captcha { margin-bottom: 10px; }
.auth-captcha img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.auth-captcha-answer:has(.auth-captcha-refresh) { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; }
.auth-captcha-answer input { text-transform: uppercase; }
.auth-field .helptext, .auth-field .helptext ul { font-size: .75rem; line-height: 1.65; }
.auth-field .helptext ul { margin: 2px 0 0; padding-inline-start: 1rem; }
.auth-entry-card .errorlist { font-size: .8125rem; line-height: 1.5; margin: 7px 0; }
.auth-inline-status { margin: 8px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.auth-inline-status:empty { display: none; }
.auth-inline-status[data-error='true'] { color: var(--error); }

.auth-submit, .auth-provider-start, .auth-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 650;
}
.auth-submit { margin-top: 3px; }
.auth-submit > span, .auth-provider-start > span:last-child { font-size: 1.125rem; font-weight: 400; line-height: 1; }
.auth-provider-start svg { width: 22px; height: 22px; flex: none; }
.auth-action:hover { background: var(--accent-hover); color: var(--accent-ink); }
.auth-policy { margin: 20px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.75; }

.auth-provider-intro { padding-top: 6px; text-align: center; }
.auth-provider-intro > p { max-width: 295px; margin: 0 auto 22px; color: var(--muted); font-size: .8125rem; line-height: 1.85; }
.auth-provider-steps { display: grid; gap: 12px; max-width: 320px; padding: 0; margin: 20px auto 24px; list-style: none; text-align: left; color: var(--muted); font-size: .8125rem; line-height: 1.7; }
.auth-provider-steps li { display: flex; align-items: flex-start; gap: 12px; }
.auth-provider-steps li > span { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--accent); font-size: .75rem; }
.auth-provider-challenge { margin-top: 16px; }
.auth-provider-challenge .auth-action { margin-bottom: 17px; }
.auth-provider-challenge label { color: var(--muted); font-size: .8125rem; }
.auth-challenge-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.auth-challenge-code input { min-height: 44px; font: .8125rem/1.5 ui-monospace, monospace; }
.auth-challenge-code button { min-height: 44px; padding-inline: 10px; font-size: .75rem; }
.auth-challenge-help { margin: 8px 0 0; font-size: .75rem; line-height: 1.7; }
.auth-provider-challenge > img { display: block; max-width: 100%; height: auto; margin: 18px auto 0; padding: 5px; border-radius: 6px; background: #fff; }
.auth-challenge-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: .75rem; }
.auth-text-button { min-height: 36px; padding: 6px 3px; background: transparent; color: var(--accent); font-size: inherit; }
.auth-text-button:not(:disabled):hover { background: transparent; color: var(--accent-hover); text-decoration: underline; }

@media (max-width: 480px) {
  .auth-entry-page { width: calc(100% - 16px); padding: 17px 0 35px; }
  .auth-breadcrumb { margin-bottom: 16px; padding-inline: 4px; }
  .auth-entry-card { padding: 23px 11px; border-radius: 10px; box-shadow: none; }
  .auth-entry-heading { gap: 10px; margin-bottom: 17px; }
  .auth-entry-heading h1 { font-size: 25px; }
  .auth-entry-heading p { margin-top: 6px; }
  .auth-entry-mark { width: 23px; height: 23px; margin-top: 4px; }
  .auth-method-tabs { gap: 2px; margin: 0 0 20px; }
  .auth-method-tabs > button { min-height: 64px; padding-bottom: 12px; }
  .auth-provider-intro { padding-inline: 7px; }
}
