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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Soft static radial glow behind the card. Two offset stops give it
   depth without competing with the card. */
.login-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(88, 166, 255, 0.18), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(88, 166, 255, 0.10), transparent 50%);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: rgba(26, 29, 39, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #2a2d3a;
  border-radius: 14px;
  padding: 36px 32px 32px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* Brand block — the animated atom mark sits on top, the shimmering
   wordmark below it. Uses the same SVGs the boot loader uses so the
   transition from boot to login feels continuous. */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.login-mark {
  width: 96px;
  height: auto;
  filter: drop-shadow(0 0 22px rgba(88, 166, 255, 0.45));
  animation: login-mark-float 4s ease-in-out infinite;
}

@keyframes login-mark-float {
  0%, 100% { transform: translateY(0);    }
  50%      { transform: translateY(-3px); }
}

/* Show the dark-theme mark by default (the login screen is always dark).
   Keep light-mark available in case the page mounts under light styles. */
.login-mark-light { display: none; }
.login-mark-dark  { display: block; }

/* Shimmering wordmark — gradient sliding through the SVG-shaped mask. */
.login-wordmark {
  width: 180px;
  height: 30px;
  background: linear-gradient(90deg, #58a6ff, #79b8ff, #e1e4e8, #58a6ff);
  background-size: 200% 100%;
  -webkit-mask: url('/images/logo-dark-text.svg') center / contain no-repeat;
          mask: url('/images/logo-dark-text.svg') center / contain no-repeat;
  animation: login-wordmark-shimmer 4s linear infinite;
}

@keyframes login-wordmark-shimmer {
  to { background-position: -200% 0; }
}

.login-subtitle {
  font-size: 13px;
  color: #8b8fa3;
  text-align: center;
  margin-bottom: 22px;
  letter-spacing: 0.3px;
}

/* (Legacy title — only shown by setup/register variants when needed.) */
.login-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 22px;
  color: #fff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #8b8fa3;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-group input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #2a2d3a;
  border-radius: 8px;
  background: #0f1117;
  color: #e6e8ee;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.18);
}

/* Input wrapper with leading + trailing icon slots. The input gets
   left/right padding to clear the absolutely-positioned icons. */
.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-left: 38px;
  padding-right: 38px;
}

.input-icon-leading {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7080;
  pointer-events: none;
}

.input-wrap input:focus ~ .input-icon-leading,
.input-wrap input:focus + .input-icon-leading {
  color: #79b8ff;
}

/* Eye toggle (and other trailing icon buttons). No background, just
   the icon — sits inside the input on the right side. */
.input-icon-trailing {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: #6b7080;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.input-icon-trailing:hover {
  color: #e6e8ee;
  background: rgba(255, 255, 255, 0.04);
}

.input-icon-trailing:focus-visible {
  outline: 2px solid rgba(88, 166, 255, 0.5);
  outline-offset: 2px;
}


/* Remember-me row — custom checkbox so it matches the dashboard's
   accent color instead of the browser default. */
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13px;
  color: #b6bac4;
  cursor: pointer;
  user-select: none;
}

.login-remember input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #2a2d3a;
  background: #0f1117;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.login-remember input[type="checkbox"]:hover {
  border-color: #444a5a;
}

.login-remember input[type="checkbox"]:checked {
  background: #58a6ff;
  border-color: #58a6ff;
}

.login-remember input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #0f1117;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.login-remember input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(88, 166, 255, 0.5);
  outline-offset: 2px;
}

.btn-login {
  width: 100%;
  padding: 11px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #58a6ff, #4a8edc);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.25);
}

.btn-login:hover { filter: brightness(1.06); }
.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.error-msg {
  background: #3d1f1f;
  color: #ff8585;
  border: 1px solid #5a2d2d;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.setup-info {
  font-size: 13px;
  color: #8b8fa3;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-register-link {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #8b8fa3;
}
.login-register-link a {
  color: #79b8ff;
  text-decoration: none;
  font-weight: 500;
}
.login-register-link a:hover {
  text-decoration: underline;
}

.success-msg {
  background: #1f3d2b;
  color: #4ade80;
  border: 1px solid #2d5a3d;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.hidden { display: none !important; }
