/* ════════════════════════════════════════════════════════════════════════════
   MoneoSpace — auth.css
   Login screen shown until Firebase confirms an authenticated user.
   Relies on the CSS custom properties (--bg-deep, --accent-teal, etc.)
   declared on :root in index.html.
════════════════════════════════════════════════════════════════════════════ */

/* Hide the app shell until auth.js confirms a signed-in user */
body:not(.authenticated) .app,
body:not(.authenticated) .bottom-nav,
body:not(.authenticated) .sidebar-backdrop {
  display: none !important;
}

/* Hide the auth screen once authenticated */
body.authenticated .auth-screen {
  display: none !important;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 15%, rgba(0,201,167,0.10), transparent 55%),
    radial-gradient(circle at 82% 78%, rgba(123,94,167,0.14), transparent 55%),
    var(--bg-deep, #07091A);
}

.auth-card {
  width: 380px;
  max-width: 100%;
  background: var(--bg-panel, #0D1B3E);
  border: 1px solid var(--border-mid, rgba(255,255,255,0.10));
  border-radius: var(--radius-lg, 12px);
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.auth-logo {
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--accent-teal, #00C9A7);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 22px;
  color: #07091A;
  position: relative;
}
.auth-logo::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 18px;
  border: 1px solid rgba(0,201,167,0.30);
  animation: auth-orbit 3s ease-in-out infinite;
}
@keyframes auth-orbit {
  0%, 100% { opacity: .4; transform: scale(1); }
  50%      { opacity: .1; transform: scale(1.12); }
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px; font-weight: 700;
  color: var(--text-primary, #E8EAF0);
  margin-bottom: 6px;
}
.auth-title span { color: var(--accent-teal, #00C9A7); }

.auth-subtitle {
  font-size: 12.5px;
  color: var(--text-muted, rgba(232,234,240,0.45));
  line-height: 1.5;
  margin-bottom: 26px;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm, 6px);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .14s, background .14s, transform .1s;
  border: 1px solid transparent;
}
.auth-btn:active { transform: translateY(1px); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.auth-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.auth-btn-google {
  background: #ffffff;
  color: #1f1f1f;
  border-color: rgba(0,0,0,0.08);
}
.auth-btn-google:hover:not(:disabled) { background: #f3f3f3; }

.auth-btn-facebook {
  background: #1877F2;
  color: #ffffff;
}
.auth-btn-facebook:hover:not(:disabled) { background: #1568d6; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 4px;
  color: var(--text-dim, rgba(232,234,240,0.28));
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, rgba(255,255,255,0.07));
}

.auth-error {
  margin-top: 16px;
  padding: 9px 12px;
  background: rgba(224,91,106,0.10);
  border: 1px solid rgba(224,91,106,0.24);
  border-radius: var(--radius-sm, 6px);
  color: var(--accent-red, #E05B6A);
  font-size: 11.5px;
  line-height: 1.5;
}

.auth-loading {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted, rgba(232,234,240,0.45));
}
.auth-loading[hidden] {
  display: none;
}

.auth-spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(232,234,240,0.18);
  border-top-color: var(--accent-teal, #00C9A7);
  animation: auth-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-footnote {
  margin-top: 20px;
  font-size: 10px;
  color: var(--text-dim, rgba(232,234,240,0.28));
  line-height: 1.5;
}

/* ─── Sign-out control used in sidebar footer / settings ─────────────────── */
.auth-signout-btn {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm, 6px);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid, rgba(255,255,255,0.10));
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted, rgba(232,234,240,0.45));
  cursor: pointer; font-size: 13px;
  margin-left: auto; flex-shrink: 0;
  transition: all .14s;
}
.auth-signout-btn:hover {
  background: rgba(224,91,106,0.14);
  border-color: rgba(224,91,106,0.3);
  color: var(--accent-red, #E05B6A);
}

@media (max-width: 420px) {
  .auth-card { padding: 26px 20px 22px; }
}