/* TuningScanner auth pages — works even before patched JS loads */
html,
body,
#root {
  background-color: #0a101c !important;
  color: #f3f6fc;
  min-height: 100%;
}

/* Homepage scroll-reveal fallback — never hide content if JS observer misses */
.reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* Base44 light auth shell fallback */
.min-h-screen.flex.items-center.justify-center {
  background-color: #0a101c !important;
}

.bg-background {
  background-color: #0a101c !important;
}

.bg-card,
.rounded-2xl.border.p-8,
.rounded-2xl.shadow-sm.border {
  background-color: #111a2e !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f3f6fc !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35) !important;
}

.text-foreground,
h1.text-3xl {
  color: #fff !important;
}

.text-muted-foreground,
label,
.text-sm.text-muted-foreground {
  color: #8b95ab !important;
}

/* Inputs on auth pages only (not newsletter bar) */
.min-h-screen.flex.items-center.justify-center input[type="email"],
.min-h-screen.flex.items-center.justify-center input[type="password"],
.min-h-screen.flex.items-center.justify-center input[type="text"] {
  background-color: #0a101c !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

.min-h-screen.flex.items-center.justify-center input::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* Newsletter bar — inputs slightly darker than bar (#5B7CF9 → #6B89FF) */
form[data-ts-newsletter] input[type="text"],
form[data-ts-newsletter] input[type="email"] {
  background-color: #627ef8 !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #fff !important;
}

form[data-ts-newsletter] input::placeholder {
  color: rgba(255, 255, 255, 0.75) !important;
}

form[data-ts-newsletter] input:focus {
  background-color: #5a76f6 !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

/* Newsletter — mobile: stacked full-width fields */
form[data-ts-newsletter] {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 0.5rem !important;
}

form[data-ts-newsletter] input[type="text"],
form[data-ts-newsletter] input[type="email"] {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

form[data-ts-newsletter] button[type="submit"] {
  width: 100% !important;
  justify-content: center !important;
}

@media (min-width: 640px) {
  form[data-ts-newsletter] {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    max-width: 36rem !important;
  }

  form[data-ts-newsletter] input[type="text"] {
    width: 9rem !important;
    flex: 0 0 auto !important;
  }

  form[data-ts-newsletter] input[type="email"] {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
  }

  form[data-ts-newsletter] button[type="submit"] {
    width: auto !important;
    flex: 0 0 auto !important;
  }
}

button[type="submit"],
button.w-full.h-12.font-medium {
  background-color: #5b7cf9 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  box-shadow: 0 0 28px rgba(91, 124, 249, 0.38) !important;
  transition: background-color 0.15s ease, box-shadow 0.15s ease !important;
}

button[type="submit"]:hover:not(:disabled),
button.w-full.h-12.font-medium:hover:not(:disabled) {
  background-color: #6b89ff !important;
  box-shadow: 0 0 36px rgba(91, 124, 249, 0.55) !important;
}

a.text-primary,
.text-primary {
  color: #5b7cf9 !important;
}

a.ts-auth-home-link {
  color: #8b95ab !important;
  text-decoration: none !important;
}

a.ts-auth-home-link:hover {
  color: #5b7cf9 !important;
}

.border-border,
.border-t.border-border {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.bg-primary {
  background-color: #5b7cf9 !important;
}

.text-primary-foreground {
  color: #fff !important;
}

/* Hide Google SSO on stale cached bundles */
button:has(path[fill="#4285F4"]) {
  display: none !important;
}

/* Hide "oder / or" divider after removed Google button */
button:has(path[fill="#4285F4"]) + div.relative.mb-6 {
  display: none !important;
}

/* Register page — label-above-field layout (matches app) */
.min-h-screen.flex.items-center.justify-center form.space-y-1 label,
.min-h-screen.flex.items-center.justify-center form.space-y-1 .text-white {
  color: #fff !important;
}

.min-h-screen.flex.items-center.justify-center .rounded-lg.bg-\[\#5B7CF9\]\/15 {
  background-color: rgba(91, 124, 249, 0.15) !important;
}

.min-h-screen.flex.items-center.justify-center .text-\[\#C5D0FF\] {
  color: #c5d0ff !important;
}

/* Hide stale OTP verification UI from cached bundles */
.min-h-screen.flex.items-center.justify-center [data-slot="input-otp"] {
  display: none !important;
}

/* Homepage header login — rendered at page bottom via app-nav.js */
header.sticky.top-0 a[href="/login"] {
  display: none !important;
}

/* Logged-in auth links in Base44 header nav (desktop + mobile section bar) */
header.sticky.top-0 nav .ts-header-auth-link--desktop,
nav.fixed.inset-x-0.bottom-0 .ts-header-auth-link--mobile {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none !important;
  color: #aab3c5;
  transition: color 0.15s ease;
  white-space: nowrap;
}

nav.fixed.inset-x-0.bottom-0 .ts-header-auth-link--mobile {
  flex-shrink: 0;
}

header.sticky.top-0 nav .ts-header-auth-link--desktop:hover,
nav.fixed.inset-x-0.bottom-0 .ts-header-auth-link--mobile:hover {
  color: #fff;
}

/* Inline auth section at bottom of homepage (scrolls with content) */
#ts-home-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 2.5rem 1rem;
  background: #0a101c;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}

@media (max-width: 767px) {
  /* Clearance above fixed mobile section nav when scrolled to bottom */
  #ts-home-dock {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
}

.ts-home-dock-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  background: #5b7cf9;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none !important;
  box-shadow: 0 0 28px rgba(91, 124, 249, 0.38);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.ts-home-dock-login:hover {
  background: #6b89ff;
  box-shadow: 0 0 36px rgba(91, 124, 249, 0.55);
}

.ts-home-dock-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: transparent;
  color: #ef4444 !important;
  font-weight: 600;
  font-size: 0.9375rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ts-home-dock-logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.65);
  color: #f87171 !important;
}
