:root {
  --bg: #050510;
  --text: #ffffff;
  --muted: #b7c0d9;
  --cyan: #7dd3fc;
  --green: #4dff8a;
  --glass: rgba(12, 16, 36, 0.48);
  --glass-border: rgba(140, 190, 255, 0.42);
  --field: rgba(8, 12, 28, 0.72);
  --field-border: rgba(170, 190, 230, 0.32);
  --radius: 16px;
  --grad: linear-gradient(90deg, #e879f9 0%, #8b5cf6 48%, #3b82f6 100%);
  --font: "Outfit", system-ui, sans-serif;
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font-family: inherit;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #050510;
  background-image:
    linear-gradient(90deg, rgba(5, 6, 18, 0.42) 0%, rgba(5, 6, 18, 0.12) 36%, transparent 58%),
    url("../img/background.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 56px 30px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.site-header.is-success {
  justify-content: center;
}

.brand {
  text-decoration: none;
  display: block;
  width: fit-content;
  line-height: 0;
  filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.45));
}

.brand img {
  display: block;
  height: clamp(64px, 8vw, 88px);
  width: auto;
  border-radius: 50%;
}

.header-tagline {
  text-align: right;
  padding-top: 10px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.header-tagline.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.tagline-main {
  font-size: 12px;
  letter-spacing: 0.32em;
  font-weight: 600;
}

.tagline-main span {
  color: #93c5fd;
  margin: 0 7px;
}

.tagline-sub {
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.stage {
  flex: 1;
  display: grid;
  position: relative;
}

.view {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 132px);
}

.view-register,
.view-success {
  transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), filter 0.65s ease;
}

.view-register.is-leaving {
  opacity: 0;
  transform: translateY(-24px) scale(0.98);
  filter: blur(6px);
  pointer-events: none;
}

.view-success {
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  pointer-events: none;
}

.view-success.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.view[hidden] {
  display: none;
}

.copy-block {
  max-width: 620px;
  margin: 22px 0 26px;
}

h1 {
  font-size: clamp(34px, 4.2vw, 50px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.gradient-text {
  display: block;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

.lede {
  margin-top: 12px;
  max-width: 500px;
  color: #c5cde3;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
}

.register-layout {
  width: min(430px, 100%);
  flex: 1;
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 32px rgba(80, 130, 255, 0.12);
  backdrop-filter: blur(16px);
}

.entry-card {
  padding: 24px 24px 18px;
  animation: cardIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.entry-card.shake {
  animation: shake 0.42s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.user-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(160deg, #e879f9, #7c3aed 58%, #4f46e5);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.5);
  flex-shrink: 0;
}

.user-badge svg {
  width: 20px;
  height: 20px;
}

.card-head h2 {
  font-size: 18px;
  font-weight: 600;
}

.card-head p {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.field {
  position: relative;
  display: block;
  margin-bottom: 10px;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #a8b4d4;
  pointer-events: none;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 42px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field);
  color: var(--text);
  font-size: 14.5px;
  outline: none;
  appearance: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field select {
  cursor: pointer;
  color: #8b96b5;
}

.field select:valid {
  color: var(--text);
}

.field select option {
  background: #12162a;
  color: var(--text);
}

.field input::placeholder {
  color: #8b96b5;
}

.field input:hover,
.field select:hover {
  border-color: rgba(147, 197, 253, 0.5);
}

.field input:focus,
.field select:focus {
  border-color: rgba(125, 211, 252, 0.85);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16), 0 0 18px rgba(168, 85, 247, 0.18);
  color: var(--text);
}

.field.is-invalid input,
.field.is-invalid select {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.14);
}

.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #a8b4d4;
  pointer-events: none;
}

.field-error {
  color: #fca5a5;
  font-size: 12.5px;
  margin: 0 2px 10px;
}

.btn-gradient {
  position: relative;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--grad);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.38);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-gradient:hover {
  transform: translateY(-1px) scale(1.015);
  box-shadow: 0 14px 34px rgba(59, 130, 246, 0.42), 0 0 24px rgba(216, 70, 239, 0.28);
}

.btn-gradient:active {
  transform: scale(0.99);
}

.btn-gradient.is-loading {
  pointer-events: none;
}

.btn-gradient.is-loading .btn-label,
.btn-gradient.is-loading .btn-arrow,
.btn-gradient.is-loading .home-icon {
  opacity: 0;
}

.btn-spinner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: white;
  border-radius: 50%;
  opacity: 0;
}

.btn-gradient.is-loading .btn-spinner {
  opacity: 1;
  animation: spin 0.7s linear infinite;
}

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

.btn-arrow {
  font-size: 18px;
  transition: transform 0.25s ease;
}

.btn-gradient:hover .btn-arrow {
  transform: translateX(4px);
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.secure-note svg {
  width: 15px;
  height: 15px;
  color: #7dd3fc;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 28px;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: #d5def6;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-line {
  display: block;
  width: 132px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, transparent);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.75);
}

.footer-right {
  letter-spacing: 0.28em;
}

.view-success {
  align-items: center;
  text-align: center;
}

.success-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0 12px;
}

.view-success h1,
.view-success .lede {
  max-width: 640px;
}

.view-success .lede {
  margin-left: auto;
  margin-right: auto;
  color: #d7deef;
}

.check-cluster {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
}

.check-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  z-index: 1;
}

.check-glow {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(77, 255, 138, 0.28), transparent 68%);
  filter: blur(6px);
}

.check-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.check-svg {
  width: 148px;
  height: 148px;
  filter: drop-shadow(0 0 14px rgba(77, 255, 138, 0.8));
}

.check-ring-outer {
  fill: none;
  stroke: rgba(77, 255, 138, 0.35);
  stroke-width: 2;
}

.check-ring {
  fill: none;
  stroke: var(--green);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
}

.check-mark {
  fill: none;
  stroke: var(--green);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}

.view-success.is-active .check-ring {
  animation: draw 0.7s 0.12s ease forwards;
}

.view-success.is-active .check-mark {
  animation: draw 0.45s 0.5s ease forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: floaty 4.2s ease-in-out infinite;
}

.orb-a { width: 8px; height: 8px; background: #60a5fa; top: 10px; left: 18px; box-shadow: 0 0 10px #60a5fa; }
.orb-b { width: 6px; height: 6px; background: #e879f9; top: 22px; right: 16px; animation-delay: -0.8s; box-shadow: 0 0 10px #e879f9; }
.orb-c { width: 10px; height: 10px; background: #4dff8a; bottom: 18px; left: 8px; animation-delay: -1.4s; box-shadow: 0 0 12px #4dff8a; }
.orb-d { width: 5px; height: 5px; background: #93c5fd; bottom: 28px; right: 10px; animation-delay: -2s; box-shadow: 0 0 8px #93c5fd; }
.orb-e { width: 7px; height: 7px; background: #c084fc; top: 54%; left: -6px; animation-delay: -2.6s; box-shadow: 0 0 10px #c084fc; }
.orb-f { width: 6px; height: 6px; background: #38bdf8; top: 48%; right: -4px; animation-delay: -1.1s; box-shadow: 0 0 10px #38bdf8; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50% { transform: translateY(-10px); opacity: 1; }
}

.confirm-card {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 500px;
  width: 100%;
  margin: 26px auto 20px;
  padding: 14px 18px;
  text-align: left;
}

.confirm-card p {
  color: #e4eaf8;
  font-size: 14.5px;
  line-height: 1.5;
}

.mail-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.22);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.28);
}

.mail-icon svg {
  width: 18px;
  height: 18px;
}

.btn-home {
  max-width: 260px;
}

.home-icon svg {
  width: 18px;
  height: 18px;
}

.success-footer {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.success-footer .tagline-main {
  letter-spacing: 0.32em;
}

.burst-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  animation: burst 1.05s ease-out forwards;
}

@keyframes burst {
  to {
    transform: translate(var(--x), var(--y)) scale(0.2);
    opacity: 0;
  }
}

@media (max-width: 980px) {
  .app {
    padding: 18px 22px 22px;
  }

  .bg {
    background-position: 70% center;
  }

  .register-layout {
    width: min(430px, 100%);
    margin: 0 auto;
  }

  .copy-block {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .copy-block .lede {
    margin-left: auto;
    margin-right: auto;
  }

  .site-footer.register-footer {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
  }

  .progress-line {
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: center;
  }

  .header-tagline {
    text-align: center;
    padding-top: 4px;
  }

  .brand img {
    height: 62px;
  }

  .entry-card {
    padding: 20px 16px 16px;
  }

  h1 {
    font-size: 32px;
  }
}
