:root {
  --bg: #05091a;
  --bg-card: #070c21;
  --bg-card-soft: #0b1128;
  --accent: #00aaff;
  --accent-strong: #007bff;
  --accent-soft: rgba(0, 170, 255, 0.2);
  --accent-soft-2: rgba(0, 170, 255, 0.05);
  --error: #ff4d6a;
  --text-main: #f9fbff;
  --text-muted: #8e96b8;
  --input-bg: #0e1430;
  --input-border: #1b2748;
  --input-border-focus: #1d96ff;
  --shadow-card: 0 24px 80px rgba(0, 0, 0, 0.7);
  --radius-card: 20px;
  --radius-input: 12px;
  --transition-fast: 0.18s ease-out;
  --transition-med: 0.25s ease;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #0a1638, #040816 60%);
  color: var(--text-main);
  overflow: hidden;
}

/* particle canvas */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* main shell */
.shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* card */
.card {
  width: min(420px, 100%);
  background: radial-gradient(circle at top, #11152f 0, #050818 55%);
  box-shadow: var(--shadow-card), 0 0 80px rgba(0, 170, 255, 0.2);
  border-radius: var(--radius-card);
  padding: 32px 30px 30px;
  position: relative;
  overflow: hidden;
}

/* glowing aura behind card */
.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top, rgba(0, 170, 255, 0.2), transparent);
  opacity: 0.6;
  z-index: -1;
}

/* header */
.card-header {
  text-align: center;
  margin-bottom: 28px;
}

.title {
  font-size: 30px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 800;
  color: #ffffff;
}

.subtitle {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.subtitle span {
  color: var(--accent);
  font-weight: 600;
}

/* fields */
.field {
  margin-bottom: 18px;
}

.field:last-of-type {
  margin-bottom: 22px;
}

.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

/* input wrapper */
.field-wrap {
  position: relative;
}

/* plain input */
.input-field {
  width: 100%;
  border-radius: var(--radius-input);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-main);
  font-size: 14px;
  padding: 10px 16px; /* equal padding so typing is not shifted */
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    transform var(--transition-fast);
}

.input-field::placeholder {
  color: rgba(158, 172, 220, 0.65);
}

/* focus */
.input-field:focus {
  border-color: var(--input-border-focus);
  box-shadow:
    0 0 0 1px rgba(0, 150, 255, 0.4),
    0 0 24px rgba(0, 150, 255, 0.35);
  background: #0c1230;
}

/* invalid highlight */
.input-field.error {
  border-color: var(--error);
  box-shadow:
    0 0 0 1px rgba(255, 77, 106, 0.55),
    0 0 22px rgba(255, 77, 106, 0.4);
}

/* remember / secure row */
.remember-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* checkbox */
.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input {
  display: none;
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background: rgba(6, 10, 30, 0.9);
  box-shadow: inset 0 0 0 1px rgba(8, 16, 46, 0.8);
  position: relative;
  transition:
    border-color var(--transition-fast),
    background var(--transition-fast),
    box-shadow var(--transition-fast);
}

.checkbox-wrap input:checked + .checkbox-custom {
  border-color: var(--accent);
  background: radial-gradient(circle at 30% 20%, #47c4ff, #007bff);
  box-shadow:
    0 0 0 1px rgba(0, 123, 255, 0.7),
    0 0 14px rgba(0, 123, 255, 0.7);
}

.checkbox-wrap input:checked + .checkbox-custom::after {
  content: "";
  position: absolute;
  inset: 3px 4px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg);
}

/* secure indicator */
.secure-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.secure-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #00c853;
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.8);
}

/* button */
.btn-primary {
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #ffffff;
  background: linear-gradient(135deg, #009dff, #016cff);
  box-shadow:
    0 14px 30px rgba(0, 110, 255, 0.6),
    0 0 40px rgba(0, 122, 255, 0.85);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 18px 40px rgba(0, 120, 255, 0.78),
    0 0 50px rgba(0, 140, 255, 0.9);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.99);
  box-shadow:
    0 10px 22px rgba(0, 80, 220, 0.6),
    0 0 24px rgba(0, 110, 255, 0.85);
}

/* loader overlay */
.loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 25, 60, 0.85), rgba(0, 5, 20, 0.96));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--transition-med),
    visibility var(--transition-med);
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
  color: var(--text-main);
}

.loader-inner p {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* scanner animation */
.scan-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(0, 160, 255, 0.3);
  box-shadow:
    0 0 24px rgba(0, 160, 255, 0.4),
    0 0 60px rgba(0, 160, 255, 0.31);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.scan-core {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 10%, #ffffff, #29b4ff);
  box-shadow:
    0 0 20px rgba(41, 180, 255, 0.8),
    0 0 60px rgba(41, 180, 255, 0.7);
}

/* moving scan line */
.scan-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(255, 255, 255, 0.9) 50%,
    transparent 100%
  );
  mix-blend-mode: screen;
  animation: scan 1.4s linear infinite;
  opacity: 0.9;
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

/* toast notifications */
.toast {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%) translateY(-20px);
  background: radial-gradient(circle at top, #ff5f7f, #b11234);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 14px 30px rgba(177, 18, 52, 0.65);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--transition-med),
    transform var(--transition-med);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-size: 11px;
}

/* simple fade-in of card */
.card {
  animation: card-in 0.38s ease-out;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* responsive tweaks */
@media (max-width: 480px) {
  .card {
    padding: 26px 20px 24px;
  }

  .title {
    font-size: 26px;
    letter-spacing: 0.18em;
  }

  .subtitle {
    font-size: 12px;
  }
}
