:root {
  --brand: #4a82f0;
  --brand-dark: #2f6ae0;
  --ink: #0b1220;
  --muted: #6b7686;
  --surface: rgba(255, 255, 255, 0.72);
  --border: rgba(17, 30, 60, 0.08);
  --radius: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  height: 100%;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 1.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #eef3fb;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Ambient background */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(160deg, #f3f7fe 0%, #e7eefb 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: drift 18s var(--ease) infinite alternate;
}

.blob-1 {
  width: 460px; height: 460px;
  background: #6e9bff;
  top: -120px; left: -100px;
}

.blob-2 {
  width: 380px; height: 380px;
  background: #a9c4ff;
  bottom: -120px; right: -80px;
  animation-delay: -6s;
}

.blob-3 {
  width: 300px; height: 300px;
  background: #cfe0ff;
  top: 40%; left: 55%;
  animation-delay: -11s;
}

@keyframes drift {
  to { transform: translate3d(40px, -30px, 0) scale(1.12); }
}

/* Stage / card */
.stage {
  width: 100%;
  max-width: 440px;
  perspective: 1200px;
}

.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  padding: 2.75rem 2.25rem;
  text-align: center;
  box-shadow:
    0 1px 1px rgba(17, 30, 60, 0.04),
    0 18px 50px -12px rgba(47, 106, 224, 0.22);
  animation: rise 0.7s var(--ease) both;
}

.card[hidden] {
  display: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo */
.logo-wrap {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.6rem;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: var(--brand);
  box-shadow:
    0 10px 24px -8px rgba(74, 130, 240, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.logo-wrap.small {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  margin: 1.8rem auto 0;
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 32ch;
  margin: 0 auto 2rem;
}

/* Form */
form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field {
  position: relative;
}

.field input {
  width: 100%;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.1rem 0.55rem;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
}

.field label {
  position: absolute;
  left: 1.15rem;
  top: 0.95rem;
  font-size: 1rem;
  color: var(--muted);
  pointer-events: none;
  transform-origin: left center;
  transition: transform 0.22s var(--ease), color 0.22s var(--ease);
}

.field input:focus,
.field input:not(:placeholder-shown) {
  background: #fff;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(74, 130, 240, 0.16);
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  transform: translateY(-0.7rem) scale(0.74);
  color: var(--brand);
}

/* Button */
button[type="submit"] {
  position: relative;
  display: grid;
  place-items: center;
  height: 54px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 8px 20px -6px rgba(47, 106, 224, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s;
}

button[type="submit"] > span {
  grid-area: 1 / 1;
}

button[type="submit"]:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 26px -6px rgba(47, 106, 224, 0.6);
}

button[type="submit"]:active {
  transform: scale(0.975);
}

button[type="submit"]:disabled {
  cursor: default;
  filter: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s var(--ease);
  animation: spin 0.7s linear infinite;
}

button.loading .btn-label {
  opacity: 0;
}

button.loading .spinner {
  opacity: 1;
  transform: scale(1);
}

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

.error {
  min-height: 1.1em;
  font-size: 0.86rem;
  color: #e1483b;
  transition: opacity 0.2s;
}

.footnote {
  margin-top: 1.4rem;
  font-size: 0.8rem;
  color: #97a0af;
}

/* Thank-you */
.thanks .subtitle {
  margin-bottom: 0;
}

.check-ring {
  width: 92px;
  height: 92px;
  margin: 0 auto 1.6rem;
  display: grid;
  place-items: center;
}

.check-svg {
  width: 92px;
  height: 92px;
}

.check-circle {
  stroke: var(--brand);
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 0.6s var(--ease) 0.1s forwards;
}

.check-mark {
  stroke: var(--brand);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 44;
  stroke-dashoffset: 44;
  animation: draw 0.4s var(--ease) 0.55s forwards;
}

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

@media (max-width: 480px) {
  .card { padding: 2.25rem 1.5rem; }
  h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .check-circle, .check-mark { stroke-dashoffset: 0; }
}
