/* Sync indicator in header */
#sync-indicator {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; cursor: pointer;
  padding: 4px 8px; border-radius: var(--r2);
  transition: background 0.15s;
}
#sync-indicator:hover { background: var(--sf); }

/* Sync modal overlay */
.sync-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn var(--anim-base) var(--ease-out);
}
.sync-modal {
  background: var(--cd); border: 1px solid var(--bdr);
  border-radius: var(--r); padding: 20px; width: 320px;
  max-width: 90vw;
  animation: scaleIn var(--anim-base) var(--ease-spring);
}
.sync-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}

/* Auth form */
.sync-input {
  width: 100%; padding: 10px 12px; margin-bottom: 8px;
  background: var(--sf); border: 1px solid var(--bdr);
  border-radius: var(--r2); color: var(--wh); font-size: 13px;
  outline: none; box-sizing: border-box;
}
.sync-input:focus { border-color: var(--acc); }
.sync-error { color: var(--red); font-size: 11px; min-height: 16px; margin-bottom: 8px; }
.sync-btn { width: 100%; margin-bottom: 8px; }
.btn-danger { background: var(--red); color: var(--text-on-accent); border: none; }
.btn-outline { background: transparent; border: 1px solid var(--bdr); color: var(--tx); }
.btn-outline:hover { border-color: var(--acc); }

/* User info section */
.sync-user-info { margin-bottom: 16px; }
.sync-status-row {
  display: flex; align-items: center; gap: 6px; margin-top: 6px;
}
.sync-status-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}

/* Divider */
.sync-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0; color: var(--dim); font-size: 11px;
}
.sync-divider::before, .sync-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--bdr);
}

/* Google button */
.btn-google {
  display: flex; align-items: center; justify-content: center;
  background: var(--sf); color: var(--tx); border: 1px solid var(--bdr);
  font-weight: 500;
}
.btn-google:hover { background: #f5f5f5; }

/* ── Login Gate Screen ── */
#view-login {
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
#view-login.active {
  display: flex;
  opacity: 1;
  transform: none;
}

/* Ambient floating orbs */
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
  pointer-events: none;
  will-change: transform;
}
.login-orb--gold {
  width: 280px; height: 280px;
  background: var(--acc);
  top: -60px; right: -40px;
  animation: loginFloat1 14s ease-in-out infinite;
}
.login-orb--cyan {
  width: 220px; height: 220px;
  background: var(--cyn);
  bottom: -40px; left: -60px;
  animation: loginFloat2 18s ease-in-out infinite;
}
.login-orb--warm {
  width: 180px; height: 180px;
  background: var(--amb);
  top: 40%; left: 50%;
  opacity: 0.25;
  animation: loginFloat3 16s ease-in-out infinite;
}

@keyframes loginFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-30px, 40px) scale(1.08); }
  66%      { transform: translate(20px, -20px) scale(0.95); }
}
@keyframes loginFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.05); }
  66%      { transform: translate(-20px, 20px) scale(0.92); }
}
@keyframes loginFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-40px, -30px) scale(1.1); }
}

/* Glass card container — hidden until JS populates it */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 36px 28px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-radius: var(--r);
  box-shadow: none;
  animation: fadeUp var(--anim-slow) var(--ease-out);
}
.login-card:empty {
  display: none;
}

/* Splash brain icon — visible only while login-card is empty */
.login-splash {
  position: relative;
  z-index: 1;
  animation: loginSplashPulse 2s ease-in-out infinite;
}
.login-card:not(:empty) + .login-splash { display: none; }
@keyframes loginSplashPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Logo with glow ring */
.login-logo-wrap {
  position: relative;
  width: 96px; height: 96px;
  margin: 0 auto 20px;
}
.login-logo-wrap::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  border: 2px solid rgba(10,132,255,0.35);
}
.login-logo {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  display: block;
  position: relative;
}

/* Gradient title */
.login-gradient-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--acc), var(--acc), var(--cyn));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 28px;
  line-height: 1.4;
}

/* Floating label input groups */
.login-float-group {
  position: relative;
  margin-bottom: 16px;
  text-align: left;
  width: 100%;
}
.login-float-input {
  width: 100%;
  padding: 14px 12px 6px;
  background: var(--sf);
  border: none;
  border-bottom: 2px solid var(--bdr);
  border-radius: var(--r2) var(--r2) 0 0;
  color: var(--wh);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--anim-base) var(--ease-out);
}
.login-float-input:focus {
  border-bottom-color: var(--acc);
}
.login-float-label {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--dim);
  pointer-events: none;
  transition: all var(--anim-base) var(--ease-out);
}
.login-float-input:focus + .login-float-label,
.login-float-input:not(:placeholder-shown) + .login-float-label {
  top: 6px;
  transform: translateY(0);
  font-size: 10px;
  color: var(--acc);
}

/* Error text */
.login-card .sync-error {
  text-align: left;
  margin-bottom: 4px;
  width: 100%;
}
.login-card .sync-divider {
  width: 100%;
}

/* ToS agreement checkbox */
.login-tos-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 11px;
  color: var(--dim);
  line-height: 1.5;
}
.login-tos-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 1px;
  accent-color: var(--acc);
  cursor: pointer;
}
.login-tos-check a {
  color: var(--acc);
  text-decoration: none;
}
.login-tos-check a:hover {
  text-decoration: underline;
}

/* Gold glow CTA */
.login-glow-btn {
  width: auto;
  padding: 10px 32px;
  border-radius: 9999px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--acc);
  color: var(--text-on-color);
  box-shadow: var(--elev-2);
  transition: all var(--anim-base) var(--ease-out);
  margin-bottom: 8px;
}
.login-glow-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(10,132,255,0.35);
}
.login-glow-btn:active {
  transform: scale(0.97);
}

/* Outline + Google button overrides */
.login-card .btn-outline {
  width: auto;
  padding: 10px 32px;
  border-radius: 9999px;
  justify-content: center;
  margin-bottom: 8px;
}
.login-card .btn-google {
  width: auto;
  padding: 10px 24px;
  border-radius: 9999px;
  justify-content: center;
  margin-bottom: 6px;
}
.login-card .btn-microsoft {
  width: auto;
  padding: 10px 24px;
  border-radius: 9999px;
  justify-content: center;
}

/* Forgot password */
.login-forgot {
  margin-top: 20px;
}

/* Terms link — bottom right of login screen */
.login-terms {
  position: absolute;
  bottom: 16px;
  right: 20px;
  z-index: 1;
  font-size: 11px;
}
.login-terms a {
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s;
}
.login-terms a:hover {
  color: var(--wh);
}

/* Trust line */
.login-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: var(--dim);
  margin-top: 16px;
}
.login-trust i[data-lucide] { width: 12px; height: 12px; }

/* Version pill */
.login-version {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--dim);
  opacity: 0.5;
  letter-spacing: 0.04em;
}

/* Staggered entrance animation */
.login-card > *:nth-child(1)  { animation: fadeUp var(--anim-slow) var(--ease-out) 0ms both; }
.login-card > *:nth-child(2)  { animation: fadeUp var(--anim-slow) var(--ease-out) 60ms both; }
.login-card > *:nth-child(3)  { animation: fadeUp var(--anim-slow) var(--ease-out) 120ms both; }
.login-card > *:nth-child(4)  { animation: fadeUp var(--anim-slow) var(--ease-out) 180ms both; }
.login-card > *:nth-child(5)  { animation: fadeUp var(--anim-slow) var(--ease-out) 240ms both; }
.login-card > *:nth-child(6)  { animation: fadeUp var(--anim-slow) var(--ease-out) 300ms both; }
.login-card > *:nth-child(7)  { animation: fadeUp var(--anim-slow) var(--ease-out) 360ms both; }
.login-card > *:nth-child(8)  { animation: fadeUp var(--anim-slow) var(--ease-out) 420ms both; }
.login-card > *:nth-child(9)  { animation: fadeUp var(--anim-slow) var(--ease-out) 480ms both; }
.login-card > *:nth-child(10) { animation: fadeUp var(--anim-slow) var(--ease-out) 540ms both; }
.login-card > *:nth-child(11) { animation: fadeUp var(--anim-slow) var(--ease-out) 600ms both; }

