.auth-page {
  min-height: 100vh;
}

.auth-login-root,
.auth-login-root .auth-login-page {
  height: 100%;
  overflow: hidden;
  scrollbar-width: none;
}

.auth-login-root::-webkit-scrollbar,
.auth-login-root .auth-login-page::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.auth-login-page {
  --auth-background-image: url("https://commons.wikimedia.org/wiki/Special:Redirect/file/Spb%2006-2017%20img01%20Spit%20of%20Vasilievsky%20Island.jpg?width=1800");
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  background: #07170f;
}

.auth-photo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #07170f;
  pointer-events: none;
}

.auth-photo-backdrop::before,
.auth-photo-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
}

.auth-photo-backdrop::before {
  inset: -18px;
  background-image:
    linear-gradient(135deg, rgba(2, 20, 10, 0.46), rgba(2, 15, 11, 0.2) 44%, rgba(3, 23, 12, 0.52)),
    var(--auth-background-image);
  background-position: center;
  background-size: cover;
  filter: saturate(0.92) contrast(1.04);
  transform: scale(1.02);
  transition: opacity 900ms ease;
}

.auth-photo-backdrop.has-rotator::before {
  opacity: 0;
}

.auth-photo-frame {
  position: absolute;
  inset: -18px;
  opacity: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(0.92) contrast(1.04);
  transform: scale(1.02);
  transition: opacity 1800ms ease;
}

.auth-photo-frame.is-active {
  opacity: 1;
}

.auth-photo-backdrop::after {
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(6, 18, 12, 0.16), rgba(6, 18, 12, 0.46));
}

.auth-header {
  margin-bottom: 28px;
}

.auth-login-page .auth-header {
  margin-bottom: 0;
}

.auth-login-page .site-header::before {
  top: 0;
  bottom: 0;
  background:
    linear-gradient(180deg, rgba(26, 31, 34, 0.62) 0%, rgba(26, 31, 34, 0.46) 58%, rgba(26, 31, 34, 0.28) 100%),
    rgba(8, 13, 15, 0.14);
  box-shadow: none;
  backdrop-filter: none;
}

.auth-login-page .header-chip-auth {
  color: #fff;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  font-weight: 800;
}

.auth-login-page .header-chip-auth:hover {
  background: transparent;
  border-color: transparent;
}

.auth-login-page .primary-button.header-signup-button {
  color: #fff;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.auth-login-page .primary-button.header-signup-button:hover {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

/* Dark theme: auth-page header buttons are plain text — no fill and no border
   in any state. (Overrides the global dark .header-chip-auth border, which is
   meant for solid headers, not the photo-backed auth pages.) */
:root[data-theme="dark"] .auth-login-page .header-chip-auth,
:root[data-theme="dark"] .auth-login-page .header-chip-auth:hover,
:root[data-theme="dark"] .auth-login-page .header-chip-auth:focus-visible,
:root[data-theme="dark"] .auth-login-page .primary-button.header-signup-button,
:root[data-theme="dark"] .auth-login-page .primary-button.header-signup-button:hover,
:root[data-theme="dark"] .auth-login-page .primary-button.header-signup-button:focus-visible {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 520px);
  gap: 28px;
  align-items: stretch;
}

.auth-login-page .auth-shell {
  width: min(100% - 32px, 520px);
  min-height: calc(100svh - 84px);
  padding: 34px 0 58px;
  grid-template-columns: 1fr;
  place-items: center;
}

.auth-intro,
.auth-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-login-page .auth-intro {
  display: none;
}

.auth-intro {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}

.auth-intro h1,
.auth-card h2 {
  font-family: "Sora", sans-serif;
  letter-spacing: var(--brand-letter-spacing);
}

.auth-intro h1 {
  margin: 18px 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.95;
  max-width: 12ch;
}

.auth-intro p:last-of-type {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 52ch;
}

.auth-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-highlights article {
  padding: 20px;
  border-radius: 24px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  min-height: 108px;
}

.auth-highlights span,
.auth-highlights strong,
.auth-highlights p {
  display: block;
}

.auth-highlights span {
  color: var(--accent-strong);
  font-family: "Sora", sans-serif;
  font-size: 0.84rem;
}

.auth-highlights strong {
  margin-top: 12px;
  font-size: 1rem;
}

.auth-highlights p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.auth-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.auth-login-page .auth-card {
  width: 100%;
  padding: 34px;
  border-color: rgba(255, 255, 255, 0.3);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(175, 205, 222, 0.1) 46%, rgba(18, 31, 39, 0.18)),
    rgba(10, 23, 24, 0.12);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 34px 86px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(30px) saturate(1.18);
}

.auth-register-page .auth-card {
  max-height: calc(100svh - 118px);
  overflow-y: auto;
  scrollbar-width: none;
}

.auth-register-page .auth-shell {
  padding-top: clamp(8px, 1.4vh, 16px);
  padding-bottom: clamp(8px, 1.4vh, 16px);
}

.auth-register-page .auth-card {
  padding: clamp(15px, 2.2vh, 24px);
  max-height: calc(100svh - 108px);
}

.auth-register-page .auth-card-head h2 {
  margin-top: 0;
  font-size: clamp(1.55rem, 3.1vh, 2rem);
}

.auth-register-page .auth-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.auth-login-page .auth-card h2,
.auth-login-page .auth-field > span:not(.auth-field-error) {
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

/* The tag hint sits over the photo like the labels — the default grey
   (var(--muted)) is invisible there, so give it the same light + shadow. */
.auth-login-page .auth-field-note {
  color: rgba(255, 255, 255, 0.84);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.34);
}

.auth-login-page .auth-switch {
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
}

.auth-login-page .auth-switch a {
  color: #35e66b;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

/* Sign-up email-code step: hint on the left, "resend" link-button on the right. */
.auth-code-field .auth-code-actions {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.auth-code-field .auth-code-actions .auth-field-note {
  margin: 0;
  flex: 1 1 180px;
}

.auth-resend-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: #35e66b;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.auth-resend-button:hover:not(:disabled) {
  text-decoration: underline;
}

.auth-resend-button:disabled {
  color: rgba(255, 255, 255, 0.55);
  cursor: default;
}

/* Forgot-password: link under the password + the reset panel's back button. */
.auth-forgot-row {
  display: flex;
  justify-content: flex-start;
  margin-top: -4px;
}
.auth-link-button {
  padding: 4px 2px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  color: #35e66b;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.auth-link-button:hover {
  text-decoration: underline;
}
.auth-back-button {
  display: block;
  margin: 6px auto 0;
  padding: 8px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.auth-back-button:hover {
  color: #ffffff;
}

.auth-card-head h2 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 0.98;
}

.auth-intro > p:not(.eyebrow),
.auth-highlights p,
.auth-card-head > p:not(.eyebrow) {
  display: none;
}

.auth-card-head p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 26px;
}

.auth-register-page .auth-form {
  gap: clamp(6px, 1.1vh, 11px);
  margin-top: clamp(8px, 1.4vh, 16px);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-register-page .auth-grid {
  gap: 10px 14px;
  align-items: start;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-register-page .auth-field {
  gap: 4px;
}

.auth-field-password {
  gap: 10px;
}

.auth-field > span:not(.auth-field-error) {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
}

.auth-field input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 1);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-register-page .auth-field input {
  padding: 11px 15px;
  border-radius: 15px;
}

.auth-field input:focus {
  border-color: rgba(var(--accent-rgb), 0.36);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.auth-field.is-invalid input {
  border-color: rgba(248, 113, 113, 0.78);
  box-shadow:
    0 0 0 4px rgba(239, 68, 68, 0.14),
    0 10px 26px rgba(127, 29, 29, 0.1);
}

.auth-field-error {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  max-height: 0;
  padding: 0 11px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  border-radius: 14px;
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.24), rgba(127, 29, 29, 0.16)),
    rgba(255, 255, 255, 0.12);
  color: #fff7f7;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.25;
  box-shadow: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  transition:
    max-height 220ms ease,
    padding 220ms ease,
    opacity 180ms ease,
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.auth-field.is-invalid .auth-field-error {
  max-height: 56px;
  padding: 8px 11px;
  opacity: 1;
  transform: translateY(0) scale(1);
  border-color: rgba(254, 202, 202, 0.4);
  box-shadow: 0 12px 24px rgba(127, 29, 29, 0.14);
}

.auth-login-page .auth-field.is-invalid .auth-field-error {
  background:
    linear-gradient(135deg, rgba(220, 38, 38, 0.36), rgba(127, 29, 29, 0.22)),
    rgba(22, 28, 30, 0.18);
  border-color: rgba(254, 202, 202, 0.5);
  box-shadow:
    0 14px 30px rgba(127, 29, 29, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.password-strength {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-8px);
  transform-origin: top center;
  margin-top: 0;
  pointer-events: none;
  transition:
    max-height 260ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    margin-top 180ms ease;
}

.password-strength.is-visible {
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 4px;
  pointer-events: auto;
}

.auth-register-page .password-strength.is-visible {
  margin-top: 2px;
  max-height: 220px;
}

.password-strength-panel {
  padding: 16px 18px;
  border-radius: 22px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.auth-register-page .password-strength-panel {
  padding: 10px 14px;
  border-radius: 16px;
}

.auth-login-page .password-strength-panel {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.76);
  color: var(--text);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  text-shadow: none;
}

.password-strength-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.password-strength-head strong {
  font-size: 0.94rem;
}

.auth-login-page .password-strength-head strong {
  color: var(--text);
  text-shadow: none;
}

.password-strength-head span {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
}

.auth-login-page .password-strength-head span {
  text-shadow: none;
}

.password-strength-bar {
  height: 10px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(35, 43, 47, 0.08);
  overflow: hidden;
}

.auth-register-page .password-strength-bar {
  height: 8px;
  margin-top: 8px;
}

.password-strength-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #d96464;
  transition: width 160ms ease, background 160ms ease;
}

.password-strength-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.auth-register-page .password-strength-rules {
  gap: 6px;
  margin-top: 8px;
}

.password-rule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(35, 43, 47, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
}

.auth-register-page .password-rule {
  padding: 5px 9px;
  font-size: 0.8rem;
}

.auth-login-page .password-rule {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(35, 43, 47, 0.1);
  color: #66737a;
  box-shadow: none;
  text-shadow: none;
}

.password-rule::before {
  content: "•";
  color: rgba(35, 43, 47, 0.32);
}

.auth-login-page .password-rule::before {
  color: rgba(35, 43, 47, 0.36);
}

.password-rule.is-met {
  border-color: rgba(var(--accent-rgb), 0.2);
  color: var(--accent-strong);
  background: rgba(255, 255, 255, 1);
}

.auth-login-page .password-rule.is-met {
  color: var(--accent-strong);
  border-color: rgba(var(--accent-rgb), 0.24);
  background: rgba(244, 255, 247, 0.98);
}

.password-rule.is-met::before {
  content: "✓";
  color: var(--accent-strong);
}

.password-strength[data-strength="weak"] .password-strength-head span {
  color: #ba3636;
}

.password-strength[data-strength="weak"] .password-strength-bar span {
  width: 34%;
  background: #e06161;
}

.password-strength[data-strength="medium"] .password-strength-head span {
  color: #c3811d;
}

.password-strength[data-strength="medium"] .password-strength-bar span {
  width: 68%;
  background: #f0b24a;
}

.password-strength[data-strength="strong"] .password-strength-head span {
  color: var(--accent-strong);
}

.password-strength[data-strength="strong"] .password-strength-bar span {
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.auth-login-page .password-strength,
.auth-login-page .password-strength * {
  text-shadow: none;
}

.auth-login-page .password-strength {
  color: #1f2933 !important;
}

.auth-login-page .password-strength-panel {
  background: #f8faf9;
  border-color: rgba(255, 255, 255, 0.86);
}

.auth-login-page .password-strength-head strong {
  color: #273238 !important;
}

.auth-login-page .password-strength-head span {
  color: #6b747b !important;
}

.auth-login-page .password-strength[data-strength="weak"] .password-strength-head span {
  color: #b91c1c !important;
}

.auth-login-page .password-strength[data-strength="medium"] .password-strength-head span {
  color: #9a5c0d !important;
}

.auth-login-page .password-strength[data-strength="strong"] .password-strength-head span {
  color: var(--accent-strong) !important;
}

.auth-login-page .password-rule {
  background: #ffffff;
  border-color: rgba(35, 43, 47, 0.14);
  color: #5f6b72 !important;
}

.auth-login-page .password-rule::before {
  color: #8a969d;
}

.auth-login-page .password-rule.is-met {
  background: #f0fff4;
  border-color: rgba(var(--accent-rgb), 0.26);
  color: var(--accent-strong) !important;
}

.auth-message {
  min-height: 24px;
  padding: 0 2px;
  font-size: 0.95rem;
  font-weight: 800;
  transition:
    min-height 180ms ease,
    padding 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.auth-message:empty {
  display: none;
  min-height: 0;
  padding: 0;
}

.auth-message[data-state] {
  min-height: 46px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 18px;
}

.auth-message[data-state="error"] {
  color: #fff7f7;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.28), rgba(127, 29, 29, 0.18));
  border-color: rgba(254, 202, 202, 0.36);
  box-shadow: 0 14px 30px rgba(127, 29, 29, 0.16);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-message[data-state="success"] {
  color: #f4fff7;
  background: linear-gradient(135deg, rgba(7, 182, 60, 0.36), rgba(8, 145, 75, 0.24));
  border-color: rgba(187, 247, 208, 0.46);
  box-shadow:
    0 16px 34px rgba(7, 182, 60, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.34);
}

.auth-login-page .auth-message[data-state="success"] {
  background:
    linear-gradient(135deg, rgba(15, 185, 80, 0.46), rgba(5, 122, 57, 0.3)),
    rgba(2, 26, 14, 0.18);
  border-color: rgba(187, 247, 208, 0.58);
  box-shadow:
    0 18px 38px rgba(7, 182, 60, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-submit {
  width: 100%;
  justify-content: center;
}

.auth-switch {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-switch a {
  color: var(--accent-strong);
  font-weight: 800;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 20px;
  }

  .auth-login-page .auth-shell {
    width: min(100% - 24px, 520px);
    min-height: calc(100svh - 132px);
    padding: 22px 0 36px;
  }

  .auth-intro,
  .auth-card {
    border-radius: 24px;
    padding: 22px;
  }

  .auth-login-page .auth-card {
    padding: 24px;
  }

  .auth-intro h1 {
    font-size: clamp(2.1rem, 12vw, 3.6rem);
  }

  .auth-highlights,
  .auth-grid {
    grid-template-columns: 1fr;
  }
}

/* VK ID sign-in block (revealed by vk-auth.js only when VK is configured) */
.vk-auth {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.vk-auth[hidden] {
  display: none;
}
.vk-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted, #667173);
  font: 500 13px/1 "Manrope", system-ui, sans-serif;
}
.vk-auth-divider::before,
.vk-auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border, rgba(35, 43, 47, 0.12));
}
.vk-auth-onetap {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

/* Consent to the Оферта / Политика конфиденциальности — required to sign up
   (email registration and first-time VK sign-in). */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0;
  cursor: pointer;
  font: 500 0.9rem/1.45 "Manrope", system-ui, sans-serif;
}
.auth-consent-vk {
  justify-content: center;
  text-align: left;
}
.auth-consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border-radius: 7px;
  accent-color: var(--accent, #07b63c);
  cursor: pointer;
}
.auth-consent > span {
  color: var(--muted);
}
.auth-consent a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-consent.is-invalid > span {
  color: #ef6b6b;
}
.auth-consent.is-invalid input[type="checkbox"] {
  outline: 2px solid rgba(248, 113, 113, 0.85);
  outline-offset: 2px;
}
/* The auth pages sit on a dark photo backdrop, so consent text/links go light. */
.auth-login-page .auth-consent > span {
  color: rgba(255, 255, 255, 0.9);
}
.auth-login-page .auth-consent a {
  color: #ffffff;
}
.auth-login-page .auth-consent.is-invalid > span {
  color: #ffd7d7;
}

/* Passive consent notice (login page): the sign-in / VK buttons carry the
   acceptance, so there is no checkbox — just an informational line beneath. */
.auth-consent-note {
  margin: 12px 0 2px;
  text-align: center;
  color: var(--muted);
  font: 500 0.82rem/1.5 "Manrope", system-ui, sans-serif;
}
.auth-consent-note a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Light text/links on the dark photo backdrop, matching the consent styles. */
.auth-login-page .auth-consent-note {
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
}
.auth-login-page .auth-consent-note a {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
}

/* ===========================================================================
   Тёмная тема — вход / регистрация (страница уже на тёмном фоне; делаем поля
   тёмно-стеклянными, чтобы всё смотрелось цельно).
   ========================================================================= */
:root[data-theme="dark"] .auth-field input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f2f6f3;
}
:root[data-theme="dark"] .auth-field input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}
:root[data-theme="dark"] .auth-login-page .password-strength-panel {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
:root[data-theme="dark"] .auth-login-page .password-rule {
  background: rgba(255, 255, 255, 0.08);
  color: #e9efe9;
}
:root[data-theme="dark"] .auth-login-page .password-rule.is-met {
  background: rgba(40, 200, 90, 0.16);
}

/* =====================================================================
   Dark-theme contrast fixes (audit 2026-07) — auth (login/register).
   The password-strength panel hard-codes light-theme slate/red/amber
   with !important and no dark override, so it was invisible on the dark
   glass panel. (:not(.is-met) keeps the green "met" rule styling intact.)
   ===================================================================== */
:root[data-theme="dark"] .auth-login-page .password-strength-head strong { color: #e9efe9 !important; }
:root[data-theme="dark"] .auth-login-page .password-strength-head span { color: #9aa8a1 !important; }
:root[data-theme="dark"] .auth-login-page .password-strength[data-strength="weak"] .password-strength-head span { color: #ff8a80 !important; }
:root[data-theme="dark"] .auth-login-page .password-strength[data-strength="medium"] .password-strength-head span { color: #f0b24a !important; }
:root[data-theme="dark"] .auth-login-page .password-rule:not(.is-met) { color: #e9efe9 !important; }
:root[data-theme="dark"] .auth-login-page .password-rule:not(.is-met)::before { color: rgba(233, 239, 233, 0.55); }

/* --- Registration interests picker (toggle chips) --- */
.auth-interests-field {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.auth-interests-field legend {
  padding: 0;
  color: inherit;
  font-size: 0.92rem;
  font-weight: 700;
}
.auth-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.auth-interest-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(35, 43, 47, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: #23282b;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.auth-interest-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 43, 47, 0.28);
}
.auth-interest-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--interest-color, #7c8a90);
  flex: 0 0 10px;
}
.auth-interest-chip.is-selected {
  border-color: var(--interest-color, var(--accent, #07b63c));
  background: color-mix(in srgb, var(--interest-color, var(--accent, #07b63c)) 14%, #ffffff);
  color: #10191d;
}

/* Dark theme */
:root[data-theme="dark"] .auth-interest-chip {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #e9efe9);
}
:root[data-theme="dark"] .auth-interest-chip:hover {
  border-color: rgba(255, 255, 255, 0.3);
}
:root[data-theme="dark"] .auth-interest-chip.is-selected {
  border-color: var(--interest-color, var(--accent-soft, #36da6a));
  background: color-mix(in srgb, var(--interest-color, var(--accent-soft, #36da6a)) 26%, #171e1a);
  color: #ffffff;
}

/* --- Register: compact so the whole form fits the viewport without scrolling. */
.auth-register-page .auth-field-note {
  font-size: 0.78rem;
  line-height: 1.3;
}
.auth-register-page .auth-interests-field {
  gap: 4px;
}
.auth-register-page .auth-interests-field legend {
  font-size: 0.85rem;
}
.auth-register-page .auth-interests {
  gap: 6px;
  margin-top: 2px;
}
.auth-register-page .auth-interest-chip {
  padding: 5px 11px;
  gap: 6px;
  font-size: 0.8rem;
}
.auth-register-page .auth-interest-dot {
  width: 7px;
  height: 7px;
  flex-basis: 7px;
}
.auth-register-page .auth-switch {
  margin-top: 8px;
}
.auth-register-page .auth-submit {
  padding-top: 13px;
  padding-bottom: 13px;
}

/* --- Confirmation step: collapse the form down to just the code entry. --- */
.auth-card.is-code-step .auth-form > *:not(.auth-code-field):not(.auth-message):not(.auth-submit),
.auth-card.is-code-step .vk-auth,
.auth-card.is-code-step .auth-switch {
  display: none;
}
.auth-card.is-code-step .auth-code-field {
  margin-top: 4px;
}

.auth-back-button {
  align-self: flex-start;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.auth-back-button:hover {
  color: #fff;
  text-decoration: underline;
}
