html[data-public-language="en"] [data-language-menu] {
  display: none;
}

html[data-public-language="en"]:not([data-language-ready]) body {
  visibility: hidden;
}

:root {
  color-scheme: dark;
  --page-bg: #050e29;
  --text: #f6faff;
  --muted: #c5ddf8;
  --ice: #8addf6;
  --cyan: #41e5ff;
  --field-bg: #10294e;
  --focus: #fff09d;
  --control-height: 48px;
  font-family: "Segoe UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--text);
  background: var(--page-bg);
}

button, input {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  opacity: .62;
}

:where(a, button, input):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

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

.topbar {
  position: relative;
  isolation: isolate;
  background: #06112b;
  border-bottom: 1px solid #17628c;
}

.topbar::before,
.topbar::after {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: min(48%, 600px);
  content: "";
  background: linear-gradient(105deg, #0a1f3e 15%, #102d5a 73%, #143c72);
  clip-path: polygon(0 0, 100% 0, 67% 100%, 0 100%);
}

.topbar::after {
  inset-block-start: auto;
  height: 2px;
  clip-path: none;
  background: linear-gradient(90deg, #0b5e83, #09c9ff 45%, #166eea 68%, transparent);
}

.topbar-inner {
  width: min(1364px, calc(100% - 2 * clamp(14px, 4.15vw, 62px)));
  min-height: 64px;
  margin-inline: auto;
  padding-inline-start: min(1.5vw, 22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  inline-size: clamp(142px, 15.3vw, 220px);
  block-size: auto;
}

.topbar-actions,
.language-switcher {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: clamp(10px, 1.9vw, 28px);
}

.language-switcher {
  padding: 3px;
  gap: 1px;
  border: 1px solid #28547b;
  border-radius: 8px;
  background: #07182f;
}

.language-switcher button,
.back-home {
  display: inline-grid;
  min-height: 44px;
  padding: .25rem .72rem;
  place-items: center;
  white-space: nowrap;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e1edfc;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
}

.language-switcher button[aria-pressed="true"] {
  background: #163d64;
  color: var(--text);
  box-shadow: inset 0 -1px #56d1ff80;
}

.language-switcher button:hover {
  background: #23496f;
}

.back-home {
  min-height: 45px;
  padding-inline: clamp(12px, 1.55vw, 24px);
  border: 1px solid #cc8c2e;
  border-radius: 7px;
  color: #ffe180;
  font-size: 1.05rem;
}

.back-home:hover {
  background: #ffd96914;
}

.register-stage {
  display: grid;
  align-items: center;
  background:
    url("./hero.webp") center 46% / cover no-repeat,
    radial-gradient(ellipse at 38% 38%, #103e8a, #071d49 55%, var(--page-bg) 100%);
}

.register-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(53%, 590px));
  width: min(1320px, calc(100% - 2 * clamp(24px, 5vw, 76px)));
  margin-inline: auto;
  padding-block: clamp(22px, 4svh, 48px);
}

.register-card {
  grid-column: 2;
  min-width: 0;
  padding: clamp(22px, 3.5svh, 36px) clamp(24px, 3vw, 40px) 20px;
  border: 2px solid #79e5ff;
  border-radius: 26px;
  background: linear-gradient(159deg, #071f43f7, #04132efa 59%, #04224bfd);
  box-shadow: 0 0 14px #32b5ff49, inset 0 0 18px #1a6cb728;
}

.register-card h1 {
  margin: 0 0 clamp(16px, 2.5svh, 25px);
  color: var(--text);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.17;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 3px 8px #020e29;
  text-wrap: balance;
}

.form-fields {
  display: grid;
  gap: clamp(12px, 1.85svh, 18px);
}

.form-fields[hidden] {
  display: none;
}

.password-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: clamp(8px, 1vw, 14px);
}

.form-field > label {
  display: block;
  margin-block-end: 6px;
  font-size: clamp(1rem, 1.32vw, 1.18rem);
  line-height: 1.35;
  font-weight: 700;
}

.form-field input,
.phone-field,
.secondary-button {
  min-height: var(--control-height);
  border: 1.5px solid var(--ice);
  border-radius: 10px;
}

.form-field input,
.phone-field {
  width: 100%;
  min-width: 0;
  background: var(--field-bg);
}

.form-field input {
  padding: 0 .75em;
  color: var(--text);
  font-size: clamp(1rem, 1.32vw, 1.18rem);
  letter-spacing: .02em;
}

#invite-code[readonly] {
  border-color: #828282;
  background: #363636;
  color: #ededed;
  caret-color: transparent;
  cursor: default;
}

.form-field input[aria-invalid="true"],
.phone-field:has(#phone[aria-invalid="true"]) {
  border-color: #ff9e99;
}

.phone-field,
.sms-field {
  display: flex;
}

.phone-field input {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0 9px 9px 0;
  background: transparent;
}

.phone-prefix {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: .4em;
  min-width: clamp(94px, 9.5vw, 128px);
  padding: 0 .75em;
  border-right: 1.5px solid var(--ice);
  color: var(--text);
  font-size: clamp(.95rem, 1.22vw, 1.1rem);
  font-weight: 700;
  white-space: nowrap;
}

.sms-field {
  gap: clamp(8px, .84vw, 13px);
}

.sms-field input {
  flex: 1;
}

.secondary-button {
  min-width: 0;
  padding-inline: clamp(10px, 1.45vw, 22px);
  background: #0b2145;
  color: #d8efff;
  font-size: clamp(.92rem, 1.26vw, 1.12rem);
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.secondary-button:not(:disabled):hover {
  background: #173e6a;
}

.gold-button {
  width: 100%;
  min-height: clamp(50px, 7.8svh, 64px);
  padding: .35em 1em;
  border: 2px solid #fff3b4;
  border-radius: 14px;
  background: linear-gradient(143deg, #ffeb98 0%, #ffcc50 42%, #f1a628 77%, #f7ae2e 100%);
  color: #352102;
  font-size: clamp(1.35rem, 2.15vw, 1.95rem);
  font-weight: 800;
  line-height: 1.15;
  box-shadow: 0 0 13px #ffcf7182, inset 0 0 10px #fff7ba9e;
}

.gold-button:not(:disabled):hover {
  filter: brightness(1.08);
}

.register-card form > .gold-button {
  margin-top: clamp(18px, 2.9svh, 28px);
}

.status-message {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.status-message:not(:empty) {
  margin-top: 9px;
}

.status-message:is([data-state="error"], .is-error) {
  color: #ffbdb5;
}

.status-message:is([data-state="success"], .is-success) {
  color: #9ff2c8;
}

.form-status {
  text-align: center;
}

.login-prompt {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .36em;
  margin: 9px 0 0;
  text-align: center;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.4;
}

.login-prompt :is(a, button),
.auth-text-button {
  display: inline-grid;
  min-height: 44px;
  padding: 0 .2em;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--cyan);
  font-weight: 700;
  text-underline-offset: .17em;
  text-decoration: underline;
}

:is(.login-prompt a, .login-prompt button, .auth-text-button):hover {
  color: #c4f8ff;
}

.dialog-close-button {
  display: inline-grid;
  inline-size: 44px;
  block-size: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #9decff;
  background: transparent;
}

.dialog-close-button:hover { background: #245280; }
.dialog-close-button svg { inline-size: 32px; block-size: 32px; }

.login-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 .65rem;
  margin-top: 4px;
  font-size: .88rem;
}

.register-card .login-options + .gold-button {
  margin-top: 4px;
}

.support-dialog {
  width: min(430px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: clamp(14px, 5vw, 24px);
  border: 1px solid var(--ice);
  border-radius: 20px;
  background: #071c3d;
  color: var(--text);
  box-shadow: 0 0 28px #36b8ff52;
}

.support-dialog::backdrop {
  background: #020a1dc7;
}

.support-telegram:not([hidden]) {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--cyan);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.slider-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.slider-dialog {
  width: min(330px, calc(100% - 16px));
  max-width: none;
  max-height: calc(100% - 24px);
  padding: 12px clamp(10px, calc((100vw - 300px) / 2), 24px) 8px;
  border: 1px solid #33485f;
  border-radius: 17px;
  background: #101d2e;
  color: var(--text);
  box-shadow: 0 18px 56px #0009;
}

.slider-dialog::backdrop {
  background: #020817ab;
}

.slider-dialog .slider-header {
  margin-bottom: 8px;
}

.slider-dialog h2 {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
  outline: none;
}

.slider-dialog .dialog-close-button {
  margin-inline-end: -8px;
  color: #adc1d4;
}

.slider-dialog .dialog-close-button:hover {
  background: #20334a;
  color: var(--text);
}

.slider-dialog .dialog-close-button svg {
  inline-size: 22px;
  block-size: 22px;
}

.slider-instructions {
  margin: 0;
  color: #adc1d4;
  font-size: .75rem;
  line-height: 1.4;
}

/* Captcha Pro sets its widget spacing and shape inline. Keep its pixel coordinates intact. */
#slider-stage.captcha-slider {
  --cp-bg: transparent;
  --cp-shadow: none;
  --cp-track-bg: #1b2e43;
  --cp-track-border: transparent;
  --cp-thumb-bg: #95e5ee;
  --cp-thumb-border: #95e5ee;
  --cp-hint-color: #d3e3ee;
  width: max-content !important;
  margin-inline: auto;
  padding: 0 !important;
  overflow: visible !important;
}

.slider-stage .captcha-image-container {
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px #779db335;
}

.slider-stage .captcha-image-container canvas + canvas {
  filter: drop-shadow(0 0 1px #d8f8ffc9) drop-shadow(0 2px 3px #071322bb);
}

.slider-stage .captcha-slider-track {
  height: 44px !important;
  margin-top: 10px !important;
  overflow: hidden;
  border-radius: 10px !important;
  outline-color: var(--focus) !important;
  outline-offset: -2px !important;
}

.slider-stage .captcha-slider-progress {
  height: 44px !important;
  border-radius: 10px !important;
}

.slider-stage .captcha-slider-btn {
  top: 4px !important;
  border-radius: 7px !important;
  cursor: grab !important;
  touch-action: none;
}

.slider-stage .captcha-slider-btn.dragging {
  cursor: grabbing !important;
}

.slider-stage .captcha-slider-btn path[fill="#1991fa"] {
  fill: #0f2c3d;
}

.slider-stage .captcha-slider-hint {
  font-size: .8125rem !important;
  font-weight: 600;
  white-space: nowrap;
}

.slider-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.slider-refresh {
  flex: none;
  min-height: 44px;
  margin-inline-end: -6px;
  padding-inline: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #95e5ee;
  font-size: .8125rem;
  font-weight: 650;
}

.slider-refresh:not(:disabled):hover {
  background: #20334a;
}

@media (max-width: 970px) {
  .register-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, min(60%, 520px));
  }
}

@media (min-width: 741px) {
  .login-page .register-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, min(60%, 510px));
  }
}

@media (max-width: 740px) {
  :root {
    --control-height: 44px;
  }

  .topbar-inner {
    width: calc(100% - 24px);
    min-height: 54px;
    padding: 3px 0;
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 4px;
  }

  .brand-logo {
    inline-size: clamp(104px, 24vw, 152px);
  }

  .topbar-actions {
    gap: 6px;
  }

  .language-switcher {
    padding: 0;
  }

  .language-switcher button,
  .back-home {
    min-height: 44px;
    min-width: 44px;
    padding-inline: .35rem;
    font-size: .75rem;
  }

  .register-stage {
    align-items: start;
    background-size: auto clamp(295px, 58vw, 460px), cover;
    background-position: 0 -125px, center;
  }

  .register-layout {
    display: block;
    width: min(505px, calc(100% - 28px));
    padding-block: clamp(36px, 9svh, 90px) 22px;
  }

  .register-card {
    padding: 20px clamp(16px, 5vw, 30px) 14px;
    border-radius: 21px;
  }

  .register-card h1 {
    font-size: clamp(1.55rem, 5.8vw, 2.05rem);
  }

  .phone-prefix {
    min-width: 85px;
  }
}

@media (max-width: 740px) and (min-height: 740px) {
  .register-layout {
    padding-top: clamp(90px, 14svh, 120px);
  }

  .register-stage {
    background-position: 0 -72px, center;
  }
}

@media (max-width: 740px) and (max-height: 739px) {
  .register-page .register-layout {
    padding-block: 22px 10px;
  }
}
