:root {
  --lime: #dfff64;
}
body.register-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.register-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 24px 72px;
}
.register-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 32px 28px 28px;
  box-shadow: 0 18px 40px #2622380c;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  background: #f3f1ea;
  border-radius: 14px;
}
.auth-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.auth-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px #17171b14;
}
.auth-tab:hover {
  color: var(--ink);
}
.register-kicker {
  margin: 0 0 10px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.register-card h1 {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}
.register-lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
}
.register-form {
  display: grid;
  gap: 16px;
}
.register-field {
  display: grid;
  gap: 6px;
}
.register-field label {
  font-size: 14px;
  font-weight: 600;
}
.register-field input[type="text"],
.register-field input[type="email"],
.register-field input[type="password"],
.register-field input[type="tel"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf7;
  color: var(--ink);
  font: 16px/1.4 var(--sans);
}
.register-field input:focus {
  outline: 3px solid #7048ff33;
  border-color: var(--purple);
  background: #fff;
}
.register-error {
  min-height: 0;
  margin: 0;
  color: #c2410c;
  font-size: 12px;
}
.register-error:empty {
  display: none;
}
.register-form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1e8;
  color: #9a3412;
  font-size: 13px;
}
.register-form-error:empty,
.register-form-error[hidden] {
  display: none;
}
.consent-stack {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f7f3;
}
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.consent-row input[type="checkbox"] {
  margin-top: 1px;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  accent-color: var(--purple);
}
.consent-row label {
  font-size: 11px;
  line-height: 1.35;
  font-weight: 400;
  color: #3f3f48;
  cursor: pointer;
}
.consent-stack .register-error {
  margin-top: -4px;
  padding-left: 21px;
}
.consent-row a,
.consent-details {
  color: var(--purple);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.consent-row a:hover,
.consent-details:hover {
  text-decoration: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  font: 650 15px/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.button.primary {
  width: 100%;
  background: var(--lime);
  color: var(--ink);
}
.button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
}
.button.primary:disabled {
  opacity: 0.45;
  cursor: default;
}
.auth-socials {
  margin-top: 18px;
}
.auth-social-label {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.auth-social-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.auth-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font: 650 15px/1 var(--sans);
  cursor: pointer;
}
.auth-social.yandex {
  background: #111111;
}
.auth-social.yandex:hover {
  background: #2a2a2a;
}
.auth-social.vk {
  background: #0077ff;
}
.auth-social.vk:hover {
  background: #0066e0;
}
.auth-social-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fc3f1d;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.vk-logo {
  width: 24px;
  height: 24px;
  display: block;
  flex: none;
}
.arrow-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.register-switch {
  margin: 22px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.register-switch a {
  color: var(--purple);
  font-weight: 650;
  text-decoration: none;
}
.register-switch a:hover {
  text-decoration: underline;
}
.register-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(85vh, 720px);
  padding: 28px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
}
.register-dialog::backdrop {
  background: #18181e88;
}
.register-dialog h2 {
  font-size: 22px;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.register-dialog .legal-meta {
  margin-bottom: 16px;
}
.register-dialog-body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  color: #3f3f48;
  overflow: auto;
  max-height: 55vh;
}
.register-dialog-body p {
  white-space: normal;
  margin: 0 0 12px;
}
.register-dialog-body a {
  color: var(--purple);
  font-weight: 650;
}
.register-dialog .close-dialog {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.register-dialog {
  position: relative;
}
/* Mobile: the whole form plus Yandex/VK must fit above Safari's bottom bar. */
@media (max-width: 760px) {
  body.register-page {
    min-height: 100svh;
  }
  body.register-page .legal-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    gap: 8px;
  }
  body.register-page .legal-logo img {
    width: 88px;
  }
  body.register-page .legal-header nav {
    flex-wrap: nowrap;
    gap: 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .register-main {
    padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
    align-items: flex-start;
  }
  .register-card {
    padding: 10px 12px 12px;
    border-radius: 16px;
  }
  .auth-tabs {
    margin-bottom: 10px;
    padding: 3px;
    border-radius: 12px;
  }
  .auth-tab {
    min-height: 34px;
    border-radius: 9px;
  }
  .register-kicker {
    display: none;
  }
  /* The active tab already says «Регистрация»; keep h1 for screen readers only. */
  .register-card h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .register-lead {
    margin: 0;
    text-align: center;
    font-size: 13px;
  }
  .register-form {
    gap: 8px;
    margin-top: 10px;
  }
  .register-field {
    gap: 3px;
  }
  .register-field label {
    font-size: 13px;
  }
  .register-field input[type="text"],
  .register-field input[type="email"],
  .register-field input[type="password"],
  .register-field input[type="tel"] {
    height: 42px;
    border-radius: 10px;
  }
  .consent-stack {
    gap: 4px;
    padding: 6px 8px;
    border-radius: 10px;
  }
  .button {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
  }
  .auth-socials {
    margin-top: 2px;
  }
  .auth-social-label {
    font-size: 12px;
  }
  .auth-social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
  }
  .auth-social {
    min-height: 42px;
    padding: 8px 10px;
    gap: 8px;
    font-size: 14px;
  }
  .auth-social-prefix {
    display: none;
  }
  .vk-logo {
    width: 22px;
    height: 22px;
  }
  .register-switch {
    margin-top: 10px;
  }
}
