/*
 Author: abhik pramanik
 Change Date: 2026-10-04
 Change details: Login uses a large translucent surface and left-aligned
   form over the locked welcome-hero-dark.webp file (same image in light
   and dark; blur only on the card). Signup/profile keep the left glass
   panel. Prior: Centered Welcome landing (brand + glass card) over the
   locked welcome-hero-dark.webp file. Auth screens keep the left glass
   panel. Prior: Theme toggle is no longer position:fixed. Unauth overlay
   bar holds theme + title (Q3-A). Prior: Replaces split columns with a
   full-bleed theme-matched hero and frosted slide-in panel.
 Purpose: Consumer Analysis chrome — full-screen hero, glass panel, brand
   assets, controls, and responsive Welcome/auth layout.
 Inputs: tokens.css custom properties
 Outputs: Welcome / stub / coming-soon page styles
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(165deg, var(--bg-canvas-start), var(--bg-canvas-mid) 48%, var(--bg-canvas-end));
  color: var(--text-primary);
  font-family: var(--font-ui);
}

#app {
  min-height: 100vh;
}

.welcome-page {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  padding: clamp(72px, 8vw, 96px) clamp(24px, 5vw, 72px) clamp(24px, 5vw, 72px);
  overflow: hidden;
}

.welcome-form-col {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, calc(var(--form-col-max) + 144px));
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--glass-highlight);
  border-radius: 24px;
  background: var(--bg-card-glass);
  box-shadow: 0 24px 64px var(--glass-shadow);
  backdrop-filter: blur(3px) saturate(50%);
  -webkit-backdrop-filter: blur(18px) saturate(128%);
  animation: panel-slide-in 560ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.welcome-page--profile .welcome-form-col {
  width: min(100%, calc(var(--form-col-profile-max) + 96px));
  justify-content: flex-start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.welcome-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.welcome-wordmark {
  width: min(100%, 300px);
  margin-bottom: 16px;
}

.welcome-wordmark img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  /*
   * The supplied wordmark has an opaque background. The soft edge lets it
   * merge with the canvas instead of presenting its source square as a card.
   */
  -webkit-mask-image: radial-gradient(ellipse 78% 74% at center, #000 66%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 74% at center, #000 66%, transparent 100%);
}

html[data-theme="dark"] .welcome-wordmark--dark {
  mix-blend-mode: lighten;
}

html[data-theme="light"] .welcome-wordmark--light {
  mix-blend-mode: multiply;
}

.brand-logo-variants {
  width: 40px;
  height: 40px;
  display: inline-flex;
  flex: 0 0 auto;
}

.brand-logo-variants img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.brand-logo-variants img.brand-logo--light,
.welcome-wordmark img.welcome-wordmark--light {
  display: none;
}

html[data-theme="light"] .brand-logo-variants img.brand-logo--dark,
html[data-theme="light"] .welcome-wordmark img.welcome-wordmark--dark {
  display: none;
}

html[data-theme="light"] .brand-logo-variants img.brand-logo--light,
html[data-theme="light"] .welcome-wordmark img.welcome-wordmark--light {
  display: block;
}

.welcome-brand-line {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.welcome-title {
  margin: 0 0 12px;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.welcome-tagline {
  margin: 0 0 32px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: var(--form-col-max);
}

.welcome-ctas {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 220px;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 180px;
  width: 100%;
  padding: 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--accent-blue-ink);
  border: 1px solid var(--accent-blue-bottom);
  box-shadow: 0 8px 22px var(--shadow-accent);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.theme-toggle {
  position: static;
  z-index: 10;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card-glass);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-glass);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.app-topbar-title {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.theme-toggle-icon {
  color: var(--link);
  font-size: 1.05rem;
  line-height: 1;
}

.welcome-visual {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
}

.welcome-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.welcome-visual img.welcome-hero--dark,
.welcome-visual img.welcome-hero--light {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
}

.welcome-visual img.welcome-hero--light {
  display: none;
}

html[data-theme="light"] .welcome-visual img.welcome-hero--dark {
  display: none;
}

html[data-theme="light"] .welcome-visual img.welcome-hero--light {
  display: block;
}

@keyframes panel-slide-in {
  from {
    opacity: 0.01;
    transform: translateX(-48px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes welcome-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-form-col,
  .dash-page {
    animation: none;
  }
}

@media (max-width: 720px) {
  .welcome-page {
    align-items: flex-start;
    padding: 80px 16px 24px;
  }

  .welcome-form-col {
    max-width: none;
    padding: 28px 24px;
  }

  .welcome-ctas {
    max-width: none;
  }

  .welcome-page--profile .welcome-form-col {
    max-height: none;
  }
}

/*
 * Centered Welcome landing. Scoped under .welcome-landing so Login / Sign up
 * keep the existing left glass panel and theme-swapped heroes.
 */
.welcome-page.welcome-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 32px;
  overflow: hidden;
  isolation: isolate;
  background-image: url("/assets/brand/welcome-hero-dark.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.welcome-landing-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(5, 15, 35, 0.25);
}

.welcome-landing-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
}

.welcome-landing-toggle .theme-toggle {
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 600;
}

.welcome-landing-toggle .theme-toggle-icon {
  color: #f8fafc;
}

.welcome-landing-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: welcome-fade-in 0.55s ease-out;
}

.welcome-landing-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 42px;
}

.welcome-landing-logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.welcome-landing-name {
  margin: 16px 0 0;
  font-size: 32px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #f8fafc;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
}

.welcome-landing-tagline {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}

.welcome-landing-card {
  width: 410px;
  min-height: 330px;
  padding: 40px;
  border-radius: 22px;
  background: rgba(17, 31, 55, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.welcome-landing-title {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  color: #f8fafc;
}

.welcome-landing-copy {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #aab6c8;
}

.welcome-landing-ctas {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

.welcome-landing .btn-primary,
.welcome-landing .btn-secondary {
  width: 100%;
  min-width: 0;
  min-height: 47px;
  height: 47px;
  border-radius: 11px;
  font-weight: 600;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.welcome-landing .btn-primary {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
  box-shadow: none;
}

.welcome-landing .btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.welcome-landing .btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #f8fafc;
}

.welcome-landing .btn-secondary:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(96, 165, 250, 0.8);
}

.welcome-landing-footer {
  margin: 28px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(203, 213, 225, 0.55);
  text-align: center;
}

html[data-theme="light"] .welcome-landing-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

html[data-theme="light"] .welcome-landing-title {
  color: #0f172a;
}

html[data-theme="light"] .welcome-landing-copy {
  color: #64748b;
}

html[data-theme="light"] .welcome-landing .btn-secondary {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.28);
}

html[data-theme="light"] .welcome-landing .btn-secondary:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(96, 165, 250, 0.8);
}

html[data-theme="light"] .welcome-landing-name {
  color: #f8fafc;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .welcome-landing-tagline {
  color: #cbd5e1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

@media (max-width: 900px) {
  .welcome-page.welcome-landing {
    padding: 64px 20px 28px;
  }

  .welcome-landing-card {
    width: 380px;
  }

  .welcome-landing-brand {
    margin-bottom: 36px;
  }
}

@media (max-width: 720px) {
  .welcome-page.welcome-landing {
    align-items: center;
    padding: 64px 16px 24px;
  }

  .welcome-landing-card {
    width: calc(100% - 32px);
    max-width: 400px;
    min-height: 0;
    padding: 24px;
  }

  .welcome-landing-logo {
    width: 52px;
    height: 52px;
  }

  .welcome-landing-name {
    font-size: 26px;
  }

  .welcome-landing-title {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-landing-stage {
    animation: none;
  }
}

/*
 * Login (`/login`). Scoped under .login-page so Sign up / profile keep the
 * left glass panel and theme-swapped heroes. The locked dark hero file is
 * the CSS background in both themes; blur is only on .login-surface.
 */
.welcome-page.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 32px;
  overflow-x: hidden;
  overflow-y: auto;
  isolation: isolate;
  background-image: url("/assets/brand/welcome-hero-dark.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-surface {
  position: relative;
  z-index: 1;
  width: calc(100% - 100px);
  max-width: 1500px;
  margin: 80px auto 40px;
  padding: 48px;
  border-radius: 20px;
  background: rgba(8, 24, 46, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: welcome-fade-in 0.55s ease-out;
}

.login-form-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 390px;
  max-width: 100%;
}

.login-page .welcome-brand {
  margin-bottom: 22px;
}

.login-page .brand-logo-variants {
  width: 32px;
  height: 32px;
}

.login-page .welcome-brand-line {
  font-size: 14px;
  color: #94a3b8;
}

.login-title {
  margin: 0 0 8px;
  font-size: 46px;
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.login-tagline {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.45;
  color: #94a3b8;
}

.login-page .auth-form,
.login-page .auth-google-wrap,
.login-page .auth-or,
.login-page .btn-google,
.login-page .auth-alert {
  max-width: none;
  width: 100%;
}

.login-page .auth-label {
  font-size: 0.875rem;
  color: #94a3b8;
}

.login-page .auth-input {
  height: 46px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 11px;
  background: rgba(2, 15, 30, 0.55);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #f8fafc;
}

.login-page .auth-input:focus,
.login-page .auth-input:focus-visible {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-page .auth-forgot {
  margin: -4px 0 0;
}

.login-page .auth-forgot a {
  color: #60a5fa;
  font-size: 13.5px;
}

.login-page .auth-submit.btn-primary {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  height: 46px;
  margin-top: 8px;
  border-radius: 11px;
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
  box-shadow: none;
}

.login-page .auth-submit.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.login-page .auth-submit.btn-primary:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.login-page .auth-alert:not(.auth-alert-ok) {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f87171;
  font-size: 0.9rem;
}

.login-page .auth-or {
  margin: 16px 0;
  font-size: 13px;
  opacity: 0.65;
}

.login-page .btn-google {
  min-width: 0;
  min-height: 46px;
  height: 46px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: transparent;
  color: #f8fafc;
}

.login-page .btn-google:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.login-page .auth-footer {
  margin: 18px 0 0;
  color: #cbd5e1;
  font-size: 14px;
}

.login-page .auth-footer a {
  color: #60a5fa;
}

html[data-theme="light"] .login-surface {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .login-title {
  color: #0f172a;
}

html[data-theme="light"] .login-page .welcome-brand-line,
html[data-theme="light"] .login-tagline,
html[data-theme="light"] .login-page .auth-label {
  color: #64748b;
}

html[data-theme="light"] .login-page .auth-input {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

html[data-theme="light"] .login-page .auth-submit.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

html[data-theme="light"] .login-page .btn-google {
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

html[data-theme="light"] .login-page .btn-google:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.06);
}

html[data-theme="light"] .login-page .auth-footer {
  color: #64748b;
}

html[data-theme="light"] .login-page .auth-forgot a,
html[data-theme="light"] .login-page .auth-footer a {
  color: #60a5fa;
}

@media (max-width: 900px) {
  .login-surface {
    width: calc(100% - 64px);
    margin: 76px auto 32px;
    padding: 32px;
    border-radius: 18px;
  }
}

@media (max-width: 720px) {
  .welcome-page.login-page {
    align-items: center;
    padding: 0 0 20px;
  }

  .login-surface {
    width: calc(100% - 32px);
    margin: 72px auto 20px;
    padding: 24px;
    border-radius: 18px;
  }

  .login-form-col {
    width: 100%;
  }

  .login-title {
    font-size: 34px;
  }

  .login-tagline {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-surface {
    animation: none;
  }
}
