/* Shared registration form: a desktop dialog and a dedicated mobile page. */
.registration-page,
.registration-dialog {
  --register-gold: #e5c184;
  --register-text: #f2e8da;
  --register-muted: #b7a99b;
  --register-line: #64442e;
  color: var(--register-text);
}

body.registration-page {
  min-height: 100vh;
  min-height: 100svh;
  background:
    linear-gradient(180deg, #12080bd9, #100b0ef5 78%),
    url('../images/mu-season21/bg_header.jpg') center top / cover fixed;
}

.registration-shell {
  width: min(880px, calc(100% - 40px));
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: 28px 0 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.registration-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 9px;
  min-height: 44px;
  margin: 0 0 8px;
  color: #d8c6b0;
  font-size: 13px;
  transition: color .18s;
}

.registration-back svg {
  width: 18px;
  height: 18px;
}

.registration-dialog {
  width: min(880px, calc(100% - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 1px solid #9b7446;
  border-radius: 7px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #7c573c #1b1113;
  background: #170f12;
  box-shadow: 0 28px 100px #000c, 0 0 0 4px #1b100dbc;
}

.registration-dialog::backdrop {
  background: #090507d9;
  backdrop-filter: blur(6px);
}

.registration-dialog[open] {
  animation: registration-reveal .2s ease-out;
}

.registration-card {
  position: relative;
  display: grid;
  grid-template-columns: 35% minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #9b7446;
  border-radius: 6px;
  background: #170f12;
  box-shadow: inset 0 1px #f5d69b40, 0 18px 70px #0007;
}

.registration-dialog .registration-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.registration-art {
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border-right: 1px solid #86613c80;
  background:
    radial-gradient(ellipse at 48% 44%, #9c472760, transparent 68%),
    linear-gradient(160deg, #351917, #1b0d11 58%, #110b0e);
}

.registration-art::before {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 13px;
  border: 1px solid #a77a393b;
  pointer-events: none;
}

.registration-art::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 40%, #180d10a6 65%, #140c0f 85%);
}

.registration-logo {
  position: absolute;
  z-index: 2;
  top: 35px;
  left: 50%;
  width: 218px;
  max-width: 82%;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 5px #000b);
}

.registration-character {
  position: absolute;
  top: 130px;
  left: 50%;
  width: 770px;
  max-width: none;
  height: auto;
  transform: translateX(-52%);
  filter: drop-shadow(0 14px 20px #0009);
}

.registration-art-copy {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 40px;
  left: 28px;
  text-align: center;
}

.registration-kicker {
  display: block;
  color: var(--register-gold);
  font-family: Arial, Tahoma, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.registration-art-copy strong {
  display: block;
  margin: 11px 0 10px;
  color: #f6e4c6;
  font-size: 24px;
  line-height: 1.45;
  font-weight: 700;
  text-shadow: 0 2px 8px #000;
}

.registration-art-copy p {
  margin: 0;
  color: #b9a693;
  font-size: 12px;
  line-height: 1.85;
}

.registration-form-panel {
  position: relative;
  min-width: 0;
  padding: 30px 38px 24px;
  background:
    radial-gradient(ellipse at 100% 0, #5e231e2b, transparent 62%),
    linear-gradient(145deg, #211619, #160f12 65%);
}

.registration-heading {
  padding-right: 12px;
  margin-bottom: 22px;
}

.registration-heading h1,
.registration-heading h2 {
  margin: 5px 0 7px;
  color: #f6e9d5;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.5px;
}

.registration-heading .registration-intro {
  margin: 0;
  color: var(--register-muted);
  font-size: 12px;
  line-height: 1.7;
}

.registration-close {
  position: absolute;
  z-index: 4;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 0;
  border-radius: 3px;
  color: #b9a693;
  background: transparent;
}

.registration-close svg {
  width: 20px;
  height: 20px;
}

.registration-form,
.registration-fields,
.registration-field {
  min-width: 0;
}

.registration-fields {
  display: grid;
  gap: 14px;
}

.registration-field label {
  display: block;
  margin-bottom: 6px;
  color: #e2d1bc;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 1px;
}

.registration-field label span {
  margin-left: 7px;
  color: var(--register-muted);
  font-weight: 400;
  letter-spacing: 0;
}

.registration-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.registration-field input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #614735;
  border-radius: 3px;
  outline: none;
  background: #100c0e;
  box-shadow: inset 0 2px 5px #0005;
  color: #f4ebdf;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  transition: border-color .18s, box-shadow .18s;
}

.registration-input-wrap:has(.field-icon) input {
  padding-left: 41px;
}

.registration-input-wrap:has(.password-toggle) input {
  padding-right: 48px;
}

.registration-field input::placeholder {
  color: #847669;
  opacity: 1;
  font-size: 12px;
}

.registration-field input:focus {
  border-color: #c89d59;
  box-shadow: 0 0 0 3px #c79b4c1c, inset 0 2px 5px #0004;
}

.registration-field input[aria-invalid='true'] {
  border-color: #d57161;
}

.registration-field input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px #d5716125;
}

.registration-field input:-webkit-autofill {
  -webkit-text-fill-color: #f4ebdf;
  caret-color: #f4ebdf;
  box-shadow: inset 0 0 0 100px #211a18;
}

.field-icon {
  position: absolute;
  z-index: 1;
  left: 13px;
  display: flex;
  align-items: center;
  width: 17px;
  height: 17px;
  color: #ad9168;
  pointer-events: none;
}

.field-icon svg,
svg.field-icon {
  width: 17px;
  height: 17px;
}

.password-toggle,
.captcha-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 12px;
  border: 0;
  border-radius: 2px;
  color: #b8a182;
  background: transparent;
  transition: background .18s, color .18s;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 1px;
  transform: translateY(-50%);
}

.password-toggle svg,
.captcha-refresh svg {
  width: 19px;
  height: 19px;
}

.registration-field .field-hint,
.registration-field .field-error {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.registration-field .field-hint {
  color: #a99b8d;
}

.registration-field .field-error {
  color: #f1a08f;
}

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

.captcha-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.captcha-challenge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 44px;
  padding-left: 16px;
  overflow: hidden;
  border: 1px solid #795536;
  border-radius: 3px;
  background:
    repeating-linear-gradient(-35deg, transparent 0 9px, #bd8d3d08 9px 10px),
    linear-gradient(120deg, #37251b, #23191a);
}

.captcha-challenge [data-captcha-question] {
  color: #f2d194;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  white-space: nowrap;
}

.captcha-refresh {
  border-left: 1px solid #79553666;
  border-radius: 0;
}

.registration-submit {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-height: 76px;
  margin-top: 20px;
  padding: 16px 54px;
  border: 0;
  border-radius: 3px;
  background: url('../images/mu-buttons/register-submit.svg') center / 100% 100% no-repeat;
  filter: drop-shadow(0 5px 5px #0009) drop-shadow(0 0 6px #90290d33);
  color: #ffebbb;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 2px 2px #080203, 0 0 12px #e295363b;
  transition: filter .2s, transform .15s;
}

.registration-submit::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 14px 12%;
  pointer-events: none;
  background: radial-gradient(ellipse, #e8722538, transparent 72%);
  opacity: 0;
  transition: opacity .2s;
}

.registration-submit-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.35;
  white-space: nowrap;
}

.registration-submit-copy small {
  color: #cda66d;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 2.6px;
}

.registration-submit .registration-submit-arrow {
  flex: none;
  width: 25px;
  height: 25px;
  color: #d6af6b;
  filter: drop-shadow(0 1px 1px #000);
  transition: transform .2s, color .2s;
}

.registration-submit:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(.95) drop-shadow(0 2px 3px #0009);
}

.registration-submit:disabled {
  cursor: wait;
  opacity: .7;
}

.registration-feedback {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid #796139;
  border-radius: 3px;
  background: #a9803812;
  color: #ebd5af;
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.registration-feedback:empty {
  display: none;
}

.registration-feedback[data-state='success'],
.registration-feedback.is-success {
  border-color: #597654;
  background: #57754815;
  color: #c0dbb4;
}

.registration-feedback[data-state='error'],
.registration-feedback.is-error {
  border-color: #a65e4c;
  background: #a65e4c12;
  color: #f1af9e;
}

.registration-note {
  margin: 12px 0 0;
  color: #a7998c;
  font-size: 11px;
  line-height: 1.75;
  text-align: center;
}

.registration-footer {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #59412e80;
  color: #aa9886;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.registration-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  color: #ddbd83;
  text-underline-offset: 4px;
}

.registration-page [hidden],
.registration-dialog [hidden] {
  display: none !important;
}

.registration-page :is(a, button):focus-visible,
.registration-dialog :is(a, button):focus-visible {
  outline: 2px solid #edc783;
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .registration-back:hover,
  .registration-footer a:hover {
    color: #fff0cb;
  }

  .registration-footer a:hover {
    text-decoration: underline;
  }

  .registration-close:hover,
  .password-toggle:hover,
  .captcha-refresh:hover {
    color: #f2d6a4;
    background: #d5af6020;
  }

  .registration-submit:hover:not(:disabled) {
    filter: brightness(1.15) drop-shadow(0 5px 5px #0009) drop-shadow(0 0 10px #ba4b2359);
  }

  .registration-submit:hover:not(:disabled)::after {
    opacity: 1;
  }

  .registration-submit:hover:not(:disabled) .registration-submit-arrow {
    color: #ffe4a7;
    transform: translateX(3px);
  }
}

@keyframes registration-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .registration-form-panel {
    padding-right: 28px;
    padding-left: 28px;
  }

  .registration-art-copy {
    right: 20px;
    left: 20px;
  }

  .registration-art-copy strong {
    font-size: 22px;
  }
}

@media (max-width: 700px) {
  body.registration-page {
    background-attachment: scroll;
  }

  .registration-shell {
    width: min(480px, calc(100% - 28px));
    min-height: 100svh;
    padding: 10px 0 24px;
    justify-content: flex-start;
  }

  .registration-back {
    margin-bottom: 5px;
  }

  .registration-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }

  .registration-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .registration-art {
    height: 140px;
    border-right: 0;
    border-bottom: 1px solid #86613c80;
    background: radial-gradient(ellipse at 76% 35%, #a6503259, transparent 65%), #231114;
  }

  .registration-art::before {
    inset: 8px;
  }

  .registration-art::after {
    background: linear-gradient(90deg, #1c1012 0, #1c1012c9 35%, transparent 75%);
  }

  .registration-logo {
    top: 10px;
    left: 21px;
    width: 125px;
    max-width: 46%;
    transform: none;
  }

  .registration-character {
    top: -18px;
    left: 67%;
    width: 450px;
    transform: translateX(-50%);
  }

  .registration-art-copy {
    right: auto;
    bottom: 19px;
    left: 24px;
    max-width: 57%;
    text-align: left;
  }

  .registration-art-copy .registration-kicker {
    display: none;
  }

  .registration-art-copy strong {
    margin: 5px 0 0;
    font-size: 16px;
    line-height: 1.5;
  }

  .registration-art-copy p {
    display: none;
  }

  .registration-form-panel {
    padding: 25px 23px 18px;
  }

  .registration-heading {
    margin-bottom: 21px;
    padding-right: 0;
  }

  .registration-heading h1,
  .registration-heading h2 {
    font-size: 26px;
  }

  .registration-heading .registration-intro {
    font-size: 12px;
  }

  .registration-field input {
    min-height: 46px;
    font-size: 16px;
  }

  .registration-field input::placeholder {
    font-size: 12px;
  }

  .registration-field .field-hint,
  .registration-field .field-error {
    font-size: 12px;
  }

  .registration-close {
    top: 9px;
    right: 9px;
    color: #f0dab2;
    background: #130b0ec9;
  }

  .captcha-challenge {
    min-height: 46px;
    padding-left: 12px;
  }

  .captcha-controls {
    gap: 8px;
  }

  .captcha-challenge [data-captcha-question] {
    font-size: 19px;
    letter-spacing: 1px;
  }

  .registration-submit {
    min-height: 70px;
    padding: 14px 38px;
    gap: 12px;
    font-size: 17px;
  }

  .registration-footer a {
    min-height: 44px;
  }
}

@media (max-width: 360px) {
  .registration-shell {
    width: calc(100% - 20px);
  }

  .registration-form-panel {
    padding-right: 17px;
    padding-left: 17px;
  }

  .captcha-controls {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    gap: 7px;
  }

  .captcha-challenge {
    padding-left: 8px;
  }

  .captcha-challenge [data-captcha-question] {
    font-size: 18px;
    letter-spacing: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .registration-dialog[open] {
    animation: none;
  }

  .registration-page *,
  .registration-dialog * {
    transition: none;
  }
}
