* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100svh;
  background: #07070a;
  color: #eef0f5;
  font-family: "Manrope", sans-serif;
  overflow-x: hidden;
  position: relative;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.aurora {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 20% 15%, rgba(101, 121, 194, 0.28), transparent 70%),
    radial-gradient(42% 36% at 82% 78%, rgba(156, 121, 214, 0.2), transparent 70%),
    radial-gradient(30% 30% at 70% 10%, rgba(120, 170, 210, 0.16), transparent 70%);
  filter: blur(60px);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.06); }
}

.dust {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 30% 70%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 60% 35%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 80% 60%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 92% 15%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 45% 85%, rgba(255, 255, 255, 0.3), transparent);
  background-size: 100% 100%;
  animation: rise 18s linear infinite;
}

@keyframes rise {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 0 -60px, 0 -90px, 0 -40px, 0 -70px, 0 -100px, 0 -50px; }
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
}

.panel {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 36px 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: rise-in 0.6s ease both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mark svg {
  width: 84px;
  height: 84px;
  filter: drop-shadow(0 6px 18px rgba(150, 170, 220, 0.35));
}

.tagline {
  margin: 18px 0 2px;
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: #b9c2d6;
}

h1 {
  margin: 4px 0 10px;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.01em;
  color: #f7f8fb;
}

.lede {
  margin: 0 0 26px;
  font-size: 14.5px;
  line-height: 1.55;
  color: #9aa2b4;
}

#key-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#key {
  width: 100%;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #f7f8fb;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#key::placeholder {
  color: #6b7180;
  letter-spacing: normal;
}

#key:focus {
  outline: none;
  border-color: #8fb3e8;
  box-shadow: 0 0 0 3px rgba(143, 179, 232, 0.2);
}

#key-submit {
  position: relative;
  padding: 15px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: #10131a;
  background: linear-gradient(120deg, #f6f9fd, #c7cede 40%, #8b97a8 60%, #eef2f8);
  background-size: 220% 220%;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-position 0.4s ease;
}

#key-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(180, 195, 220, 0.25);
  background-position: 100% 0%;
}

#key-submit:active:not(:disabled) {
  transform: translateY(0);
}

#key-submit:disabled {
  cursor: default;
  opacity: 0.75;
}

.btn-spinner {
  display: none;
  position: absolute;
  right: 16px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  border-radius: 50%;
  border: 2px solid rgba(16, 19, 26, 0.25);
  border-top-color: #10131a;
  animation: spin 0.7s linear infinite;
}

#key-submit.is-loading .btn-spinner {
  display: block;
}

#key-submit.is-loading .btn-label {
  opacity: 0.55;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 13.5px;
  color: #f2a5a5;
}

.status:empty {
  margin: 0;
}

.hatch-line {
  margin: 22px 0 0;
  font-size: 13px;
  color: #808896;
}

.hatch-line a {
  color: #b9c2d6;
}

.privacy {
  width: 100%;
  max-width: 420px;
  color: #808896;
  font-size: 13px;
}

.privacy summary {
  cursor: pointer;
  text-align: center;
  color: #9aa2b4;
  padding: 6px 0;
  list-style: none;
}

.privacy summary::-webkit-details-marker {
  display: none;
}

.privacy summary::after {
  content: "▾";
  margin-left: 6px;
}

.privacy[open] summary::after {
  content: "▴";
}

.privacy-body {
  padding: 12px 4px 4px;
  line-height: 1.6;
}

.privacy-body p + p {
  margin-top: 10px;
}

@media (min-width: 640px) {
  .panel {
    padding: 44px 40px;
  }

  h1 {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .dust, .panel {
    animation: none;
  }
}
