:root {
  color-scheme: light;
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #193b45;
  background: #eef3f4;
  line-height: 1.5;
  --teal: #175563;
  --result: #eef6ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 25%, #fbfcfc 0%, transparent 67%),
              linear-gradient(120deg, #edf1f3 12%, #eff5f4 68%, #e6eeef);
}
main { width: min(100% - 36px, 552px); margin-inline: auto; padding: clamp(40px, 13vh, 132px) 0 40px; }
.auth-card { overflow: hidden; border: 1px solid #c6d3d7; border-radius: 22px; background: #fff; box-shadow: 0 18px 44px -26px #163b4b50, 0 2px 6px #2d414e10; }
.cover {
  isolation: isolate; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 152px; padding: 24px 28px 24px 36px;
  color: #f5fbff; background: linear-gradient(108deg, #11253d 12%, #14334a 64%, #18495b);
}
.cover::before {
  content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background-image: linear-gradient(#91c9d21c 1px, transparent 1px),
                    linear-gradient(90deg, #91c9d21c 1px, transparent 1px);
  background-size: 18px 18px; background-position: center;
  mask-image: linear-gradient(90deg, transparent 12%, #0009 58%, #000);
}
.cover-copy { min-width: 0; }
h1 { margin: 0; font-size: clamp(1.8rem, 5.1vw, 2.55rem); font-weight: 700; line-height: 1.2; letter-spacing: -.035em; }
.cover-copy p { margin: 10px 0 0; color: #bed8df; font-size: .89rem; line-height: 1.6; text-wrap: pretty; }
.security-chip { display: block; flex: none; width: 132px; height: auto; }
.card-body { padding: 27px 36px 32px; }
label, h2 { margin: 0; font-size: .95rem; font-weight: 680; }
.field { display: flex; align-items: center; margin-top: 8px; border: 1px solid #91a79a; border-radius: 10px; background: #fbfcfa; }
.field:focus-within { outline: 3px solid #15644b; outline-offset: 2px; }
.field:has(input[aria-invalid="true"]) { border-color: #b23a35; }
input, button { font: inherit; }
input { min-width: 0; flex: 1; height: 51px; padding: 0 14px; border: 0; border-radius: inherit; background: transparent; color: #18382f; outline: none; }
input::placeholder { color: #596e62; opacity: 1; }
button { min-height: 44px; cursor: pointer; font-weight: 640; touch-action: manipulation; }
button:focus-visible { outline: 3px solid #15644b; outline-offset: 3px; }
button:disabled { cursor: default; }
#clear { padding: 0 12px; margin-right: 3px; border: 0; border-radius: 7px; color: #3d6555; background: transparent; font-size: .82rem; }
#clear:disabled { visibility: hidden; }
#clear:hover { color: #173d30; text-decoration: underline; }
#feedback { margin: 0; color: #a12e2c; font-size: .89rem; }
#feedback:not(:empty), noscript { display: block; margin-top: 9px; }
#submit { width: 100%; margin-top: 14px; min-height: 49px; border: 1px solid #164e5a; border-radius: 10px; color: #fff; background: var(--teal); }
#submit:hover { background: #114955; }
#submit:active { background: #0c3842; }
#result { margin-top: 22px; padding: 17px 20px 18px; border: 1px solid #d3e3d5; border-radius: 12px; background: var(--result); }
.result-top, .result-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#remaining { font-size: .82rem; color: #416652; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-line { margin: 8px 0 12px; flex-wrap: wrap; }
#code { font: 600 clamp(2.15rem, 7.5vw, 3.2rem)/1.16 "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: -.035em; color: #12483c; white-space: pre; font-variant-numeric: tabular-nums; }
#copy { flex-shrink: 0; padding: 0 12px; border-radius: 8px; border: 1px solid #a2b8a8; color: #24513f; background: #f8fcf7; font-size: .84rem; }
#copy:hover { background: #dfeddf; }
#copy:disabled { opacity: .56; }
progress { display: block; appearance: none; width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; background: #d3e2d5; color: #438765; }
progress::-webkit-progress-bar { background: #d3e2d5; }
progress::-webkit-progress-value { background: #438765; }
progress::-moz-progress-bar { background: #438765; }
@media (max-width: 30rem) {
  main { width: calc(100% - 28px); padding-top: clamp(28px, 8vh, 64px); }
  .auth-card { border-radius: 17px; }
  .cover { min-height: 126px; padding: 20px; gap: 10px; }
  .cover-copy p { margin-top: 8px; font-size: .82rem; }
  .security-chip { width: clamp(66px, 21vw, 100px); }
  .card-body { padding: 21px 20px 23px; }
  #result { padding: 14px; }
  #code { font-size: clamp(1.9rem, 8.9vw, 2.45rem); }
}
@media (max-width: 22rem) {
  .cover { padding-inline: 15px; }
  .card-body { padding-inline: 15px; }
}
