* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }

body {
  font-family: "Helvetica Neue", "Segoe UI", sans-serif;
  background: radial-gradient(ellipse at 60% 40%, #1a0520 0%, #0a0a0f 55%, #000 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d9d9d9;
  overflow: hidden;
}

/* ── Background canvas ────────────────────────────────────────────────────── */
#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  filter: blur(2px);
  pointer-events: none;
  /* Fade edges so rows don't hard-cut */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
}

/* Individual logo item */
.fl {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.fl svg { flex-shrink: 0; display: block; }

.fl-text {
  font-family: "Exo 2", sans-serif;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.fl-live {
  font-family: "Exo 2", sans-serif;
  font-weight: 900;
  letter-spacing: 3px;
  border-radius: 5px;
  padding: 2px 8px;
  line-height: 1.1;
}

/* Marquee strip */
.fl-row {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  width: max-content;
  transform-origin: center left;
}

@keyframes marqueeLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes marqueeRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* ── Rain layer (above blur, below card) ──────────────────────────────────── */
#rainCanvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.drop {
  position: absolute;
  pointer-events: none;
  will-change: transform;
  transform-origin: center;
}

/* ── Overlays ─────────────────────────────────────────────────────────────── */
#bgOverlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.72) 100%);
  pointer-events: none;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 2;
  background: rgba(18,18,22,0.82);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 36px 32px;
  width: 340px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 48px rgba(0,0,0,0.7), 0 0 0 1px rgba(254,44,85,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 28px;
  user-select: none;
  -webkit-user-select: none;
}

@keyframes logoBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.82); }
  60%  { transform: scale(1.18); }
  78%  { transform: scale(0.93); }
  90%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: #e8274b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg { width: 20px; height: 20px; fill: white; }

.logo-text {
  font-family: "Exo 2", sans-serif;
  font-size: 22px;
  color: #fff;
}

.logo-text span { color: #e8274b; }

/* Tabs */
.tabs {
  display: flex;
  background: #111;
  border-radius: 7px;
  padding: 3px;
  margin-bottom: 24px;
  gap: 3px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.tab-btn.active {
  background: #2a2a2a;
  color: #d9d9d9;
}

/* Form */
label {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 5px;
  margin-top: 14px;
}

input[type=text], input[type=password] {
  width: 100%;
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  color: #d9d9d9;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input:focus { border-color: #37a1dc; }

/* PIN display */
.pin-display {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pin-digit {
  flex: 1;
  height: 44px;
  background: #222;
  border: 1px solid #333;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #e8274b;
  transition: border-color 0.15s;
  letter-spacing: 0;
}

.pin-digit.filled { border-color: #37a1dc; }
.pin-digit.active { border-color: #37a1dc; box-shadow: 0 0 0 2px rgba(55,161,220,0.2); }

/* PIN length selector */
.pin-length {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.pin-len-btn {
  padding: 5px 14px;
  border-radius: 5px;
  border: 1px solid #333;
  background: #222;
  color: #777;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.pin-len-btn.active {
  border-color: #e8274b;
  color: #e8274b;
  background: rgba(232,39,75,0.1);
}

/* Numpad */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.num-btn {
  height: 44px;
  background: #222;
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  color: #d9d9d9;
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.num-btn:hover { background: #2a2a2a; }
.num-btn:active { background: #333; }
.num-btn.del { font-size: 14px; color: #888; }

/* Submit button */
.btn-submit {
  width: 100%;
  margin-top: 18px;
  padding: 11px;
  background: #e8274b;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Exo 2", sans-serif;
  transition: opacity 0.15s;
}

.btn-submit:hover { opacity: 0.88; }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Error */
.error-msg {
  background: rgba(232,39,75,0.1);
  border: 1px solid rgba(232,39,75,0.3);
  border-radius: 5px;
  color: #e87070;
  font-size: 12px;
  padding: 8px 10px;
  margin-top: 12px;
  display: none;
}

.error-msg.show { display: block; }

/* Footer */
.card-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: #444;
}

/* Saved accounts */
#savedSection {
  margin-bottom: 20px;
  display: none;
}
#savedSection .saved-label {
  font-size: 10px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  font-weight: 600;
}
.saved-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.saved-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 6px 8px 6px 7px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.saved-chip:hover { border-color: #e8274b; background: #2a1a1e; }
.saved-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #e8274b;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
}
.saved-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.saved-name { font-size: 12px; color: #ccc; font-weight: 600; }
.saved-remove {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #333;
  border: none;
  color: #666;
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: 2px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.saved-remove:hover { background: #e8274b; color: #fff; }

/* Quick login header */
#quickLoginHeader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.ql-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #e8274b;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
  overflow: hidden;
}
.ql-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ql-name { font-size: 16px; font-weight: 700; color: #fff; }
.ql-switch {
  font-size: 11px;
  color: #555;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  text-decoration: underline;
  margin-top: 2px;
}
.ql-switch:hover { color: #888; }
