:root {
  --bg: #0f1221;
  --bg-soft: #171c31;
  --night-bg: #0f2565;
  --panel: #f8f5ed;
  --panel-muted: #e6dfcf;
  --ink: #151728;
  --muted: #64687d;
  --line: #d7cfbd;
  --accent: #7a5cff;
  --accent-dark: #4d36c9;
  --danger: #b43b46;
  --shadow: 0 24px 70px rgba(7, 10, 27, 0.22);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(122, 92, 255, 0.2), transparent 28%),
    linear-gradient(135deg, #0f1221 0%, #20223a 52%, #2e293a 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

a {
  color: inherit;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(122, 92, 255, 0.14);
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.app-shell {
  min-height: 100vh;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
}

.button--primary {
  background: var(--accent);
  color: white;
}

.button--primary:hover {
  background: var(--accent-dark);
}

.button--secondary {
  background: var(--ink);
  color: white;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
}

.back-link {
  position: absolute;
  top: 24px;
  left: 24px;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 16px;
  background: rgba(248, 245, 237, 0.9);
  text-decoration: none;
  font-weight: 800;
}

.disclaimer {
  color: var(--muted);
  font-size: 0.95rem;
}

.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;
}

.form-message {
  min-height: 24px;
  color: var(--accent-dark);
  font-weight: 700;
}

.night-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 18%, rgba(48, 84, 195, 0.26), transparent 32%),
    radial-gradient(circle at 76% 78%, rgba(30, 58, 168, 0.18), transparent 34%),
    linear-gradient(180deg, #0b1d4f 0%, #10266f 52%, #0a1b50 100%);
  pointer-events: none;
}

.night-sky::before,
.night-sky::after {
  position: absolute;
  inset: -12%;
  content: "";
  background-repeat: repeat;
  transform: translate3d(0, 0, 0);
}

.night-sky::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 0.55px, transparent 0.9px),
    radial-gradient(circle, rgba(244, 248, 255, 0.86) 0 0.65px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.68) 0 0.45px, transparent 0.8px);
  background-position: 5px 8px, 41px 27px, 96px 54px;
  background-size: 68px 74px, 104px 98px, 154px 136px;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45));
  opacity: 0.7;
  animation: starDrift 32s ease-in-out infinite alternate, starGlitter 4.2s ease-in-out infinite alternate;
}

.night-sky::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.96) 0 0.85px, transparent 1.25px),
    radial-gradient(circle, rgba(241, 246, 255, 0.68) 0 0.7px, transparent 1.1px);
  background-position: 18px 16px, 88px 68px;
  background-size: 178px 166px, 236px 211px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.58));
  opacity: 0.34;
  animation: starDriftSlow 38s ease-in-out infinite alternate, starTwinkle 4.8s ease-in-out infinite alternate;
}

.shooting-star {
  display: none;
}

@keyframes starDrift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-26px, 18px, 0);
  }
}

@keyframes starDriftSlow {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(28px, 16px, 0) scale(1.01);
  }
}

@keyframes starGlitter {
  from {
    opacity: 0.48;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.36));
  }

  to {
    opacity: 0.86;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.62));
  }
}

@keyframes starTwinkle {
  from {
    opacity: 0.18;
  }

  to {
    opacity: 0.48;
  }
}

@keyframes shootingStar {
  0%,
  72% {
    opacity: 0;
    transform: translate3d(-20vw, -6vh, 0) rotate(-22deg) scaleX(0.45);
  }

  76% {
    opacity: 1;
    transform: translate3d(22vw, 7vh, 0) rotate(-22deg) scaleX(1);
  }

  86% {
    opacity: 0.84;
  }

  100% {
    opacity: 0;
    transform: translate3d(130vw, 38vh, 0) rotate(-22deg) scaleX(1.26);
  }
}

@media (max-width: 720px) {
  .back-link {
    top: 12px;
    left: 12px;
  }
}
