.registration-flow[hidden],
.registration-profile-fields[hidden],
.registration-verification[hidden] { display: none !important; }

.registration-flow {
  display: grid;
  grid-template-columns: auto minmax(18px, 1fr) auto minmax(18px, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid #eceaf7;
  border-radius: 14px;
  color: #938ea9;
  background: linear-gradient(110deg, #faf9ff, #f7fbfc);
  font-size: 10px;
  letter-spacing: .02em;
}
.registration-flow span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.registration-flow span:first-of-type { color: #6458c9; }
.registration-flow b { font-size: 10px; font-weight: 650; }
.registration-flow i { height: 1px; background: linear-gradient(90deg, #dad5f2, #dcebec); }

.registration-profile-fields,
.registration-verification { display: grid; gap: 2px; margin-top: 15px; }
.registration-account-fields { display: grid; gap: 2px; margin-top: 15px; }
.registration-account-title[hidden] { display: none !important; }
.register-step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 5px; }
.register-step-title > span { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border: 1px solid #e7e2f8; border-radius: 9px; color: #6d5dcc; background: linear-gradient(145deg, #f3efff, #eefaff); font-size: 10px; font-weight: 750; }
.register-step-title strong, .register-step-title small { display: block; }
.register-step-title strong { color: #42445c; font-size: 12px; font-weight: 700; }
.register-step-title small { margin-top: 3px; color: #9091a6; font-size: 10px; line-height: 1.55; }
.registration-profile-fields .form-field { margin-top: 10px; }
.registration-profile-fields input { border-radius: 13px; transition: border-color .2s, box-shadow .2s, background .2s; }
.registration-profile-fields input:hover { border-color: #d5d0e8; background: #fdfcff; }
.registration-verification { margin: 16px 0 2px; padding: 13px; border: 1px solid #eceaf5; border-radius: 15px; background: linear-gradient(145deg, #fcfbff, #f7fbfd); }
.registration-verification .register-step-title { margin-bottom: 10px; }
.registration-verification + .auth-error { margin-top: 9px; }
.registration-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 10px 11px;
  border: 1px solid #f1dfb7;
  border-radius: 11px;
  color: #8a6a27;
  background: linear-gradient(135deg, #fffaf0, #fffdf7);
  font-size: 11px;
  line-height: 1.55;
}
.registration-status::before { content: '！'; display: grid; place-items: center; width: 17px; height: 17px; flex: 0 0 17px; border-radius: 50%; color: #9a7628; background: #ffedbf; font-size: 10px; font-weight: 800; }
.registration-status.ready { border-color: #cce9dc; color: #27745d; background: linear-gradient(135deg, #f4fcf8, #fbfffd); }
.registration-status.ready::before { content: '✓'; color: #2d8b6d; background: #dff5e9; }
.registration-status.checking { border-color: #dfe2f5; color: #6f7390; background: linear-gradient(135deg, #fafaff, #f8fbff); }
.registration-status.checking::before { content: '·'; color: #6c62c9; background: #e9e7ff; font-size: 16px; line-height: 12px; }
.registration-status[hidden] { display: none !important; }
.registration-code-box { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #eceaf5; }
.registration-code-box > label { color: #536078; font-size: 11px; font-weight: 700; }
.registration-code-row { display: flex; gap: 8px; }
.registration-code-row input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid #e4e5ee; border-radius: 12px; outline: none; color: #34364d; background: #fff; letter-spacing: .18em; transition: border-color .2s, box-shadow .2s; }
.registration-code-row input:focus { border-color: #aaa1ec; box-shadow: 0 0 0 3px rgba(116, 100, 219, .10); }
.registration-code-row input:disabled { color: #9a9caf; background: #f5f6fa; letter-spacing: normal; }
.resend-code-btn { flex: 0 0 auto; min-height: 42px; padding: 0 12px; border: 1px solid #e3e0f4; border-radius: 12px; color: #6257bd; background: #f8f7ff; font-size: 11px; font-weight: 650; }
.resend-code-btn:hover:not(:disabled) { border-color: #c9c2ee; background: #f1efff; }
.resend-code-btn:disabled { cursor: not-allowed; color: #a0a2b1; background: #f5f6fa; }
.registration-code-box > small { color: #8b8da1; font-size: 10px; line-height: 1.5; }

@media (max-width: 440px) {
  .registration-flow { gap: 6px; padding: 10px 9px; font-size: 9px; }
  .registration-flow span { gap: 3px; }
  .registration-flow b { font-size: 9px; }
  .registration-verification { padding: 10px; }
  .register-step-title small { font-size: 9px; }
  .registration-code-row { flex-wrap: wrap; }
  .resend-code-btn { flex: 1 1 100%; }
}
.auth-form-wrap .back-link { min-height: 34px; margin-bottom: 35px; padding: 0 11px; border: 1px solid #e8e6f0; border-radius: 11px; color: #73758b; background: rgba(255,255,255,.75); font-size: 11px; transition: color .18s, border-color .18s, background .18s; }
.auth-form-wrap .back-link:hover { border-color: #d7d0ed; color: #6155bb; background: #faf9ff; }
@media (prefers-reduced-motion: reduce) {
  .registration-profile-fields input { transition: none; }
}

/* Login and registration share the same card geometry; longer registration content scrolls inside it. */
.auth-view .auth-layout {
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 430px);
  width: min(980px, 100%);
  height: min(700px, calc(100dvh - 60px));
  min-height: min(570px, calc(100dvh - 60px));
}
.auth-view .auth-form-wrap {
  min-height: 0;
  max-height: min(700px, calc(100dvh - 60px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.auth-view.is-registering {
  align-items: center;
  padding-block: 30px;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(146, 132, 248, .12), transparent 34%),
    radial-gradient(ellipse at 88% 82%, rgba(106, 203, 216, .11), transparent 31%),
    #f7f8fc;
}
.auth-view.is-registering .auth-layout {
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 430px);
  width: min(980px, 100%);
  height: min(700px, calc(100dvh - 60px));
  min-height: min(570px, calc(100dvh - 60px));
  border-color: rgba(124, 130, 171, .16);
  border-radius: 27px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 28px 90px rgba(48, 59, 102, .12), 0 4px 16px rgba(48, 59, 102, .04);
}
.auth-view.is-registering .auth-intro {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 46px);
  background: linear-gradient(150deg, #eeedff 0%, #f3f5ff 48%, #eaf8f8 100%);
}
.auth-view.is-registering .auth-intro::after {
  position: absolute;
  right: -100px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(117, 108, 218, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(117, 108, 218, .035), 0 0 0 58px rgba(117, 108, 218, .025);
  content: "";
  pointer-events: none;
}
.auth-view.is-registering .auth-intro > div:nth-child(2) { position: relative; z-index: 1; }
.auth-view.is-registering .auth-intro h1 { margin-top: clamp(44px, 8vh, 90px); font-size: clamp(30px, 3.2vw, 39px); }
.auth-view.is-registering .auth-points { gap: 14px; }
.auth-view.is-registering .auth-point { font-size: 12px; }
.auth-view.is-registering .auth-form-wrap {
  min-height: 0;
  max-height: min(700px, calc(100dvh - 60px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px clamp(28px, 4vw, 52px) 30px;
  scrollbar-color: #d8d8eb transparent;
  scrollbar-width: thin;
}
.auth-view.is-registering .back-link { margin-bottom: 21px; }
.auth-view.is-registering .auth-form-wrap h2 { font-size: 29px; }
.auth-view.is-registering .auth-form-wrap > p { margin-bottom: 18px; }
.auth-view.is-registering .auth-tabs {
  gap: 5px;
  padding: 5px;
  border: 1px solid #eeedf5;
  border-radius: 14px;
  background: #f6f6fb;
}
.auth-view.is-registering .auth-tab { min-height: 40px; border-radius: 10px; font-weight: 650; }
.auth-view.is-registering #authForm > .form-field,
.auth-view.is-registering .registration-account-fields .form-field,
.auth-view.is-registering .registration-profile-fields .form-field { gap: 7px; margin-top: 12px; }
.auth-view.is-registering #authForm > .form-field label,
.auth-view.is-registering .registration-account-fields .form-field label,
.auth-view.is-registering .registration-profile-fields .form-field label { color: #4a536e; font-size: 11px; }
.auth-view.is-registering #authForm > .form-field input,
.auth-view.is-registering .registration-account-fields .form-field input,
.auth-view.is-registering .registration-profile-fields input {
  height: 46px;
  padding-inline: 14px;
  border-color: #e4e5ef;
  border-radius: 13px;
  background: #fff;
  font-size: 13px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.auth-view.is-registering #authForm > .form-field input:hover,
.auth-view.is-registering .registration-account-fields .form-field input:hover,
.auth-view.is-registering .registration-profile-fields input:hover { border-color: #cbc6e9; background: #fdfcff; }
.auth-view.is-registering #authForm > .form-field input:focus,
.auth-view.is-registering .registration-account-fields .form-field input:focus,
.auth-view.is-registering .registration-profile-fields input:focus,
.auth-view.is-registering .registration-code-row input:focus { border-color: #9185e8; box-shadow: 0 0 0 4px rgba(113, 99, 221, .1); }
.auth-view.is-registering .registration-flow {
  grid-template-columns: auto minmax(16px, 1fr) auto minmax(16px, 1fr) auto;
  gap: 12px;
  margin-bottom: 15px;
  padding: 12px 15px;
  border-color: #e9e7f4;
  border-radius: 13px;
  background: linear-gradient(110deg, #faf9ff, #f7fbfc);
  font-size: 10px;
}
.auth-view.is-registering .registration-flow span { gap: 7px; color: #767b91; }
.auth-view.is-registering .registration-flow span:first-of-type { color: #6659c7; }
.auth-view.is-registering .registration-flow b { font-size: 11px; }
.auth-view.is-registering .register-step-title { gap: 11px; margin-bottom: 8px; }
.auth-view.is-registering .register-step-title > span { width: 30px; height: 30px; flex-basis: 30px; border-radius: 10px; font-size: 11px; }
.auth-view.is-registering .register-step-title strong { color: #3d435a; font-size: 12px; }
.auth-view.is-registering .register-step-title small { color: #82899e; font-size: 10px; }
.auth-view.is-registering .registration-profile-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 13px;
  row-gap: 0;
  margin-top: 18px;
  padding: 14px 15px 15px;
  border: 1px solid #eeedf5;
  border-radius: 16px;
  background: linear-gradient(135deg, #fdfcff, #fbfdff);
}
.auth-view.is-registering .registration-profile-fields .register-step-title { grid-column: 1 / -1; }
.auth-view.is-registering .registration-profile-fields .form-field { min-width: 0; }
.auth-view.is-registering .registration-verification {
  margin-top: 14px;
  padding: 14px 15px;
  border-color: #e9e8f3;
  border-radius: 16px;
  background: linear-gradient(140deg, #fbfaff, #f8fcfd);
}
.auth-view.is-registering .registration-code-box { margin-top: 10px; padding-top: 11px; }
.auth-view.is-registering .registration-code-row input { height: 44px; border-radius: 12px; }
.auth-view.is-registering .resend-code-btn { min-height: 44px; border-radius: 12px; }
.auth-view.is-registering .auth-error:not(:empty):not(.success) {
  padding: 9px 11px;
  border: 1px solid #f2dadd;
  border-radius: 11px;
  color: #a84656;
  background: #fff8f8;
}
.auth-view.is-registering .auth-form-wrap .primary-btn { min-height: 47px; margin-top: 7px; border-radius: 13px; font-size: 13px; }
.auth-view.is-registering .auth-footnote { margin-top: 12px; font-size: 10px; }

/* Keep the auth flow calm: the card, tabs, and each registration step move together. */
.auth-view .auth-layout { animation: authLayoutIn .4s cubic-bezier(.2,.75,.2,1) both; }
.auth-view .auth-form-wrap { transition: background .3s ease, box-shadow .3s ease; }
.auth-view.is-registering .auth-form-wrap { background: radial-gradient(circle at 78% 8%, rgba(127, 111, 226, .08), transparent 30%), rgba(255,255,255,.95); }
.auth-view.is-registering .auth-intro { animation: authIntroIn .48s cubic-bezier(.2,.75,.2,1) both; }
.auth-view.is-registering .auth-form-wrap { animation: authFormIn .42s cubic-bezier(.2,.75,.2,1) both; }
.auth-view:not(.is-registering) .auth-form-wrap { animation: authFormIn .34s cubic-bezier(.2,.75,.2,1) both; }
.auth-view.is-registering .auth-tabs { box-shadow: 0 7px 18px rgba(89, 82, 168, .06); }
.auth-view.is-registering .auth-tab { transition: color .22s ease, background .22s ease, box-shadow .22s ease, transform .22s ease; }
.auth-view.is-registering .auth-tab:active { transform: scale(.98); }
.auth-view.is-registering .registration-flow { animation: stepIn .34s cubic-bezier(.2,.75,.2,1) .04s both; }
.auth-view.is-registering .registration-account-fields,
.auth-view.is-registering .registration-profile-fields:not([hidden]),
.auth-view.is-registering .registration-verification:not([hidden]) { animation: stepIn .34s cubic-bezier(.2,.75,.2,1) both; }
@keyframes authLayoutIn { from { opacity: 0; transform: translateY(8px) scale(.988); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes authIntroIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes authFormIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 920px) {
  .auth-view, .auth-view.is-registering { align-items: start; }
  .auth-view .auth-layout, .auth-view.is-registering .auth-layout { display: block; width: min(700px, 100%); height: auto; min-height: 0; }
  .auth-view .auth-intro, .auth-view.is-registering .auth-intro { display: none; }
  .auth-view .auth-form-wrap, .auth-view.is-registering .auth-form-wrap { max-height: calc(100dvh - 60px); padding: 30px clamp(22px, 6vw, 48px); }
}
@media (max-width: 720px) {
  .auth-view, .auth-view.is-registering { min-height: 100dvh; align-items: start; padding: 12px; }
  .auth-view .auth-layout, .auth-view.is-registering .auth-layout { width: 100%; height: auto; min-height: 0; border-radius: 22px; }
  .auth-view .auth-form-wrap, .auth-view.is-registering .auth-form-wrap { max-height: none; padding: 20px 18px 24px; }
  .auth-view .back-link, .auth-view.is-registering .back-link { margin-bottom: 17px; }
  .auth-view .auth-form-wrap h2, .auth-view.is-registering .auth-form-wrap h2 { font-size: 25px; }
  .auth-view.is-registering .registration-flow { gap: 7px; padding: 10px 9px; }
  .auth-view.is-registering .registration-flow b { font-size: 10px; }
}
@media (max-width: 440px) {
  .auth-view.is-registering .registration-profile-fields { grid-template-columns: 1fr; padding: 12px; }
  .auth-view.is-registering .registration-profile-fields .register-step-title { grid-column: 1; }
  .auth-view.is-registering .registration-code-row { flex-wrap: nowrap; }
  .auth-view.is-registering .resend-code-btn { flex: 0 0 auto; padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-view.is-registering #authForm > .form-field input,
  .auth-view.is-registering .registration-profile-fields input { transition: none; }
}

/* Four clear registration steps, plus a single accessible input rendered as six code slots. */
.registration-flow,
.auth-view.is-registering .registration-flow {
  grid-template-columns: auto minmax(7px, 1fr) auto minmax(7px, 1fr) auto minmax(7px, 1fr) auto;
  gap: 8px;
}
.registration-flow span { color: #85889d; transition: color .2s ease; }
.registration-flow span.is-active { color: #5f55c4 !important; }
.registration-flow span.is-done { color: #348d71 !important; }
.registration-flow span.is-done + i { background: linear-gradient(90deg, #9bd5bc, #dcebec); }
.registration-contact-fields { display: grid; gap: 2px; margin-top: 15px; }
.registration-contact-fields .form-field { margin-top: 10px; }
.auth-view.is-registering .registration-contact-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 13px;
  row-gap: 0;
  margin-top: 18px;
  padding: 14px 15px 15px;
  border: 1px solid #eeedf5;
  border-radius: 16px;
  background: linear-gradient(135deg, #fdfcff, #fbfdff);
}
.auth-view.is-registering .registration-contact-fields .register-step-title,
.auth-view.is-registering .registration-contact-fields .contact-field { grid-column: 1 / -1; }
.auth-view.is-registering .registration-contact-fields .form-field { min-width: 0; }
.auth-view.is-registering .registration-contact-fields input { height: 46px; padding-inline: 14px; border-color: #e4e5ef; border-radius: 13px; background: #fff; font-size: 13px; }
.registration-back-btn {
  width: 100%;
  min-height: 38px;
  margin-top: 7px;
  border: 1px solid #e7e5f0;
  border-radius: 12px;
  color: #777b91;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
  transition: color .18s, border-color .18s, background .18s;
}
.registration-back-btn:hover { border-color: #d2ccef; color: #5f55c4; background: #faf9ff; }
.registration-code-row { align-items: center; }
.code-slots-wrap { position: relative; flex: 1 1 auto; min-width: 0; height: 48px; }
.code-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; width: 100%; height: 100%; pointer-events: none; }
.code-slot { display: grid; place-items: center; min-width: 0; border: 1px solid #e1e2ec; border-radius: 12px; color: #383954; background: linear-gradient(145deg, #fff, #fbfbff); font-size: 20px; font-weight: 700; transition: border-color .18s, background .18s, box-shadow .18s, transform .18s; }
.code-slot.is-active { border-color: #9185e8; background: #fff; box-shadow: 0 0 0 3px rgba(113, 99, 221, .09); }
.code-slot.slot-pop { animation: codeSlotPop .25s cubic-bezier(.2,.9,.25,1.2) both; }
.registration-code-row .code-slots-input {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 12px !important;
  outline: 0 !important;
  color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: .015;
  caret-color: transparent;
  cursor: text;
}
.code-slots-wrap:focus-within .code-slot.is-active { border-color: #8174df; box-shadow: 0 0 0 3px rgba(113, 99, 221, .11); }
.registration-code-row .code-slots-input:disabled { cursor: not-allowed; }
.auth-view.is-registering .registration-contact-fields:not([hidden]) { animation: stepIn .34s cubic-bezier(.2,.75,.2,1) both; }
@keyframes codeSlotPop { from { transform: translateY(3px) scale(.9); opacity: .55; } to { transform: translateY(0) scale(1); opacity: 1; } }
@media (max-width: 440px) {
  .auth-view.is-registering .registration-contact-fields { grid-template-columns: 1fr; padding: 12px; }
  .auth-view.is-registering .registration-contact-fields .register-step-title,
  .auth-view.is-registering .registration-contact-fields .contact-field { grid-column: 1; }
  .code-slots { gap: 5px; }
  .code-slot { border-radius: 10px; font-size: 18px; }
  .code-slots-wrap { height: 45px; }
}
@media (prefers-reduced-motion: reduce) {
  .code-slot.slot-pop { animation: none; }
  .registration-flow span, .registration-back-btn { transition: none; }
}

/* Keep all six verification digits at a readable width; the resend action sits beneath them. */
.auth-view.is-registering .registration-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.auth-view.is-registering .registration-code-row .code-slots-wrap {
  width: 100%;
  min-width: 0;
  height: 52px;
}
.auth-view.is-registering .registration-code-row .resend-code-btn {
  justify-self: end;
  min-width: 126px;
  min-height: 38px;
}
.registration-email-status {
  display: block;
  margin-top: 7px;
  color: #737b91;
  font-size: 11px;
  line-height: 1.5;
}
.registration-email-status[hidden] { display: none !important; }
.registration-email-status[data-state="checking"] { color: #7770c4; }
.registration-email-status[data-state="available"] { color: #318365; }
.registration-email-status[data-state="exists"],
.registration-email-status[data-state="unsupported"],
.registration-email-status[data-state="error"] { color: #b54d5a; }
