/* 自助登录：一张入场券。票根选平台，撕线下填账号，成功时盖章。 */

:root {
  /* 舞台 */
  --stage: #2b2cc0;
  --stage-2: #1d1e8f;
  --spot: #6668ff;
  /* 票面 */
  --paper: #f5f6fc;
  --paper-2: #ffffff;
  --ink: #17183d;
  --ink-2: #565985;
  --ink-3: #868aae;
  --line: #d6d8ed;
  --perf: #c2c5e3;
  /* 动作与印章 */
  --accent: #2b2cc0;
  --accent-press: #22239f;
  --stamp: #e0306a;
  --danger: #c4294a;

  --notch: 14px;
  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans SC", "Noto Sans KR", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --stage: #15166a;
    --stage-2: #0c0d45;
    --spot: #3436b8;
    --paper: #eceefa;
    --paper-2: #f8f9ff;
  }
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

/* 韩文按词换行，不在词中间断开 */
html:lang(ko) {
  word-break: keep-all;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--stage-2);
  background-image:
    radial-gradient(110% 62% at 50% -10%, var(--spot) 0%, transparent 62%),
    linear-gradient(180deg, var(--stage) 0%, var(--stage-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) 16px max(36px, env(safe-area-inset-bottom));
}

/* ---- 票 ---- */

.ticket {
  width: 100%;
  max-width: 420px;
  display: grid;
  /* 票身两半都被 mask 挖了缺口，阴影只能用 drop-shadow 打在外层 */
  filter: drop-shadow(0 28px 36px rgba(8, 9, 60, 0.38)) drop-shadow(0 2px 3px rgba(8, 9, 60, 0.22));
}

.stub,
.body {
  grid-column: 1;
  background: var(--paper);
}

.stub {
  grid-row: 1;
  border-radius: 18px 18px 0 0;
  padding: 18px 22px 24px;
  -webkit-mask:
    radial-gradient(circle at 0 100%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 100%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle at 0 100%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 100%, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
}

.body {
  grid-row: 2;
  position: relative;
  border-radius: 0 0 18px 18px;
  padding: 28px 22px 22px;
  -webkit-mask:
    radial-gradient(circle at 0 0, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 0, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle at 0 0, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 0, transparent var(--notch), #000 calc(var(--notch) + 0.5px)) right / 51% 100% no-repeat;
}

/* 撕线 */
.body::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--notch) + 8px);
  right: calc(var(--notch) + 8px);
  border-top: 2px dashed var(--perf);
}

/* ---- 票根 ---- */

.stub__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.lang {
  display: flex;
  gap: 2px;
  margin-right: -8px;
}

.lang button {
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-3);
  font: 600 13px/1 var(--sans);
  cursor: pointer;
}

.lang button:hover {
  color: var(--ink);
}

.lang button[aria-pressed="true"] {
  color: var(--ink);
  background: rgba(23, 24, 61, 0.07);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  min-height: 40px;
}

.platform {
  min-height: 40px;
  padding: 0 15px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 600 14px/1 var(--sans);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.platform:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.platform[aria-checked="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.platforms__loading {
  align-self: center;
  font-size: 14px;
  color: var(--ink-3);
}

.event {
  margin: 22px 0 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(46px, 14vw, 60px);
  line-height: 0.92;
  letter-spacing: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---- 票身：表单 ---- */

.steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-3);
}

.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.steps li + li::before {
  content: "";
  width: 22px;
  height: 1.5px;
  margin-right: 2px;
  background: var(--line);
}

.steps__n {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  font: 700 12px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}

.steps li.is-current {
  color: var(--ink);
  font-weight: 600;
}

.steps li.is-current .steps__n {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.steps li.is-done .steps__n {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.input {
  position: relative;
}

.field input {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--ink);
  font: 400 16px/1.25 var(--sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input::placeholder {
  color: #a9acc8;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(43, 44, 192, 0.14);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px rgba(196, 41, 74, 0.14);
}

.input--pw input {
  padding-right: 76px;
}

.reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--accent);
  font: 600 13px/1 var(--sans);
  cursor: pointer;
}

.field input.code {
  padding: 12px 14px;
  font: 700 32px/1.1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-align: center;
}

/* 占位文字用正文字号，不跟验证码的大号等宽字与字距 */
.field input.code::placeholder {
  font: 400 16px/1.1 var(--sans);
  letter-spacing: 0;
  text-indent: 0;
}

.sent {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

.sent b {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.code-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 20px;
}

.link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 14px/1.4 var(--sans);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link:disabled {
  color: var(--ink-3);
  text-decoration: none;
  cursor: default;
}

/* Turnstile 人机校验：平时不可见（高度 0），需要点选时才出现在按钮上方 */
.ts--on {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

.error {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--danger);
}

.cta {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: 700 16px/1 var(--sans);
  cursor: pointer;
  transition: background-color 0.15s;
}

.cta:hover {
  background: var(--accent-press);
}

.cta:active {
  transform: translateY(1px);
}

.cta:disabled {
  opacity: 0.7;
  cursor: progress;
  transform: none;
}

.empty {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ---- 完成 ---- */

.done__title {
  margin: 0 0 8px;
  padding-right: 108px; /* 给印章让位 */
  font-size: 20px;
  line-height: 1.35;
}

.done__text {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-2);
}

.done__text b {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ghost {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: 600 15px/1 var(--sans);
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--ink-3);
}

/* ---- 印章：盖在撕线上 ---- */

.stamp {
  grid-row: 2;
  grid-column: 1;
  justify-self: end;
  align-self: start;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 4px;
  width: 112px;
  height: 112px;
  margin: -50px 16px 0 0;
  border: 3px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5.5px currentColor;
  color: var(--stamp);
  text-align: center;
  opacity: 0.9;
  transform: rotate(-14deg);
  mix-blend-mode: multiply;
  pointer-events: none;
  /* 油墨颗粒 */
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -3.2 2.7'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -3.2 2.7'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

.stamp__word {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
}

.stamp__word:lang(en) {
  font: 800 19px/1 var(--display);
}

.stamp__date {
  font: 700 13px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.stamp.is-in {
  animation: stamp-down 0.42s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

@keyframes stamp-down {
  0% {
    opacity: 0;
    transform: scale(1.75) rotate(-3deg);
  }
  60% {
    opacity: 0.95;
    transform: scale(0.94) rotate(-15deg);
  }
  100% {
    opacity: 0.9;
    transform: scale(1) rotate(-14deg);
  }
}

/* ---- 焦点与动效偏好 ---- */

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cta:focus-visible {
  outline-color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .stamp.is-in {
    animation: none;
  }
  * {
    transition: none !important;
  }
}

@media (max-width: 360px) {
  .stub,
  .body {
    padding-left: 18px;
    padding-right: 18px;
  }
  .done__title {
    padding-right: 96px;
  }
  .stamp {
    width: 100px;
    height: 100px;
    margin-right: 10px;
  }
}
