body[data-page="member-auth"] { background: #e8f4f5; }
body[data-page="member-auth"] :is(.masthead, .bottom-nav, .site-footer) { display: none; }
body[data-page="member-auth"] .container { width: min(100%, 492px); margin: 0 auto; padding-bottom: 0; }

.member-auth-screen {
  --auth-paper: #f5fafb;
  --auth-ink: #103c45;
  --auth-muted: #476570;
  --auth-teal: #007d75;
  --auth-gutter: clamp(20px, 6.5vw, 32px);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-width: 0;
  overflow: hidden;
  background: #006d70;
  color: var(--auth-ink);
}
.member-auth-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(158px, 49vw, 220px);
  padding: calc(11px + env(safe-area-inset-top, 0px)) var(--auth-gutter) 60px;
  background: radial-gradient(ellipse at 89% 110%, #0bb4a6, transparent 52%), linear-gradient(147deg, #066368 4%, #006269 58%, #008c87);
  color: #fff;
}
.member-auth-hero::before {
  position: absolute;
  z-index: -2;
  inset: auto auto -46px -16%;
  width: 82%;
  height: 95px;
  border-radius: 48% 52% 0 0;
  background: #34c7b650;
  transform: rotate(8deg);
  content: "";
}
.member-auth-back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-start: -24px;
  border-radius: 12px;
}
.member-auth-back:hover { background: #ffffff1b; }
.member-auth-back:focus-visible { outline-color: #a8fdf2; }
.member-auth-back .icon { width: 22px; height: 22px; transform: rotate(180deg); }
.member-auth-brand { position: relative; width: 49%; margin-top: clamp(4px, 2.25vw, 14px); }
.member-auth-brand img { display: block; width: clamp(104px, 28vw, 128px); max-width: 100%; height: auto; }
.member-auth-brand p { margin-top: 8px; color: #d8f1f0; font-size: clamp(.75rem, 3.3vw, .9rem); line-height: 1.4; overflow-wrap: anywhere; }
.member-auth-art {
  position: absolute;
  z-index: -1;
  right: 3%;
  bottom: 14px;
  width: 50%;
  aspect-ratio: 331 / 247;
  /* Use the crown and lottery ball from the reference, leaving its form and logo to HTML. */
  background: url("./photos/member-auth-reference.png") no-repeat;
  background-size: calc(125400% / 331) calc(125400% / 247);
  background-position: calc(27300% / (1254 - 331)) calc(11400% / (1254 - 247));
  mask-image: linear-gradient(to right, transparent, #000 14% 96%, transparent),
    linear-gradient(to bottom, transparent, #000 8% 92%, transparent);
  mask-composite: intersect;
}

.member-auth-surface {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: -30px;
  padding: 37px var(--auth-gutter) calc(clamp(22px, 5dvh, 40px) + env(safe-area-inset-bottom, 0px));
}
.member-auth-surface::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--auth-paper);
  clip-path: polygon(0 33px, 1% 23px, 2.5% 16px, 5% 10px, 8% 6px, 13% 3px, 19% 1px, 26% 0,
    32% 1px, 39% 4px, 46% 9px, 54% 15px, 62% 21px, 69% 25px, 75% 27px, 81% 27px,
    86% 25px, 91% 22px, 94% 20px, 96% 21px, 98% 25px, 99% 30px, 100% 38px, 100% 100%, 0 100%);
  content: "";
}
.member-auth-surface h1 { font-size: clamp(1.3125rem, 5.4vw, 1.6875rem); font-weight: 800; line-height: 1.25; }
.member-auth-intro { margin-top: 5px; color: var(--auth-muted); font-size: .875rem; font-weight: 500; line-height: 1.5; }
.member-auth-form { margin-top: clamp(18px, 5vw, 26px); }
.member-auth-fields { display: grid; gap: 10px; }
.member-auth-field {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding-inline: 13px 4px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: linear-gradient(110deg, #ebf3f5, #edf5f6);
  color: var(--auth-teal);
}
.member-auth-field > .icon { width: 19px; height: 19px; stroke-width: 2; }
.member-auth-field:focus-within { border-color: #30a69c; background: #edf8f8; }
.member-auth-field input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--auth-ink);
  font-size: 16px;
}
.member-auth-field input::placeholder { color: #587581; opacity: 1; }
.member-auth-email { grid-template-columns: 19px minmax(0, 1fr); padding-inline-end: 13px; }
.member-auth-code input { font-variant-numeric: tabular-nums; }
.member-auth-send-code {
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 10px;
  background: #d6ebe8;
  color: #075e59;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.3;
}
.member-auth-send-code:hover:not(:disabled) { background: #c4e3df; }
.member-auth-send-code:disabled { color: #4d6866; cursor: wait; }
@media (max-width: 360px) {
  .member-auth-send-code { padding-inline: 5px; }
}
.member-auth-visibility {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  color: #567580;
}
.member-auth-visibility .icon { width: 20px; height: 20px; }
.member-auth-visibility:hover { background: #d2ecec; color: var(--auth-teal); }
.member-auth-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; margin-top: 3px; }
.member-auth-remember,
.member-auth-options > a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; }
.member-auth-remember {
  display: inline-grid;
  grid-template-columns: 18px auto;
  column-gap: 8px;
  color: var(--auth-muted);
  cursor: pointer;
}
.member-auth-remember input {
  grid-area: 1 / 1;
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid #6a8c91;
  border-radius: 50%;
  background: var(--auth-paper);
}
.member-auth-remember input:checked { border-color: var(--auth-teal); background: var(--auth-teal); }
.member-auth-remember .icon { grid-area: 1 / 1; justify-self: center; width: 12px; height: 12px; color: #fff; visibility: hidden; pointer-events: none; stroke-width: 2.8; }
.member-auth-remember input:checked + .icon { visibility: visible; }
.member-auth-hint { margin-top: 10px; color: var(--auth-muted); font-size: .8125rem; line-height: 1.5; }
.member-auth-agreements { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 9px; margin-top: 14px; color: var(--auth-muted); font-size: .8125rem; line-height: 1.5; }
.member-auth-agreements input { width: 18px; height: 18px; margin: 5px 0 0; accent-color: var(--auth-teal); cursor: pointer; }
.member-auth-agreements label { cursor: pointer; }
.registration-policy-link { display: inline; padding: 4px 2px; color: var(--deep-teal); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.registration-policy-links { display: flex; flex-wrap: wrap; gap: 8px 15px; font-size: .875rem; }
.member-policy-copy .member-policy-version { font-size: .8125rem; }
.member-policy-copy section { display: grid; gap: 4px; }
.member-policy-copy h3 { font-size: 1rem; }
.member-auth-form .form-error { margin-top: 8px; }
.member-auth-submit {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 47px;
  margin-top: clamp(14px, 4vw, 22px);
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(103deg, #0b7478, #0b8071 52%, #129773);
  box-shadow: inset 0 1px 4px #62d4bc80, 0 7px 16px #0647431a;
  color: #fff;
  font-size: .9375rem;
  font-weight: 750;
  text-align: center;
}
.member-auth-submit:hover:not(:disabled) { background: linear-gradient(105deg, #076d74, #087d64); }
.member-auth-form[data-member-auth="register"] .member-auth-submit { margin-top: clamp(19px, 5.5vw, 26px); }
.member-auth-switch { margin-top: clamp(24px, 7dvh, 56px); color: var(--auth-muted); font-size: .875rem; text-align: center; }
.member-auth-form[data-member-auth="register"] + .member-auth-switch { margin-top: clamp(14px, 4dvh, 32px); }
.member-auth-switch a, .member-auth-options > a { color: var(--auth-teal); font-weight: 750; }
.member-auth-switch a { display: inline-flex; align-items: center; min-height: 44px; }
.member-auth-switch a:hover, .member-auth-options a:hover { text-decoration: underline; }

@media (max-width: 1023px) {
  body[data-page="member-auth"] .page-scroll { grid-row: 1 / -1; scrollbar-gutter: auto; }
}

@media (min-width: 600px) {
  body[data-page="member-auth"] .container { width: min(calc(100% - 48px), 492px); margin-block: 24px; }
  .member-auth-screen { min-height: min(690px, calc(100dvh - 48px)); border-radius: 24px; box-shadow: 0 8px 24px #0b566325; }
  .member-auth-surface { padding-bottom: 32px; }
}
