@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

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

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

body {
  min-height: 100vh;
  height: auto;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  color: #1e293b;
  background: #0f172a;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #0c4a6e 100%);
  -webkit-font-smoothing: antialiased;
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
  overflow: hidden;
}

.login-page__glow {
  position: absolute;
  width: 120%;
  max-width: 800px;
  height: 400px;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.08),
    0 24px 48px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 2.25rem 2rem 2rem;
}

.login-card__brand {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-radius: 12px;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.35);
}

.login-card h1 {
  text-align: center;
  font-size: 1.375rem;
  font-weight: 600;
  color: #0f172a;
  margin: 1rem 0 0.35rem;
  letter-spacing: -0.02em;
}

.login-card__subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.45;
}

.form {
  text-align: left;
}

.input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.input-wrap__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.input-wrap__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

input[type="text"],
input[type="password"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.9375rem;
  color: #0f172a;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: #94a3b8;
}

input[type="text"]:hover,
input[type="password"]:hover {
  border-color: #cbd5e1;
  background: #fff;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #0284c7;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1.25rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.875rem;
  color: #475569;
}

.remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0284c7;
  cursor: pointer;
}

#login-button {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 4px 14px rgba(3, 105, 161, 0.35);
}

#login-button:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(3, 105, 161, 0.45);
  transform: translateY(-1px);
}

#login-button:active:not(:disabled) {
  transform: translateY(0);
}

#login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.captcha-block {
  display: none;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
}

.captcha-block.is-visible {
  display: block;
}

.captcha-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.captcha-block__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #b45309;
}

.captcha-block__refresh {
  background: none;
  border: 0;
  color: #0284c7;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.captcha-block__refresh:hover {
  color: #0369a1;
}

#captcha-question {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

#CaptchaAnswer {
  width: 100%;
  max-width: 200px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
}

#CaptchaAnswer:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.login-message {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.4;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.login-message.is-visible {
  display: block;
}

.login-message--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}

#loading.is-active {
  display: flex;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.bg-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-bubbles li {
  position: absolute;
  list-style: none;
  display: block;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.04);
  bottom: -160px;
  animation: square 28s infinite;
  transition-timing-function: linear;
  border-radius: 8px;
}

.bg-bubbles li:nth-child(1) {
  left: 8%;
}
.bg-bubbles li:nth-child(2) {
  left: 20%;
  width: 64px;
  height: 64px;
  animation-delay: 2s;
  animation-duration: 20s;
}
.bg-bubbles li:nth-child(3) {
  left: 32%;
  animation-delay: 5s;
}
.bg-bubbles li:nth-child(4) {
  left: 48%;
  width: 48px;
  height: 48px;
  animation-duration: 24s;
  background-color: rgba(255, 255, 255, 0.06);
}
.bg-bubbles li:nth-child(5) {
  left: 62%;
}
.bg-bubbles li:nth-child(6) {
  left: 75%;
  width: 100px;
  height: 100px;
  animation-delay: 3s;
  background-color: rgba(255, 255, 255, 0.05);
}
.bg-bubbles li:nth-child(7) {
  left: 38%;
  width: 120px;
  height: 120px;
  animation-delay: 8s;
}
.bg-bubbles li:nth-child(8) {
  left: 55%;
  width: 24px;
  height: 24px;
  animation-delay: 12s;
  animation-duration: 35s;
}
.bg-bubbles li:nth-child(9) {
  left: 15%;
  width: 12px;
  height: 12px;
  animation-delay: 2s;
  animation-duration: 32s;
  background-color: rgba(255, 255, 255, 0.07);
}
.bg-bubbles li:nth-child(10) {
  left: 88%;
  width: 100px;
  height: 100px;
  animation-delay: 10s;
}

@keyframes square {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(-900px) rotate(540deg);
    opacity: 0;
  }
}

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