/* ===== Login Page — TRY League Dark Theme ===== */

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

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #020617;
  color: #e2e8f0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  position: relative;
}

/* ---- Animated background ---- */

.login-bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(220, 38, 38, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220, 38, 38, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.login-bg-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(220, 38, 38, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: login-glow-pulse 6s ease-in-out infinite;
}

@keyframes login-glow-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg-glow { animation: none; opacity: 0.7; }
}

/* ---- Main shell ---- */

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- Card ---- */

.login-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(220, 38, 38, 0.12);
  border-radius: 16px;
  padding: 32px 28px 28px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(220, 38, 38, 0.04),
    0 24px 48px rgba(0, 0, 0, 0.4),
    0 0 80px rgba(220, 38, 38, 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-card:focus-within {
  border-color: rgba(220, 38, 38, 0.25);
  box-shadow:
    0 0 0 1px rgba(220, 38, 38, 0.08),
    0 24px 48px rgba(0, 0, 0, 0.4),
    0 0 100px rgba(220, 38, 38, 0.06);
}

/* ---- Brand header ---- */

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  padding: 4px 0 8px;
}

.login-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 16px rgba(220, 38, 38, 0.4));
  user-select: none;
  transition: filter 0.3s ease;
}

.login-card:focus-within .login-logo {
  filter: drop-shadow(0 2px 20px rgba(220, 38, 38, 0.55));
}

/* ---- Form ---- */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.login-field label svg {
  opacity: 0.6;
}

.login-field input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.6);
  color: #e2e8f0;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-field input::placeholder {
  color: #475569;
}

.login-field input:hover {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(2, 6, 23, 0.8);
}

.login-field input:focus {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
  background: rgba(2, 6, 23, 0.9);
}

/* ---- Submit button ---- */

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  margin-top: 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.35);
  filter: brightness(1.08);
}

.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
  filter: brightness(0.92);
}

.login-submit:focus-visible {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.4);
}

.login-submit-arrow {
  transition: transform 0.2s ease;
}

.login-submit:hover .login-submit-arrow {
  transform: translateX(3px);
}

.login-submit.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ---- Status message ---- */

.login-status {
  min-height: 20px;
  margin-top: 16px;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
  transition: color 0.2s ease;
}

.login-status:empty {
  display: none;
}

.login-status.is-error {
  color: #f87171;
}

/* ---- Footer ---- */

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: #334155;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.login-footer-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.5);
  animation: login-dot-blink 3s ease-in-out infinite;
}

@keyframes login-dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .login-footer-dot { animation: none; }
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
  .login-shell {
    padding: 16px;
  }
  .login-card {
    padding: 24px 20px 20px;
    border-radius: 12px;
  }
  .login-logo {
    height: 44px;
  }
}
