/* ============================================================
   NESTFY — auth.css  (Login / Signup Screen)
   ============================================================ */

#auth-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
#auth-screen::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(0,212,170,.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(124,106,255,.07) 0%, transparent 60%);
  pointer-events: none;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 40px 40px 36px;
  width: 100%; max-width: 440px;
  position: relative; z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: authIn .4s cubic-bezier(.16,1,.3,1);
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo */
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-text {
  font-size: 2.4rem; font-weight: 900; letter-spacing: -2px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  display: block; line-height: 1;
}
.auth-logo-sub {
  font-size: .7rem; color: var(--muted); letter-spacing: 2px;
  text-transform: uppercase; margin-top: 5px; display: block;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; margin-bottom: 24px; gap: 4px;
}
.auth-tab {
  flex: 1; padding: 9px; text-align: center;
  border-radius: 9px; border: none;
  font-family: var(--ff); font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: all .2s;
  background: transparent; color: var(--muted);
}
.auth-tab.active { background: var(--card2); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* Panels */
.auth-panel { display: none; }
.auth-panel.active { display: block; animation: panelIn .2s ease; }
@keyframes panelIn { from { opacity:0; transform:translateX(6px); } to { opacity:1; transform:translateX(0); } }

/* Messages */
.auth-msg {
  padding: 10px 14px; border-radius: 10px; font-size: .8rem;
  font-weight: 500; margin-bottom: 14px;
  display: none; align-items: center; gap: 8px;
}
.auth-msg.show { display: flex; }
.auth-msg.error   { background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.2); color: #fca5a5; }
.auth-msg.success { background: rgba(0,212,170,.08);   border: 1px solid rgba(0,212,170,.2);   color: #6ee7b7; }

/* Google button */
.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 20px;
  background: var(--bg); border: 1px solid var(--border2);
  border-radius: 12px; color: var(--text);
  font-family: var(--ff); font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .2s; margin-bottom: 18px;
}
.btn-google:hover { background: var(--card2); border-color: rgba(255,255,255,.18); transform: translateY(-1px); }
.btn-google svg   { width: 18px; height: 18px; flex-shrink: 0; }

/* Divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; color: var(--muted); font-size: .7rem;
  letter-spacing: .5px; text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after { content:''; flex:1; height:1px; background: var(--border); }

/* Submit button */
.btn-auth {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: #000; font-family: var(--ff); font-size: .9rem; font-weight: 800;
  border: none; border-radius: 12px; cursor: pointer;
  transition: all .2s; margin-top: 6px; letter-spacing: .3px;
}
.btn-auth:hover    { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,212,170,.3); }
.btn-auth:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-auth .spinner { display:none; width:16px; height:16px; border:2px solid rgba(0,0,0,.3); border-top-color:#000; border-radius:50%; animation:spin .6s linear infinite; margin:0 auto; }
.btn-auth.loading .btn-label { display:none; }
.btn-auth.loading .spinner   { display:block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Password toggle */
.pw-wrapper { position: relative; }
.pw-wrapper .form-control { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: .85rem; transition: color .18s;
}
.pw-toggle:hover { color: var(--muted2); }

/* Password strength */
.pw-strength { margin-top: 6px; display: none; }
.pw-strength.show { display: block; }
.pw-strength-bar  { height: 3px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.pw-strength-fill { height: 100%; border-radius: 99px; transition: width .3s, background .3s; }
.pw-strength-label { font-size: .68rem; color: var(--muted); }

/* Forgot link */
.forgot-link {
  background: none; border: none; color: var(--accent);
  font-family: var(--ff); font-size: .75rem; cursor: pointer;
  float: right; margin-top: -2px; transition: opacity .18s;
}
.forgot-link:hover { opacity: .75; }

/* Auth footer */
.auth-footer { text-align: center; margin-top: 20px; font-size: .73rem; color: var(--muted); }
.auth-footer a { color: var(--accent); text-decoration: none; }

/* User info in sidebar */
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r);
  margin: 0 10px 4px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 800; color: #000;
  flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.user-details { flex: 1; min-width: 0; }
.user-name  { font-size: .82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: .65rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.btn-logout {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 5px; border-radius: 6px; font-size: .82rem; transition: all .18s; flex-shrink: 0;
}
.btn-logout:hover { color: var(--expense); background: rgba(255,107,107,.1); }

/* Sync dot */
.sync-row { display: flex; align-items: center; gap: 5px; font-size: .64rem; color: var(--muted); padding: 3px 22px 6px; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--income); flex-shrink: 0; }
.sync-dot.syncing { background: var(--gold); animation: blink 1s infinite; }
.sync-dot.offline { background: var(--expense); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px 24px; }
}

/* ── Protected page login wall ──────────────────────────────── */
#analytics-login-wall,
#settings-login-wall {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 20px;
}
.login-wall-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  animation: authIn .35s cubic-bezier(.16,1,.3,1);
}
.login-wall-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,212,170,.15), rgba(124,106,255,.15));
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  font-size: 1.8rem; color: var(--accent);
}
.login-wall-card h2 {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.3px;
  margin-bottom: 10px;
}
.login-wall-card p {
  font-size: .82rem; color: var(--muted); line-height: 1.6;
  margin-bottom: 24px;
}

/* ── Locked nav item ────────────────────────────────────────── */
.nav-item.nav-locked {
  opacity: .55;
  cursor: pointer;
}
.nav-item.nav-locked:hover {
  opacity: .75;
  background: rgba(255,255,255,.03);
}
.nav-lock-badge {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  background: rgba(255,255,255,.07);
  border-radius: 5px;
  font-size: .6rem; color: var(--muted);
}
/* ════════════════════════════════════════════════════════════
   LIGHT THEME — Auth Screen Overrides
   ════════════════════════════════════════════════════════════ */
body.light #auth-screen {
  background: #e2e8f0;
}
body.light #auth-screen::before {
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(0,212,170,.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(124,106,255,.1) 0%, transparent 60%);
}
body.light .auth-card {
  background: #ffffff !important;
  border-color: rgba(0,0,0,.1) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04) !important;
}
body.light .auth-logo-sub { color: #64748b; }
body.light .auth-tabs {
  background: #f1f5f9;
  border-color: rgba(0,0,0,.1);
}
body.light .auth-tab { color: #64748b; background: transparent; }
body.light .auth-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
body.light .auth-msg.error {
  background: rgba(220,38,38,.06);
  border-color: rgba(220,38,38,.2);
  color: #dc2626;
}
body.light .auth-msg.success {
  background: rgba(0,212,170,.06);
  border-color: rgba(0,212,170,.25);
  color: #047857;
}
body.light #auth-error {
  background: rgba(220,38,38,.06);
  border-color: rgba(220,38,38,.2);
  color: #dc2626;
}
body.light #auth-success {
  background: rgba(0,212,170,.06);
  border-color: rgba(0,212,170,.25);
  color: #047857;
}
body.light .btn-google {
  background: #f8fafc;
  border-color: rgba(0,0,0,.12);
  color: #0f172a;
}
body.light .btn-google:hover {
  background: #f1f5f9;
  border-color: rgba(0,0,0,.18);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
body.light .auth-divider { color: #94a3b8; }
body.light .auth-divider::before,
body.light .auth-divider::after { background: rgba(0,0,0,.1); }
body.light .form-label { color: #475569; }
body.light .pw-toggle { color: #94a3b8; }
body.light .pw-toggle:hover { color: #64748b; }
body.light .forgot-link { color: #00d4aa; }
body.light .forgot-link:hover { opacity: .75; }
body.light .remember-row span { color: #64748b; }
body.light .auth-footer { color: #64748b; }
body.light .auth-footer a { color: #00d4aa; }
body.light .back-btn { color: #64748b; }
body.light .back-btn:hover { color: #0f172a; }
body.light .forgot-title { color: #0f172a; }
body.light .forgot-sub   { color: #64748b; }
body.light .pw-strength-label { color: #64748b; }

/* Login wall */
body.light .login-wall-card {
  background: #ffffff;
  border-color: rgba(0,0,0,.1);
  box-shadow: 0 24px 64px rgba(0,0,0,.1);
}
body.light .login-wall-card h2 { color: #0f172a; }
body.light .login-wall-card p  { color: #64748b; }
body.light .login-wall-icon {
  background: linear-gradient(135deg, rgba(0,212,170,.1), rgba(124,106,255,.1));
  border-color: rgba(0,212,170,.2);
}

/* User info sidebar */
body.light .user-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
body.light .sync-dot         { background: var(--accent); }
body.light .sync-dot.offline { background: #ef4444; }
body.light .sync-dot.syncing { background: #f59e0b; }
body.light .btn-logout:hover {
  background: rgba(239,68,68,.1);
  color: #dc2626;
}

/* Nav locked */
body.light .nav-item.nav-locked { opacity: .5; }
body.light .nav-lock-badge {
  background: rgba(0,0,0,.06);
  color: #64748b;
}