.auth-shell {
  --auth-gold: #dfc89d;
  --auth-text: #f8e8d1;
  --auth-border: #393939;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--demo-width));
  min-height: 100dvh;
  margin-inline: auto;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 32px max(40px, env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, #0b0c0d 70.4%),
    #121212 url("../img/login-bg-78782eba8fe1.jpg") center / cover no-repeat;
  color: var(--auth-text);
  font-size: 14px;
  line-height: 1.4;
}

.auth-shell :is(a, button):focus-visible {
  outline: 2px solid var(--auth-gold);
  outline-offset: 3px;
}

.auth-page { display: flex; flex-direction: column; }

.auth-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.auth-symbols { position: absolute; }

.auth-header {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.auth-login .auth-header { margin-bottom: 40px; }

.auth-logo {
  display: block;
  width: min(220px, 85%);
  height: auto;
  margin-inline: auto;
}

.auth-header:has(.auth-back) .auth-logo { width: min(220px, calc(100% - 72px)); }

.auth-back {
  position: absolute;
  inset: 0 auto auto -8px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: var(--auth-gold);
}

.auth-back .chevron { width: 9px; height: 9px; transform: rotate(225deg); }
.auth-back:hover { background: #ffffff0d; }

.auth-title {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
}

.auth-page:has(> .auth-intro) .auth-header { margin-bottom: 12px; }

.auth-intro {
  margin-bottom: 24px;
  color: #bbae9c;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.auth-form { display: grid; gap: 24px; }
.auth-field { display: grid; gap: 8px; min-width: 0; }
.auth-field > label { font-size: 14px; line-height: 18px; }

.auth-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  background: #2b2828;
}

.auth-input:has(input:placeholder-shown:not(:focus)) { background: #1e1d1b; }
.auth-input:focus-within { border-color: #ccb37a; }
.auth-input:has(input[aria-invalid="true"]) { border-color: #e99b84; }

.auth-input input {
  flex: 1;
  width: 0;
  min-width: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 16px;
}

.auth-input input::placeholder { color: #b6a58a; font-size: 14px; }

.auth-field-icon,
.auth-toggle,
.auth-toggle svg {
  flex: none;
  width: 24px;
  height: 24px;
}

.auth-field-icon { fill: url(#auth-icon-gold); }
.auth-toggle { color: #a9967b; }
.auth-toggle svg { fill: currentColor; }
.auth-toggle:hover { color: var(--auth-gold); }

.auth-options,
.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-remember,
.auth-terms {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.4;
}

.auth-terms { font-size: 13px; }
.auth-remember:has(input), .auth-terms:has(input) { cursor: pointer; }

.auth-shell :is(.auth-remember, .auth-terms) input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1px solid #83796c;
  border-radius: 50%;
  cursor: pointer;
}

.auth-shell :is(.auth-remember, .auth-terms) input[type="checkbox"]:checked {
  border-color: transparent;
  background: linear-gradient(#fff, #b99e87);
}

.auth-shell :is(.auth-remember, .auth-terms) input[type="checkbox"]:checked::after {
  position: absolute;
  inset: 5px auto auto 7px;
  width: 7px;
  height: 11px;
  transform: rotate(45deg);
  border-right: 2px solid #171410;
  border-bottom: 2px solid #171410;
  content: "";
}

.auth-shell :is(.auth-remember, .auth-terms) input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--auth-gold);
  outline-offset: 3px;
}

.auth-text-link, .auth-exit { color: var(--auth-gold); }
.auth-text-link:hover, .auth-exit:hover { text-decoration: underline; }

.auth-actions { display: grid; gap: 12px; }
.auth-page > .auth-actions { margin-top: 24px; }
.auth-login .auth-actions { margin-top: 16px; }
.auth-login > .auth-actions { margin-top: 40px; }

.auth-button {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: #2229;
  color: #ccb37a;
  font-size: 14px;
  text-align: center;
}

.auth-button.primary,
.auth-button--primary {
  border-color: transparent;
  background: linear-gradient(159deg, #7a6360, #322b25) padding-box,
    linear-gradient(#a88780, #322b25) border-box;
  color: #fff;
}

.auth-button:hover { filter: brightness(1.13); }
.auth-button:disabled { background: #393939; color: #b6b0a8; cursor: default; filter: none; }

.auth-quick {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 24px;
}

.auth-quick-login {
  width: min(100% - 32px, 420px);
  margin: auto;
  padding: 32px 20px 25px;
  border: 1px solid #cdd3d8;
  border-radius: 10px;
  background: #fff;
  color: #16222c;
  color-scheme: light;
  text-align: center;
}
.auth-quick-login::backdrop { background: #0009; }
.auth-quick-emblems {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.auth-quick-login .auth-telegram,
.auth-quick-brand { width: 50px; height: 50px; }
.auth-quick-login .auth-telegram { background: #419dd7; }
.auth-quick-login .auth-telegram svg { width: 30px; height: 30px; }
.auth-quick-arrow { width: 28px; color: #419dd7; }
.auth-quick-brand { display: grid; place-items: center; border-radius: 50%; background: #211b17; }
.auth-quick-brand img { width: 38px; }
.auth-quick-login .auth-title { color: #18242c; }
.auth-quick-login .auth-intro { margin: 8px 0 20px; color: #53606b; }
.auth-quick-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.auth-quick-actions .auth-button {
  width: auto;
  min-height: 36px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: #f3f8fc;
  color: #176a9e;
}
.auth-quick-actions .primary { background: #2581bc; color: #fff; }

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: min(10%, 32px);
  width: 100%;
  color: #a49787;
  white-space: nowrap;
}

.auth-divider::before, .auth-divider::after {
  flex: 1;
  height: 1px;
  background: var(--auth-border);
  content: "";
}

.auth-telegram {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(165deg, #36a2f5, #1b5a98);
  color: white;
}

.auth-telegram svg { width: 23px; height: 23px; fill: currentColor; }
.auth-telegram:hover { filter: brightness(1.12); }

.auth-status { color: var(--auth-gold); font-size: 13px; line-height: 1.45; }
.auth-status:empty { display: none; }
.auth-status[data-tone="error"] { color: #ffc1aa; }

.auth-demo-note {
  margin-top: 18px;
  color: #a49787;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
  overflow-wrap: anywhere;
}

.auth-field > .auth-demo-note { margin-top: 0; text-align: start; }

.auth-code {
  color: var(--auth-gold);
  font-family: ui-monospace, monospace;
  font-weight: 650;
}

.auth-exit { align-self: center; margin-top: 12px; font-size: 13px; }
.auth-footer { margin-top: auto; padding-top: 40px; }

.auth-footer :is(button, a) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}

.auth-footer svg {
  width: 20px;
  height: 20px;
  color: #d0b9a3;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.auth-footer :is(button, a):first-child {
  padding: 4px 12px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  background: #2229;
  color: #fff;
  font-size: 12px;
}

@media (max-width: 360px) {
  .auth-shell { padding-inline: 24px; }
}

@media (max-width: 300px) {
  .auth-shell { padding-inline: 16px; }
  .auth-options { gap: 8px; }
}
