* {
  box-sizing: border-box;
  font-family: "Segoe UI", Arial, sans-serif;
}

:root {
  --content-width: 900px;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #0f172a;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 500px at -8% -15%, rgba(37, 99, 235, 0.18), transparent 60%),
    radial-gradient(900px 420px at 105% -10%, rgba(124, 58, 237, 0.16), transparent 58%),
    linear-gradient(180deg, #f8faff 0%, #eef3ff 55%, #edf7ff 100%);
  background-size: 120% 120%, 120% 120%, 100% 100%;
  animation: bgFloat 14s ease-in-out infinite alternate;
}

body.modal-open {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: 12%;
  left: -120px;
  background: #60a5fa;
  animation: orbLeft 12s ease-in-out infinite alternate;
}

body::after {
  bottom: -80px;
  right: -120px;
  background: #a78bfa;
  animation: orbRight 14s ease-in-out infinite alternate;
}

.container {
  width: min(960px, 94vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.hero {
  width: min(var(--content-width), 100%);
  margin: 0 auto 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(139, 92, 246, 0.12));
  border: 1px solid #d8e4ff;
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.24), transparent 40%, rgba(255, 255, 255, 0.18));
  opacity: 0.55;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-18deg);
  animation: heroSweep 6.5s linear infinite;
  pointer-events: none;
}

h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.7vw, 2.3rem);
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #0b1b45;
  text-align: center;
  white-space: nowrap;
}

.cards {
  width: min(var(--content-width), 100%);
  margin: 30px auto 0;
}

.card {
  background: linear-gradient(180deg, #ffffff, #f9fbff);
  border: 1px solid #d9e5f5;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -40px;
  top: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.16), transparent 68%);
  animation: blobFloat 6s ease-in-out infinite alternate;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.14);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

h2 {
  margin: 4px 0 14px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #17367f;
  text-align: center;
  letter-spacing: 0.2px;
}

form {
  width: min(560px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.username-search-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  align-items: stretch;
}

label {
  font-size: 16px;
  font-weight: 700;
  color: #1f2f57;
  margin-top: 2px;
  letter-spacing: 0.1px;
}

input::placeholder {
  color: #66748f;
  font-size: 15px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cfd8e8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
  width: 100%;
  min-height: 54px;
  border: 1px solid #cfd8e8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 6px 18px rgba(37, 99, 235, 0.12);
}

select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 6px 18px rgba(37, 99, 235, 0.12);
}

button {
  justify-self: center;
  width: 230px;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #1d4ed8, #7c3aed);
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.28);
  transition: transform 0.08s ease, filter 0.15s ease;
  position: relative;
  overflow: hidden;
}

button::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -120%;
  width: 48%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-20deg);
  transition: left 0.45s ease;
}

button:hover::after {
  left: 130%;
}

button:hover {
  filter: brightness(1.06);
  animation: btnPulse 1s ease-in-out infinite alternate;
}

button:active {
  transform: translateY(1px);
}

form.is-submitting button {
  cursor: wait;
}

form.is-submitting button:disabled {
  opacity: 0.88;
  filter: saturate(0.85);
}

.ok {
  margin-top: 12px;
  background: linear-gradient(180deg, #ecfdf5, #dcfce7);
  border: 1px solid #86efac;
  color: #065f46;
  border-radius: 10px;
  padding: 12px;
}

.error {
  margin-top: 12px;
  background: linear-gradient(180deg, #fef2f2, #fee2e2);
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 10px;
  padding: 12px;
}

.search-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 0;
  font-size: 15px;
}

.support-note {
  margin-top: auto;
  width: min(var(--content-width), 100%);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  :root {
    --content-width: 100%;
  }

  .container {
    width: 95vw;
    padding-top: 18px;
  }

  .hero {
    border-radius: 14px;
    padding: 14px 12px;
  }

  h1 {
    font-size: clamp(0.95rem, 4.5vw, 1.25rem);
    letter-spacing: 0.2px;
  }

  .card {
    padding: 14px;
  }

  .cards {
    margin-top: 14px;
  }

  h2 {
    font-size: 1.15rem;
  }

  button {
    width: 100%;
  }

  .username-search-row {
    grid-template-columns: 1fr;
  }

  .support-note {
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@keyframes bgFloat {
  0% {
    background-position: 0% 0%, 100% 0%, 0 0;
  }
  100% {
    background-position: 6% 4%, 94% 3%, 0 0;
  }
}

@keyframes heroSweep {
  0% {
    left: -35%;
  }
  100% {
    left: 120%;
  }
}

@keyframes blobFloat {
  0% {
    transform: translateY(0) translateX(0) scale(1);
  }
  100% {
    transform: translateY(16px) translateX(-10px) scale(1.08);
  }
}

@keyframes btnPulse {
  0% {
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.28);
  }
  100% {
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.38);
  }
}

@keyframes orbLeft {
  0% {
    transform: translateY(0) translateX(0);
  }
  100% {
    transform: translateY(40px) translateX(25px);
  }
}

@keyframes orbRight {
  0% {
    transform: translateY(0) translateX(0);
  }
  100% {
    transform: translateY(-35px) translateX(-30px);
  }
}
