:root {
  --bg: #06090e;
  --glass: rgba(18, 24, 35, 0.55);
  --glass-border: rgba(255, 255, 255, 0.07);
  --border: rgba(48, 54, 61, 0.8);
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #38bdf8;
  --period-accent: #22d3ee;
  --period-accent-strong: #38bdf8;
  --period-accent-soft: rgba(34, 211, 238, 0.22);
  --period-accent-border: rgba(56, 189, 248, 0.4);
  --green: #22c55e;
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.2);
}
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(45, 74, 111, 0.22), transparent 58%),
    radial-gradient(circle at 100% 0%, rgba(16, 120, 100, 0.1), transparent 30%),
    radial-gradient(circle at 0% 100%, rgba(51, 65, 85, 0.14), transparent 34%),
    radial-gradient(circle at 72% 68%, rgba(30, 58, 95, 0.08), transparent 40%),
    linear-gradient(165deg, #05080d 0%, #0a1018 42%, #070b12 100%);
}
.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.45) 100%);
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, black 12%, transparent 72%);
}
.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 40px);
}
.login-card {
  width: min(460px, 100%);
  background: linear-gradient(160deg, rgba(18, 23, 35, 0.94) 0%, rgba(11, 15, 25, 0.92) 55%, rgba(7, 11, 20, 0.98) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 28px 26px 30px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
  animation: loginEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.login-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 120, 100, 0.12) 0%, rgba(16, 120, 100, 0) 72%);
  pointer-events: none;
}
.login-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  pointer-events: none;
}
@keyframes loginEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.login-body {
  position: relative;
  z-index: 1;
  padding-top: 44px;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 14px;
  margin-bottom: 22px;
  min-width: 0;
}
.login-brand-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.2), rgba(59, 130, 246, 0.12));
  border: 1px solid rgba(110, 231, 255, 0.24);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #67e8f9;
}
.login-brand-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-brand h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-align: center;
  min-width: 0;
}
.login-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid rgba(52, 211, 153, 0.28);
  color: #a7f3d0;
  background: rgba(6, 78, 59, 0.35);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.1);
}
.login-badge-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: badgePulse 2.2s ease-out infinite;
  transform: translateY(0);
}
.login-badge-text {
  line-height: 1;
}
@keyframes badgePulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.login-form {
  position: relative;
  z-index: 1;
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.field-input-wrap svg.field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: #64748b;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.2s;
}
.field input {
  width: 100%;
  padding: 14px 44px 14px 42px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 12, 20, 0.72);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
}
.field input:hover {
  border-color: rgba(148, 163, 184, 0.16);
}
.field input:focus {
  border-color: var(--period-accent-border);
  box-shadow: 0 0 0 3px var(--period-accent-soft), 0 12px 28px rgba(0,0,0,0.18);
  background: rgba(12, 20, 32, 0.92);
}
.field input:focus + .toggle-pwd,
.field input:focus ~ svg.field-icon {
  stroke: #67e8f9;
}
.field-input-wrap:focus-within svg.field-icon {
  stroke: #67e8f9;
}
.toggle-pwd {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.toggle-pwd:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,0.04);
}
.toggle-pwd svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-error {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
  font-size: 0.86rem;
  line-height: 1.4;
  animation: shake 0.4s ease;
}
.login-error.visible { display: flex; }
.login-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.login-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px 18px;
  border: 1px solid rgba(110, 231, 255, 0.28);
  border-radius: 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #ecfeff;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(56, 189, 248, 0.18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 14px 32px rgba(8, 145, 178, 0.18);
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s, opacity 0.2s;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(56, 189, 248, 0.1));
  opacity: 0;
  transition: opacity 0.25s;
}
.login-submit-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-submit-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(110, 231, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 18px 40px rgba(8, 145, 178, 0.24);
}
.login-submit:hover:not(:disabled)::before { opacity: 1; }
.login-submit:disabled { opacity: 0.6; cursor: wait; }
.login-submit.loading .login-submit-inner { opacity: 0.85; }
.login-audit {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 11px;
  margin-top: 22px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, 0.16);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.22) 0%, rgba(8, 47, 73, 0.18) 55%, rgba(15, 23, 35, 0.35) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 8px 24px rgba(0,0,0,0.14);
  position: relative;
  z-index: 1;
  overflow: visible;
}
.login-audit::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.35), rgba(34, 211, 238, 0.2), transparent);
  pointer-events: none;
}
.login-audit-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.22);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.12);
}
.login-audit-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.login-audit-text {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: #b8c5d4;
  white-space: normal;
}
.login-audit-line,
.login-audit-tail {
  display: inline;
}
.login-audit-text strong {
  color: #d1fae5;
  font-weight: 600;
  line-height: inherit;
}
.login-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.login-foot strong {
  color: #94a3b8;
  font-weight: 600;
}
@media (max-width: 480px) {
  .login-card { padding: 22px 18px 18px; border-radius: 20px; }
  .login-badge {
    top: 16px;
    right: 16px;
    height: 28px;
    padding: 0 10px;
    font-size: 0.66rem;
  }
  .login-body { padding-top: 40px; }
  .login-brand { gap: 12px; margin-bottom: 18px; }
  .login-brand h1 { font-size: 1.5rem; }
  .login-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }
  .login-brand-icon svg { width: 22px; height: 22px; }
  .login-audit {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    padding: 12px 14px 13px;
    gap: 8px;
  }
  .login-audit-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }
  .login-audit-icon svg {
    width: 15px;
    height: 15px;
  }
  .login-audit-text {
    display: block;
    width: 100%;
    min-height: 0;
    font-size: 0.68rem;
    line-height: 1.5;
    text-align: center;
    white-space: normal;
    text-wrap: balance;
  }
  .login-audit-line,
  .login-audit-tail {
    display: block;
  }
  .login-foot {
    margin-top: 16px;
    padding-top: 14px;
    font-size: 0.68rem;
    line-height: 1.45;
  }
}
