:root {
  --auth-page: #f7fafd;
  --auth-surface: #ffffff;
  --auth-navy: #062a61;
  --auth-blue: #2f80ed;
  --auth-blue-soft: #eaf4ff;
  --auth-orange: #ff6a00;
  --auth-orange-hover: #e95f00;
  --auth-muted: #62758f;
  --auth-line: #dde6f0;
  --auth-error: #d94a5a;
  --auth-success: #1e9b72;
  --auth-shadow: 0 18px 50px rgba(21, 58, 96, 0.1);
}

body.is-auth-page {
  min-width: 320px;
  padding-bottom: 0;
  background: var(--auth-page);
}

body.is-auth-page > .site-header,
body.is-auth-page > .site-footer,
body.is-auth-page > .mobile-bottom-nav {
  display: none;
}

.auth-page {
  min-height: 100dvh;
  padding: 24px;
  display: grid;
  place-items: center;
  color: var(--auth-navy);
  background: #f6f9fc;
  font-family: "Onest", "Manrope", "Avenir Next", system-ui, sans-serif;
}

.auth-page[hidden] {
  display: none;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
  box-sizing: border-box;
}

.auth-page a {
  color: var(--auth-blue);
  text-decoration: none;
}

.auth-page a:hover {
  color: #176bc8;
}

.auth-page button,
.auth-page input,
.auth-page select {
  font: inherit;
}

.auth-page-inner {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(1120px, 100%);
  min-height: min(690px, calc(100dvh - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  overflow: hidden;
  background: var(--auth-surface);
  border: 1px solid rgba(217, 229, 241, 0.8);
  border-radius: 28px;
  box-shadow:
    0 20px 55px rgba(20, 55, 92, 0.1),
    0 2px 10px rgba(20, 55, 92, 0.04);
}

.auth-visual {
  position: relative;
  min-width: 0;
  min-height: 100%;
  padding: 36px 42px 32px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.72), transparent 38%),
    var(--auth-blue-soft);
  isolation: isolate;
}

.auth-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 520px;
  height: 620px;
  top: -50px;
  right: -220px;
  border-radius: 46% 54% 61% 39%;
  background: #fff;
  opacity: 0.52;
}

.auth-visual::after {
  content: none;
}

.auth-logo-link {
  position: relative;
  z-index: 3;
  display: inline-flex;
}

.auth-logo-link img {
  width: 118px;
  height: auto;
  display: block;
}

.auth-visual-copy {
  position: relative;
  z-index: 3;
  width: min(100%, 480px);
  margin-top: 54px;
}

.auth-visual-copy h2 {
  max-width: 430px;
  margin: 0;
  color: var(--auth-navy);
  font-family: "Arial Rounded MT Bold", "Nunito", "Onest", sans-serif;
  font-size: 42px;
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 900;
}

.auth-visual-copy > p {
  max-width: 350px;
  margin: 22px 0 0;
  color: #536a86;
  font-size: 16px;
  line-height: 1.55;
}

.auth-visual-copy ul {
  max-width: 300px;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
  list-style: none;
}

.auth-visual-copy li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--auth-navy);
  font-size: 14px;
  font-weight: 600;
}

.auth-visual-copy li img {
  width: 20px;
  height: 20px;
}

.auth-visual-art {
  position: absolute;
  right: 20px;
  bottom: 30px;
  z-index: 2;
  width: auto;
  width: min(54%, 310px);
  height: auto;
  max-width: none;
  max-height: 300px;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  -webkit-mask-image: none;
  mask-image: none;
}

.auth-visual--reset .auth-visual-copy {
  margin-top: 96px;
}

.auth-visual--reset .auth-visual-copy h2 {
  font-size: clamp(32px, 3vw, 44px);
}

.auth-visual--reset .auth-visual-art {
  right: 56px;
  bottom: 44px;
  width: 150px;
  height: auto;
  max-height: 240px;
  -webkit-mask-image: none;
  mask-image: none;
}

.auth-form-panel {
  position: relative;
  min-width: 0;
  min-height: 100%;
  padding: 34px 48px 40px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--auth-surface);
}

.auth-mode-switch {
  position: static;
  min-height: 24px;
  max-width: 100%;
  margin: 0;
  justify-self: end;
  align-self: flex-end;
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--auth-muted);
  font-size: 13px;
}

.auth-mode-switch a,
.auth-inline-switch a {
  font-weight: 750;
}

.auth-form-wrap {
  width: min(430px, 100%);
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 44px 0 34px;
  align-self: center;
  justify-self: center;
  transform: translateY(-18px);
}

.auth-form-wrap--centered {
  display: grid;
  place-items: center;
}

.auth-form-heading h1 {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 0;
  color: var(--auth-navy);
  font-family: "Arial Rounded MT Bold", "Nunito", "Onest", sans-serif;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 900;
}

.auth-form-heading h1::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -17px;
  width: 10px;
  height: 10px;
  background: var(--auth-orange);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}

.auth-form-heading p {
  max-width: 390px;
  margin: 12px 0 0;
  color: #536985;
  font-size: 15px;
  line-height: 1.55;
}

.auth-form {
  min-width: 0;
  margin-top: 30px;
  display: grid;
  gap: 17px;
}

.auth-field {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: var(--auth-navy);
}

.auth-field > span:first-child {
  font-size: 13px;
  font-weight: 750;
}

.auth-input-wrap {
  position: relative;
  min-width: 0;
  display: block;
}

.auth-field input,
.auth-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 52px;
  padding: 0 16px;
  color: var(--auth-navy);
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  outline: 0;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.auth-field select {
  padding-right: 44px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--auth-muted) 50%),
    linear-gradient(135deg, var(--auth-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 23px,
    calc(100% - 15px) 23px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.auth-field input::placeholder {
  color: #9aa9bc;
  opacity: 1;
}

.auth-field input:focus,
.auth-field select:focus {
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.12);
}

.auth-field input[aria-invalid="true"],
.auth-field select[aria-invalid="true"] {
  border-color: var(--auth-error);
  background: #fffafb;
}

.auth-field input[type="password"],
.auth-field input[type="text"][id$="password"] {
  padding-right: 54px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--auth-muted);
  background: transparent;
  border: 0;
  border-radius: 11px;
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  color: var(--auth-navy);
  background: var(--auth-blue-soft);
}

.auth-password-toggle img {
  width: 20px;
  height: 20px;
}

.auth-field-error {
  min-height: 0;
  color: var(--auth-error);
  font-size: 12px;
  line-height: 1.35;
}

.auth-field-error:empty {
  display: none;
}

.auth-consent,
.auth-remember {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #526780;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.auth-consent input,
.auth-remember input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.auth-checkbox {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1.5px solid #c8d4e2;
  border-radius: 5px;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.auth-checkbox img {
  width: 13px;
  height: 13px;
  opacity: 0;
  filter: brightness(0) invert(1);
}

.auth-consent input:checked + .auth-checkbox,
.auth-remember input:checked + .auth-checkbox {
  background: var(--auth-blue);
  border-color: var(--auth-blue);
}

.auth-consent input:checked + .auth-checkbox img,
.auth-remember input:checked + .auth-checkbox img {
  opacity: 1;
}

.auth-consent input:focus-visible + .auth-checkbox,
.auth-remember input:focus-visible + .auth-checkbox {
  box-shadow: 0 0 0 4px rgba(47, 128, 237, 0.14);
}

.auth-consent-error {
  margin-top: -10px;
}

.auth-primary-button,
.auth-secondary-button {
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 750;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.auth-primary-button {
  color: #fff;
  background: var(--auth-orange);
  border: 0;
  box-shadow: 0 8px 18px rgba(255, 106, 0, 0.16);
}

.auth-primary-button:hover {
  background: var(--auth-orange-hover);
  transform: translateY(-1px);
}

.auth-primary-button:active {
  transform: translateY(0);
}

.auth-secondary-button {
  color: var(--auth-navy);
  background: #fff;
  border: 1px solid var(--auth-line);
}

.auth-secondary-button:hover {
  border-color: #a9bdd6;
  background: #f9fbfd;
}

.auth-primary-button:disabled,
.auth-secondary-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.auth-primary-button:focus-visible,
.auth-secondary-button:focus-visible,
.auth-password-toggle:focus-visible,
.topic-select-card:focus-visible,
.auth-text-button:focus-visible,
.auth-back-link:focus-visible,
.auth-page a:focus-visible {
  outline: 3px solid rgba(47, 128, 237, 0.32);
  outline-offset: 3px;
}

.auth-form-options {
  margin-top: -2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-form-options > a {
  font-size: 13px;
  font-weight: 700;
}

.auth-remember {
  align-items: center;
  font-size: 13px;
}

.auth-general-error {
  padding: 11px 13px;
  color: #a52f40;
  background: #fff1f3;
  border: 1px solid #f4c8cf;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-inline-switch {
  display: none;
  margin: 22px 0 0;
  color: var(--auth-muted);
  text-align: center;
  font-size: 13px;
}

.auth-security-copy,
.onboarding-reassurance {
  margin: -2px 0 0;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-back-link {
  width: max-content;
  margin-bottom: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.auth-back-link img {
  width: 18px;
  height: 18px;
}

.auth-footer {
  margin-top: 0;
  padding-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #73849a;
  border-top: 1px solid #eef2f6;
  font-size: 12px;
  white-space: nowrap;
}

.auth-footer > span:last-child {
  display: flex;
  gap: 15px;
}

.auth-footer > span:first-child {
  flex: 0 0 auto;
}

.auth-footer a {
  color: #5d728e;
}

.auth-sent-state {
  width: min(100%, 390px);
  display: grid;
  justify-items: center;
  text-align: center;
}

.auth-sent-state > img {
  width: 160px;
  height: auto;
  margin-bottom: 26px;
}

.auth-sent-state .auth-form-heading p {
  max-width: 360px;
}

.auth-sent-state .auth-secondary-button {
  margin-top: 28px;
}

.auth-text-button {
  min-height: 42px;
  margin: 8px auto 0;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-navy);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.auth-text-button:hover {
  color: var(--auth-blue);
  background: var(--auth-blue-soft);
}

.onboarding-page-inner {
  min-height: 100dvh;
  padding: 0;
  display: block;
}

.onboarding-shell {
  width: 100%;
  min-height: 100dvh;
  padding: 30px clamp(28px, 6vw, 88px) 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
}

.onboarding-header {
  display: grid;
  grid-template-columns: 128px minmax(260px, 420px) 128px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.onboarding-header > a {
  display: inline-flex;
}

.onboarding-header > a img {
  width: 118px;
  height: auto;
}

.onboarding-progress {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.onboarding-progress > span {
  color: var(--auth-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.onboarding-progress > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.onboarding-progress i {
  height: 4px;
  display: block;
  background: #d8e1ec;
  border-radius: 999px;
}

.onboarding-progress i.is-active {
  background: var(--auth-blue);
}

.onboarding-content {
  position: relative;
  width: min(100%, 760px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 520px) 170px;
  align-items: center;
  gap: 46px;
}

.onboarding-main {
  min-width: 0;
}

.onboarding-main .auth-form-heading h1 {
  font-size: clamp(34px, 4vw, 44px);
}

.onboarding-form {
  margin-top: 28px;
}

.onboarding-art {
  width: 170px;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  align-self: center;
}

.onboarding-interests-form {
  width: min(100%, 560px);
}

.topic-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.topic-select-card {
  position: relative;
  min-width: 0;
  min-height: 110px;
  padding: 18px 12px 14px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--auth-navy);
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 18px;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.topic-select-card:hover {
  border-color: #a9c7ea;
  transform: translateY(-1px);
}

.topic-select-card.is-selected {
  background: #f0f7ff;
  border-color: var(--auth-blue);
}

.topic-select-card > img {
  width: 34px;
  height: 34px;
}

.topic-select-card strong {
  font-size: 13px;
  font-weight: 650;
}

.topic-select-check {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 50%;
}

.topic-select-check img {
  width: 12px;
  height: 12px;
  opacity: 0;
  filter: brightness(0) invert(1);
}

.topic-select-card.is-selected .topic-select-check {
  background: var(--auth-blue);
  border-color: var(--auth-blue);
}

.topic-select-card.is-selected .topic-select-check img {
  opacity: 1;
}

.onboarding-topic-error {
  margin-top: -7px;
}

@media (max-width: 1100px) {
  .auth-form-panel {
    padding-inline: 24px;
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(390px, 1.1fr);
  }

  .auth-visual {
    padding-inline: 32px;
  }

  .auth-visual-copy {
    margin-top: 52px;
  }

  .auth-visual-copy h2 {
    font-size: 40px;
  }

  .auth-visual-copy > p {
    font-size: 14px;
  }

  .auth-visual-art {
    right: 8px;
    width: min(62%, 330px);
    max-width: none;
    max-height: 50%;
  }

  .auth-form-panel {
    padding-inline: 24px;
  }

  .onboarding-content {
    gap: 28px;
  }
}

@media (max-width: 760px) {
  body.is-auth-page {
    background: #fff;
  }

  .auth-page {
    padding: 0;
    display: block;
    background: #fff;
  }

  .auth-page-inner,
  .onboarding-page-inner {
    min-height: 100dvh;
    padding: 0;
    display: block;
  }

  .auth-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 220px minmax(0, 1fr);
    border-radius: 0;
    box-shadow: none;
  }

  .auth-visual {
    min-height: 220px;
    padding: 20px;
  }

  .auth-visual::before {
    width: 390px;
    height: 390px;
    top: -190px;
    right: -120px;
  }

  .auth-logo-link img {
    width: 112px;
  }

  .auth-visual-copy {
    width: 55%;
    margin-top: 24px;
  }

  .auth-visual-copy h2 {
    max-width: 220px;
    font-size: 28px;
    line-height: 1.06;
  }

  .auth-visual-copy > p,
  .auth-visual-copy ul {
    display: none;
  }

  .auth-visual-art {
    right: 4px;
    bottom: -4px;
    width: 175px;
    height: auto;
    max-width: 47%;
    max-height: 174px;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .auth-visual--reset .auth-visual-copy {
    margin-top: 34px;
  }

  .auth-visual--reset .auth-visual-art {
    right: 30px;
    bottom: 8px;
    width: 90px;
    max-height: 130px;
  }

  .auth-form-panel {
    min-height: 0;
    padding: 30px 20px 26px;
  }

  .auth-mode-switch {
    display: none;
  }

  .auth-form-wrap {
    width: 100%;
    margin: 0 auto;
    padding: 0 0 34px;
    transform: none;
  }

  .auth-form-heading h1 {
    font-size: 32px;
  }

  .auth-form-heading p {
    font-size: 14px;
  }

  .auth-form {
    margin-top: 24px;
  }

  .auth-inline-switch {
    display: block;
  }

  .auth-footer {
    padding-top: 18px;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column-reverse;
    gap: 10px;
    white-space: normal;
  }

  .auth-footer > span:last-child {
    flex-wrap: wrap;
  }

  .auth-sent-state {
    margin-inline: auto;
    padding-top: 10px;
  }

  .auth-sent-state > img {
    width: 132px;
    margin-bottom: 20px;
  }

  .onboarding-shell {
    width: 100%;
    min-height: 100dvh;
    padding: 22px 20px 24px;
    border-radius: 0;
    box-shadow: none;
  }

  .onboarding-header {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 18px;
  }

  .onboarding-header > a img {
    width: 100px;
  }

  .onboarding-content {
    width: 100%;
    margin: 36px 0 auto;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .onboarding-main .auth-form-heading h1 {
    font-size: 32px;
  }

  .onboarding-art {
    position: absolute;
    top: -12px;
    right: 0;
    width: 86px;
    max-height: 112px;
    opacity: 0.98;
  }

  .onboarding-main .auth-form-heading {
    padding-right: 90px;
  }

  .topic-select-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  .auth-shell {
    grid-template-rows: 190px minmax(0, 1fr);
  }

  .auth-visual {
    min-height: 190px;
    padding: 16px 18px;
  }

  .auth-logo-link img {
    width: 100px;
  }

  .auth-visual-copy {
    margin-top: 18px;
  }

  .auth-visual-copy h2 {
    font-size: 22px;
  }

  .auth-visual-art {
    width: 158px;
    max-width: 48%;
    max-height: 154px;
  }

  .auth-form-panel {
    padding-inline: 18px;
  }

  .auth-form-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .onboarding-shell {
    padding-inline: 16px;
  }

  .onboarding-header {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 12px;
  }

  .onboarding-header > a img {
    width: 88px;
  }

  .topic-select-card {
    min-height: 104px;
    padding-inline: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
