:root {
  --bg: #0a0d12;
  --panel: #12161f;
  --border: #232a38;
  --text: #e2e6eb;
  --text-dim: #838ea0;
  --green: #26a69a;
  --red: #ef5350;
  --accent: #4a90e2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(ellipse at top, #131926 0%, #0a0d12 60%);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.bg-candles {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 4%;
  opacity: 0.16;
  pointer-events: none;
}
.candle {
  width: 3.2%;
  border-radius: 2px;
  animation: rise 4.5s ease-in-out infinite alternate;
}
.candle.up { background: var(--green); }
.candle.down { background: var(--red); }

@keyframes rise {
  from { transform: scaleY(0.85); opacity: 0.7; }
  to { transform: scaleY(1); opacity: 1; }
}

.login-wrap {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 380px;
  max-width: 100%;
  background: rgba(18, 22, 31, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(74, 144, 226, 0.05);
  animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.brand { text-align: center; margin-bottom: 22px; }
.brand-icon { width: 40px; height: 40px; margin-bottom: 10px; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.2px; }
.subtitle { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); }

.alert {
  background: rgba(239, 83, 80, 0.12);
  border: 1px solid rgba(239, 83, 80, 0.35);
  color: #ff8a85;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block; font-size: 12px; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}
.field-input {
  display: flex; align-items: center; gap: 10px;
  background: #171c27;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}
.field-input svg { width: 17px; height: 17px; color: var(--text-dim); flex-shrink: 0; }
.field-input input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--text); font-size: 14.5px;
  padding: 11px 0;
}
.field-input input::placeholder { color: #4a5364; }

.toggle-pw {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--text-dim); display: flex;
}
.toggle-pw:hover { color: var(--text); }

.submit-btn {
  width: 100%;
  margin-top: 6px;
  background: linear-gradient(135deg, var(--accent), #3a7bc8);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: filter 0.15s, transform 0.1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.submit-btn:hover { filter: brightness(1.08); }
.submit-btn:active { transform: scale(0.98); }

.btn-spinner {
  display: none;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.submit-btn.loading .btn-text { opacity: 0.6; }
.submit-btn.loading .btn-spinner { display: inline-block; }

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

.footnote {
  text-align: center;
  font-size: 11px;
  color: #4a5364;
  margin: 18px 0 0;
}

@media (max-width: 420px) {
  .bg-candles { display: none; }
}
