/* Vovix – PRD Design Handoff. Mobile-first. */
/* PRD colors: Action Green #00C853 | Premium Silver #C0C0C0 | Trust Navy #102A43 | Innovation Cyan #00E5FF */

:root {
  --vovix-emerald: #00C853;
  --vovix-emerald-hover: #00a843;
  --vovix-silver: #F5F7FA;
  --vovix-silver-alt: #C0C0C0;
  --vovix-navy: #102A43;
  --vovix-cyan: #00E5FF;
  --vovix-cyan-soft: rgba(0, 229, 255, 0.15);
  --primary: var(--vovix-emerald);
  --primary-hover: var(--vovix-emerald-hover);
  --primary-light: rgba(0, 200, 83, 0.12);
  --secondary: var(--vovix-navy);
  --accent: var(--vovix-cyan);
  --success: var(--vovix-emerald);
  --success-bg: rgba(0, 200, 83, 0.12);
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --info: var(--vovix-cyan);
  --info-bg: var(--vovix-cyan-soft);
  --light-bg: var(--vovix-silver);
  --card-bg: #ffffff;
  --text: var(--vovix-navy);
  --text-muted: #475569;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.08);
  --navbar-height: 58px;
  --glass-bg: rgba(255,255,255,0.85);
  --glass-border: rgba(255,255,255,0.3);
}

* { box-sizing: border-box; }

/* Mobile: ensure full page visible and scrollable on all screen sizes */
html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}
html, body {
  min-width: 0;
  max-width: 100vw;
  width: 100%;
}
body {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport – better on mobile browsers (Safari 15.4+) */
}

/* Tighter layout – reduce empty space in corners/edges */
main {
  flex: 1;
  min-height: 0; /* allow flex child to shrink so content can scroll */
  overflow-y: visible;
  overflow-x: hidden;
}
main.container { padding-left: 0.75rem; padding-right: 0.75rem; }
main.container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
@media (min-width: 576px) {
  main.container, main.container-fluid { padding-left: 1rem; padding-right: 1rem; }
}

/* PRD typography: Montserrat (headers), Inter (body) */
body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--light-bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4, h5, h6, .navbar-brand, .fw-bold {
  font-family: 'Montserrat', 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Navbar – Deep Navy (trust, premium fintech) */
.navbar {
  background: linear-gradient(135deg, var(--vovix-navy) 0%, #1a365d 100%) !important;
  box-shadow: var(--shadow);
  min-height: var(--navbar-height);
  padding: 0.45rem 0 !important;
}

.navbar .container { padding-left: 0.75rem; padding-right: 0.75rem; }
@media (min-width: 576px) {
  .navbar .container { padding-left: 1rem; padding-right: 1rem; }
}

.navbar-brand {
  font-weight: 700;
  color: #fff !important;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  margin-left: -1.25rem;
}

.navbar-brand i {
  margin-right: 0.4rem;
  color: var(--vovix-emerald);
}

/* Logo: SVG only (PRD). Navbar logo larger; mobile-first. */
.navbar-brand img.vovix-logo-navbar {
  height: 72px;
  max-height: none;
  width: auto;
  display: block;
  object-fit: contain;
}
img.vovix-logo-hero,
img.vovix-logo-admin {
  height: 48px;
  max-height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}
/* Login page: logo in a clear panel above the text so it’s clearly visible */
.login-page-wrap .login-logo-panel {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 2rem;
  box-shadow: 0 4px 24px rgba(16, 42, 67, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.login-page-wrap .login-logo-panel-compact { padding: 1rem 1.5rem; }
.login-page-wrap .login-brand-block { max-width: 100%; text-align: center; }
.login-page-wrap .login-brand-block .login-logo-panel { margin-left: auto; margin-right: auto; }
.login-page-wrap .login-brand-block .card { margin-left: auto; margin-right: auto; }
.login-page-wrap .login-page-row {
  gap: 1.5rem 2rem !important;
  flex-wrap: wrap;
}
.login-page-wrap .login-col-brand,
.login-page-wrap .login-col-form {
  min-width: 0;
  max-width: 100%;
}
/* Fintech branding: Pearl Silver page, Trust Navy text/borders, Emerald button */
.login-page-wrap {
  background: var(--vovix-silver) !important; /* #F5F7FA */
}
.login-page-wrap .login-form-card {
  max-width: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid rgba(16, 42, 67, 0.12);
}
.login-page-wrap .login-form-card .form-label,
.login-page-wrap .login-form-card h2,
.login-page-wrap .login-form-card .text-muted {
  color: var(--vovix-navy) !important;
}
.login-page-wrap .login-form-card .form-control {
  border-color: rgba(16, 42, 67, 0.2);
  color: var(--vovix-navy);
}
.login-page-wrap .login-form-card .form-control:focus {
  border-color: var(--vovix-emerald);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.login-page-wrap .login-form-card .btn-primary,
.login-page-wrap .login-form-card .btn-vovix-secure {
  background: var(--vovix-emerald) !important;
  border-color: var(--vovix-emerald) !important;
  color: #fff !important;
}
.login-page-wrap .login-form-card .btn-primary:hover,
.login-page-wrap .login-form-card .btn-vovix-secure:hover {
  background: var(--vovix-emerald-hover) !important;
  border-color: var(--vovix-emerald-hover) !important;
  color: #fff !important;
}
.login-page-wrap .login-form-card .btn-google {
  border-color: rgba(16, 42, 67, 0.25);
  color: var(--vovix-navy);
}
.login-page-wrap .login-form-card .btn-google:hover {
  border-color: var(--vovix-emerald);
  color: var(--vovix-emerald);
  background: var(--primary-light);
}
.login-page-wrap .login-form-card a:not(.btn) {
  color: var(--vovix-navy);
}
.login-page-wrap .login-form-card a:not(.btn):hover {
  color: var(--vovix-emerald);
}
.login-page-wrap .login-form-card .caps-lock-warn {
  color: var(--warning);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}
.login-page-wrap .login-password-wrap {
  position: relative;
}
.login-page-wrap .login-password-wrap .form-control {
  padding-right: 2.75rem;
}
.login-page-wrap .login-password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--vovix-navy);
  opacity: 0.6;
  padding: 0.25rem;
  cursor: pointer;
}
.login-page-wrap .login-password-toggle:hover {
  opacity: 1;
  color: var(--vovix-emerald);
}
.login-page-wrap .login-security-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
@media (min-width: 1200px) {
  .login-page-wrap .login-page-row { gap: 2rem 2.5rem !important; }
}
.login-page-wrap .login-logo-panel {
  max-width: 100%;
  box-sizing: border-box;
}
.login-page-wrap .login-logo-panel .vovix-logo-login {
  height: 80px !important;
  max-height: 100px;
  max-width: 100% !important;
  width: auto !important;
  display: block;
  object-fit: contain;
  object-position: center center;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .login-page-wrap .login-logo-panel .vovix-logo-login {
    height: 100px !important;
    max-height: 120px;
  }
}
@media (min-width: 1200px) {
  .login-page-wrap .login-logo-panel {
    padding: 1.5rem 2.5rem;
    min-height: 0;
  }
  .login-page-wrap .login-logo-panel .vovix-logo-login {
    height: 120px !important;
    max-height: 140px;
  }
}
@media (max-width: 575.98px) {
  .login-page-wrap .login-logo-panel {
    padding: 1rem 1.25rem;
    min-height: 0;
  }
  .login-page-wrap .login-logo-panel .vovix-logo-login {
    height: 72px !important;
    max-height: 88px;
  }
}
@media (max-width: 575.98px) {
  .navbar-brand img.vovix-logo-navbar { height: 52px; }
}
.hero-section img.vovix-logo-hero,
.vovix-hero-home img.vovix-logo-hero { height: 56px; max-height: none; }

.nav-link {
  color: rgba(255,255,255,0.9) !important;
  transition: all 0.2s;
  padding: 0.45rem 0.85rem !important;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 1rem;
}

.nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.1);
}

.nav-link.active {
  color: #fff !important;
  background: var(--primary);
}

/* Result page tabs: light background, dark text (override navbar .nav-link) */
#resultTabs.nav-tabs-result {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  box-shadow: var(--shadow);
}
#resultTabs.nav-tabs-result .nav-link {
  color: var(--text) !important;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}
#resultTabs.nav-tabs-result .nav-link:hover {
  color: var(--primary) !important;
  background: var(--primary-light);
}
#resultTabs.nav-tabs-result .nav-link.active {
  color: #fff !important;
  background: var(--primary);
}
#resultTabs.nav-tabs-result .nav-link i {
  color: inherit;
}

/* Market news page tabs: same style as result tabs */
#marketNewsTabs.nav-tabs-result {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  box-shadow: var(--shadow);
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#marketNewsTabs.nav-tabs-result .nav-link {
  color: var(--text) !important;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
}
#marketNewsTabs.nav-tabs-result .nav-link:hover {
  color: var(--primary) !important;
  background: var(--primary-light);
}
#marketNewsTabs.nav-tabs-result .nav-link.active {
  color: #fff !important;
  background: var(--primary);
}
#marketNewsTabs.nav-tabs-result .nav-link i {
  color: inherit;
}
#marketNewsTabs.nav-tabs-result .nav-item {
  flex-shrink: 0;
}

/* Cards – stronger radius and shadow */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s, transform 0.25s;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-body { padding: 1.5rem 1.75rem; }

.card-header {
  font-weight: 600;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1rem 1.5rem;
}

/* Welcome dashboard strip (home): keep all buttons inside on mobile */
.welcome-dashboard-wrap {
  overflow-x: hidden;
}
.welcome-dashboard-card-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.welcome-dashboard-text {
  min-width: 0;
}
.welcome-dashboard-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
@media (max-width: 575.98px) {
  .welcome-dashboard-card-body {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .welcome-dashboard-text {
    width: 100%;
  }
  .welcome-dashboard-text .ms-2 { margin-left: 0 !important; display: block; margin-top: 0.25rem; }
  .welcome-dashboard-btns {
    width: 100%;
    justify-content: flex-start;
  }
  .welcome-dashboard-btns .btn { flex-shrink: 0; }
}

/* Buttons – pill style primary */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.2s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, #065f46 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-outline-primary {
  border-width: 2px;
  font-weight: 600;
}

.btn-outline-primary:hover {
  transform: translateY(-1px);
}

/* Form controls */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  padding: 0.7rem 1rem;
  font-size: 1rem;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.form-label { font-weight: 500; color: var(--text); }

/* Alerts / flash – navy body text (readability), Vovix emerald/cyan/warning accents */
.alert {
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: var(--vovix-navy);
  box-shadow: var(--shadow);
}

.alert-success {
  background: var(--success-bg);
  border-left-color: var(--vovix-emerald);
  color: var(--vovix-navy);
}
.alert-success .alert-link {
  color: var(--vovix-emerald);
  font-weight: 600;
}

.alert-info {
  background: var(--info-bg);
  border-left-color: var(--vovix-cyan);
  color: var(--vovix-navy);
}
.alert-info .alert-link {
  color: #0e7490;
  font-weight: 600;
}

.alert-warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
  color: var(--vovix-navy);
}
.alert-warning .alert-link {
  color: #b45309;
  font-weight: 600;
}

.alert-danger {
  background: var(--danger-bg);
  border-left-color: var(--danger);
  color: #7f1d1d;
}
.alert-danger .alert-link {
  color: #b91c1c;
  font-weight: 600;
}

.alert .btn-close {
  filter: none;
  opacity: 0.5;
}
.alert .btn-close:hover {
  opacity: 0.85;
}

/* Hero section – Money Flow layout: Pearl White / Light Silver (Venus clarity) */
.hero-section {
  background: linear-gradient(180deg, var(--vovix-silver) 0%, #ffffff 50%, var(--vovix-silver) 100%);
  color: var(--vovix-navy);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
}

.hero-section .display-4, .hero-section h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--vovix-navy) !important;
}
.hero-section img.vovix-logo-hero { height: 56px; width: auto; }
.hero-section .hero-headline { color: var(--vovix-navy) !important; }
.hero-section .hero-sub { color: var(--text-muted); }
.hero-section .text-primary { color: var(--vovix-emerald) !important; }
.hero-section .btn-primary {
  background: var(--vovix-emerald) !important;
  border-color: var(--vovix-emerald) !important;
  color: #fff !important;
}
.hero-section .btn-primary:hover {
  background: var(--vovix-emerald-hover) !important;
  border-color: var(--vovix-emerald-hover) !important;
  color: #fff !important;
}
.hero-section .btn-outline-primary {
  border-color: var(--vovix-navy);
  color: var(--vovix-navy);
}
.hero-section .btn-outline-primary:hover {
  background: rgba(16, 42, 67, 0.08);
  border-color: var(--vovix-navy);
  color: var(--vovix-navy);
}

.hero-section .lead { color: var(--vovix-navy); opacity: 0.9; font-size: 1.15rem; }

.hero-buttons .btn { min-width: 160px; }
@media (max-width: 576px) {
  .hero-buttons .btn { min-width: 100%; width: 100%; }
  .hero-buttons { gap: 0.75rem !important; }
}

.hero-search-form .form-control {
  color: var(--vovix-navy);
  font-size: 1rem;
}
.hero-search-form .form-control::placeholder { color: var(--vovix-silver-alt); opacity: 0.9; }
.hero-search-form .form-control:focus {
  border-color: var(--vovix-emerald);
  box-shadow: 0 0 0 0.2rem rgba(0, 200, 83, 0.2);
}

/* Hero ticker strip */
.hero-ticker-wrap {
  overflow: hidden;
  padding: 0.5rem 0;
  max-width: 100%;
}
.hero-ticker {
  display: flex;
  width: max-content;
  animation: hero-ticker-scroll 35s linear infinite;
  gap: 2rem;
}
.hero-ticker span {
  color: var(--vovix-emerald);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
@media (prefers-reduced-motion: reduce) {
  .hero-ticker { animation: none; }
}
@keyframes hero-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Hero RELIANCE teaser - compact sentiment + fair value in hero */
.hero-teaser {
  display: flex;
  justify-content: center;
}
.hero-teaser-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  border: 1px solid rgba(0, 200, 83, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.hero-teaser-label {
  color: var(--vovix-navy);
  font-weight: 600;
}
.hero-teaser-gauge {
  width: 80px;
  height: 6px;
  background: rgba(16, 42, 67, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.hero-teaser-gauge-bar {
  height: 100%;
  background: var(--vovix-emerald);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.hero-teaser-sentiment {
  color: var(--vovix-emerald);
  font-weight: 600;
}
.hero-teaser-badge {
  padding: 0.2rem 0.5rem;
  background: var(--vovix-cyan-soft);
  color: var(--vovix-navy);
  border-radius: 4px;
  font-weight: 500;
}

/* Demo page: sticky CTA bar at bottom */
.demo-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}
.demo-sticky-cta .container { max-width: 1140px; margin: 0 auto; padding-left: 0.75rem; padding-right: 0.75rem; }
@media (min-width: 576px) {
  .demo-sticky-cta .container { padding-left: 1rem; padding-right: 1rem; }
}
.demo-page-wrap { padding-bottom: 4.5rem; }

/* Landing card hover (no transform on touch to avoid layout shift) */
.card-hover:hover { box-shadow: var(--shadow-hover); }
@media (hover: hover) {
  .card-hover:hover { transform: translateY(-2px); }
}

/* Sentiment */
.sentiment-positive { background: var(--success-bg); color: var(--success); }
.sentiment-negative { background: var(--danger-bg); color: var(--danger); }
.sentiment-neutral { background: var(--info-bg); color: var(--info); }

.sentiment-indicator {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
}

/* Stock search — dropdown is absolutely positioned; global .card { overflow: hidden } would clip it */
.stock-search { max-width: 640px; margin: 2rem auto; }
.card.stock-search,
.card.stock-search .card-body {
  overflow: visible;
}
.search-input {
  border-radius: var(--radius-pill);
  padding: 1rem 1.5rem;
  font-size: 1.05rem;
  border: 2px solid var(--border);
}
.search-input:focus { border-color: var(--primary); }

.search-results {
  position: absolute;
  z-index: 2000;
  width: 100%;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border);
  margin-top: 4px;
}
.search-container,
.hero-search-container { position: relative; }

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item.selected {
  background: var(--primary-light, #f0fdf4);
}
.result-symbol { font-weight: 600; font-size: 1rem; }
.result-name { color: var(--muted); font-size: 0.9em; margin-top: 2px; }
.result-status { font-size: 0.8em; color: var(--muted); margin-top: 2px; }

/* Key factors */
.key-factors {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ecfdf5 100%);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(5, 150, 105, 0.2);
}
.key-factor-item {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--primary);
  margin: 0.5rem 0;
  background: var(--card-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 500;
}

/* News cards */
.news-card {
  border-left: 4px solid var(--primary);
  margin: 0.5rem 0;
  transition: all 0.2s;
}
.news-card:hover { border-left-color: var(--primary-hover); box-shadow: var(--shadow); }

/* Main content */
main { flex: 1; padding-top: 0.75rem; padding-bottom: 2.5rem; }

.container { max-width: 1140px; }

/* Footer – Deep Navy (trust, live data feel) */
footer.bg-dark, footer.vovix-footer {
  background: linear-gradient(135deg, var(--vovix-navy) 0%, #0d2137 100%) !important;
  margin-top: auto;
  padding: 1.75rem 0 !important;
  border-top: 1px solid rgba(255,255,255,0.08);
}
/* Footer ticker – Nifty/BankNifty in Emerald */
.footer-ticker-wrap {
  overflow: hidden;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-ticker {
  display: flex;
  width: max-content;
  animation: footer-ticker-scroll 40s linear infinite;
  gap: 2rem;
}
.footer-ticker span { color: var(--vovix-emerald); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .footer-ticker { animation: none; } }
@keyframes footer-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Error page */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}
.error-card {
  text-align: center;
  max-width: 440px;
}
.error-code {
  font-size: 4.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.error-title { font-size: 1.4rem; margin: 1rem 0 0.5rem; font-weight: 600; }
.error-text { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Progress */
.progress {
  background: var(--light-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar { border-radius: var(--radius-pill); transition: width 0.4s ease; }

.bx-spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login / auth cards */
.card.shadow-lg {
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}

/* Utilities */
.text-primary { color: var(--primary) !important; }
.bg-primary { background: var(--primary) !important; }

/* Dashboard strip (logged-in) */
.dashboard-strip {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.dashboard-stat {
  color: var(--text);
  font-weight: 500;
}
a.dashboard-stat-link:hover {
  text-decoration: underline !important;
  color: var(--vovix-navy);
}
.dashboard-stat.dashboard-cost { color: var(--primary); font-weight: 600; }

/* ========== Homepage (reference layout): hero two-column + feature cards + footer ticker ========== */
.vovix-hero-home {
  background: #fff;
  color: var(--vovix-navy);
}
.vovix-hero-headline { color: var(--vovix-navy) !important; font-size: clamp(1.5rem, 4vw, 2.25rem); }
.vovix-hero-sub { color: var(--text-muted) !important; font-size: 1.1rem; }
.vovix-hero-search .form-control:focus {
  box-shadow: none;
  outline: none;
}
.vovix-hero-search .border-success { border-color: var(--vovix-emerald) !important; }
.vovix-hero-search .btn-success { background: var(--vovix-emerald) !important; border-color: var(--vovix-emerald) !important; }

/* Dashboard illustration (monitor mockup with chart shapes) */
.vovix-hero-illustration { max-width: 380px; }
.vovix-dashboard-mockup {
  background: linear-gradient(145deg, #e2e8f0 0%, #cbd5e1 100%);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}
.vovix-mockup-screen {
  background: #1e293b;
  border-radius: 8px;
  padding: 1rem;
  min-height: 220px;
  position: relative;
}
.vovix-mockup-chart {
  height: 36px;
  border-radius: 4px;
  margin-bottom: 8px;
  opacity: 0.9;
}
.vovix-chart-bar {
  width: 70%;
  background: linear-gradient(90deg, var(--vovix-emerald) 0%, #00a843 100%);
}
.vovix-chart-line {
  width: 85%;
  height: 4px;
  background: var(--vovix-emerald);
  border-radius: 2px;
}
.vovix-mockup-network {
  width: 60px;
  height: 40px;
  background: rgba(0, 229, 255, 0.3);
  border-radius: 6px;
  margin-top: 12px;
  position: relative;
}
.vovix-mockup-network::before {
  content: '';
  position: absolute;
  width: 30px;
  height: 20px;
  background: rgba(0, 229, 255, 0.5);
  border-radius: 4px;
  top: -8px;
  left: 15px;
}
.vovix-mockup-logo {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0.95;
}

/* Feature cards: light gray bg, light green border, icon boxes */
.vovix-feature-card {
  background: var(--vovix-silver) !important;
  border: 2px solid rgba(0, 200, 83, 0.35);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.vovix-feature-card:hover {
  transform: translateY(-2px);
}
/* PRD: 2px border glow on hover in brand accent (Scan=Navy, Flow=Green, Alpha=Cyan) */
.vovix-feature-card-scan:hover {
  border-color: var(--vovix-navy) !important;
  box-shadow: 0 0 0 2px rgba(16, 42, 67, 0.2), 0 4px 20px rgba(16, 42, 67, 0.25);
}
.vovix-feature-card-flow:hover {
  border-color: var(--vovix-emerald) !important;
  box-shadow: 0 0 0 2px rgba(0, 200, 83, 0.25), 0 4px 20px rgba(0, 200, 83, 0.35);
}
.vovix-feature-card-alpha:hover {
  border-color: var(--vovix-cyan) !important;
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.25), 0 4px 20px rgba(0, 229, 255, 0.35);
}
.vovix-feature-icon {
  width: 48px;
  height: 48px;
}
.vovix-feature-icon-scan { background: var(--vovix-navy) !important; }
.vovix-feature-icon-flow { background: var(--vovix-emerald) !important; }
.vovix-feature-icon-alpha { background: var(--vovix-cyan) !important; }

/* Footer main + bottom ticker */
.vovix-footer-main {
  background: linear-gradient(135deg, var(--vovix-navy) 0%, #0d2137 100%) !important;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.vovix-footer-ticker {
  background: rgba(0,0,0,0.2);
  overflow: hidden;
}
.vovix-footer-ticker-inner {
  display: flex;
  width: max-content;
  animation: vovix-ticker-scroll 35s linear infinite;
  gap: 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.vovix-footer-ticker-inner span { color: rgba(255,255,255,0.9); }
.vovix-footer-ticker-inner .text-success { color: var(--vovix-emerald) !important; }
.vovix-footer-ticker-inner .text-danger { color: #f87171 !important; }
@media (prefers-reduced-motion: reduce) { .vovix-footer-ticker-inner { animation: none; } }
@keyframes vovix-ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

footer.bg-dark, footer.vovix-footer {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  margin-top: 1.25rem !important;
}
footer .container { padding-left: 1rem; padding-right: 1rem; }
footer .fw-semibold, footer .text-white-50 { font-size: 0.95rem; }

/* Footer: prevent Bootstrap row from pulling content left; ensure VOVIX and Contact never clipped */
.vovix-footer-main .container {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  overflow: visible;
}
.vovix-footer-row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.vovix-footer-row [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}
.vovix-footer-brand-block {
  padding-left: 0;
}
.vovix-footer-container {
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  max-width: 100%;
  box-sizing: border-box;
}
.vovix-footer-brand { font-size: 1.1rem; display: inline-block; }
.vovix-footer-contact { word-break: break-word; }
.vovix-footer-disclaimer {
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
  max-width: 100%;
}
.vovix-footer-links-wrap .d-flex { gap: 0.75rem 1rem !important; }

/* Mobile: extra inset so V in VOVIX and C in Contact are never cut off by viewport */
@media (max-width: 767px) {
  .vovix-footer-main {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
    box-sizing: border-box;
  }
  .vovix-footer-main .vovix-footer-container,
  .vovix-footer-main .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    max-width: 100%;
  }
  .vovix-footer-brand-block {
    padding-left: 0.5rem !important;
  }
  .vovix-footer-row { margin-left: 0 !important; margin-right: 0 !important; }
  .vovix-footer-brand-col { padding-left: 0 !important; padding-right: 0.5rem !important; }
  .vovix-footer-disclaimer {
    font-size: 0.8rem;
    line-height: 1.5;
    margin-top: 1rem !important;
  }
}

/* Very small screens: even more left padding so first letters stay visible */
@media (max-width: 380px) {
  .vovix-footer-main {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
}
/* Homepage feature grid – Scan (Navy), Flow (Emerald), Alpha (Cyan) */
.vovix-icon-navy { color: var(--vovix-navy) !important; }
.vovix-icon-emerald { color: var(--vovix-emerald) !important; }
.vovix-icon-cyan { color: var(--vovix-cyan) !important; }
.vovix-badge-navy { background: rgba(16, 42, 67, 0.12); color: var(--vovix-navy); }
.vovix-badge-emerald { background: var(--primary-light); color: var(--vovix-emerald); }
.vovix-badge-cyan { background: var(--vovix-cyan-soft); color: #0e7490; }

/* Toasts – match alerts: navy text, Vovix accent stripe */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 12px);
  right: 16px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast-item {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--vovix-emerald);
  color: var(--vovix-navy);
  font-weight: 500;
  animation: toastIn 0.3s ease;
}
.toast-item a {
  color: var(--vovix-emerald);
  font-weight: 600;
  text-decoration: none;
}
.toast-item a:hover {
  color: var(--vovix-emerald-hover);
  text-decoration: underline;
}
.toast-item strong {
  color: var(--vovix-navy);
}
.toast-item.toast-success { border-left-color: var(--vovix-emerald); }
.toast-item.toast-danger {
  border-left-color: var(--danger);
  background: var(--danger-bg);
}
.toast-item.toast-danger a {
  color: #b91c1c;
}
.toast-item.toast-danger a:hover {
  color: #991b1b;
}
.toast-item.toast-warning {
  border-left-color: var(--warning);
  background: var(--warning-bg);
}
.toast-item.toast-warning a {
  color: #b45309;
}
.toast-item.toast-info {
  border-left-color: var(--vovix-cyan);
  background: var(--info-bg);
}
.toast-item.toast-info a {
  color: #0e7490;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--light-bg) 25%, var(--border) 50%, var(--light-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton {
  to { background-position: 200% 0; }
}
.skeleton-text { height: 1em; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-card { height: 120px; }
.skeleton-list .skeleton-text { width: 100%; }
.skeleton-list .skeleton-text:last-child { width: 70%; }

/* Task filters (tabs) */
.task-filters {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.task-filters .btn {
  border-radius: var(--radius-pill);
  font-weight: 500;
}
.task-filters .btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Task card status border */
.task-card.task-status-started { border-left: 4px solid var(--info); }
.task-card.task-status-completed { border-left: 4px solid var(--success); }
.task-card.task-status-failed,
.task-card.task-status-cancelled { border-left: 4px solid var(--danger); }
.task-card { border-left: 4px solid var(--border); }

/* Glass card (optional) */
.card.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* Form step indicator */
.form-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.form-steps .step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
}
.form-steps .step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--light-bg);
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.form-steps .step.active .step-num,
.form-steps .step.done .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.form-steps .step.active { color: var(--primary); }
.form-steps .step.done { color: var(--text); }
.form-steps .step-connector {
  width: 24px;
  height: 2px;
  background: var(--border);
}
.form-steps .step.done + .step-connector,
.step-connector + .step.done .step-num { background: var(--primary); }

/* Result page: transaction card & Q&A bar */
.result-transaction-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.result-qa-bar .form-control {
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.25rem;
}
.result-qa-bar .btn { border-radius: var(--radius-pill); }

/* Focus visible (a11y) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* Login page */
.login-page-wrap {
  background: linear-gradient(160deg, var(--light-bg) 0%, var(--primary-light) 50%, #e0f2fe 100%);
  min-height: calc(100vh - var(--navbar-height) - 120px);
  margin: 0 -0.5rem;
  padding: 0 0.5rem;
  overflow-x: hidden;
}
.login-page-wrap .container { max-width: 100%; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Market News – reading layout */
/* Market News: title card with guaranteed visible text (white card, navy title, emerald icon) */
.market-news-title-card {
  background: #ffffff !important;
  border-radius: var(--radius);
  border-left: 4px solid var(--vovix-emerald);
}
.market-news-title-card-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: #102A43 !important;
  margin: 0;
}
.market-news-title-card-heading .bx-news {
  color: var(--vovix-emerald);
}
.market-news-title-card-lead {
  font-size: 1rem;
  color: #475569 !important;
}

/* About page: same title-card style as Market News, capability cards with emerald icons */
.about-title-card {
  background: #ffffff !important;
  border-radius: var(--radius);
  border-left: 4px solid var(--vovix-emerald);
}
.about-title-card-heading {
  font-size: 1.75rem;
  font-weight: 700;
  color: #102A43 !important;
  margin: 0;
}
.about-title-card-lead {
  font-size: 1rem;
  color: #475569 !important;
}
.about-capability-card {
  background: #fff;
  border-color: rgba(0, 200, 83, 0.25);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.about-capability-card:hover {
  border-color: var(--vovix-emerald);
  box-shadow: 0 4px 16px rgba(0, 200, 83, 0.12);
}
.about-capability-icon {
  font-size: 1.5rem;
  color: var(--vovix-emerald);
  flex-shrink: 0;
}

.market-news-report {
  max-width: 100%;
  margin: 0;
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.7;
}
.market-news-report h1,
.market-news-report h2,
.market-news-report h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text);
}
.market-news-report h2 { font-size: 1.35rem; border-bottom: 1px solid var(--border); padding-bottom: 0.35rem; }
.market-news-report h3 { font-size: 1.15rem; }
.market-news-report p { margin-bottom: 1rem; }
.market-news-report ul, .market-news-report ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.market-news-report li { margin-bottom: 0.35rem; }
.market-news-report strong { font-weight: 600; color: var(--text); }
.market-news-report a { color: var(--primary); text-decoration: none; }
.market-news-report a:hover { text-decoration: underline; }
.market-news-report code { background: var(--light-bg); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.market-news-report pre { background: var(--light-bg); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 1rem; }
.market-news-report blockquote { border-left: 4px solid var(--primary); margin: 1rem 0; padding-left: 1rem; color: var(--text-muted); }
.market-news-report .market-news-h2 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.market-news-report .market-news-h2.market-news-section-accent,
.market-news-section-accent.market-news-h3 {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ecfdf5 100%);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
#citationsSection .market-news-section-accent { margin-top: 0; }
.market-news-report .market-news-list { margin-bottom: 1rem; }
.market-news-report .market-news-item { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.market-news-report .market-news-item:last-child { border-bottom: none; }
/* News tab uses single-column article cards (see market_news.html) */

@media (max-width: 768px) {
  .card-body { padding: 1.25rem; }
  .error-code { font-size: 3.5rem; }
  .hero-section { padding: 1.5rem 1rem; }
  .toast-container { left: 16px; right: 16px; max-width: none; }
  .dashboard-strip .d-flex { flex-direction: column; align-items: flex-start !important; }
  .market-news-report { font-size: 1rem; }
}

/* Mobile compatibility: tables, containers, safe areas */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
  width: 100%;
}
@media (max-width: 576px) {
  .table-responsive {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    width: calc(100% + 1rem);
    max-width: calc(100% + 1rem);
  }
}
@media (max-width: 576px) {
  .container, .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; max-width: 100%; width: 100%; }
  main.container, main.container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; width: 100%; }
  .card, .card-body { overflow: visible; }
  .d-flex { flex-wrap: wrap; }
  .d-flex.justify-content-between { flex-wrap: wrap; gap: 0.75rem; }
  /* Safe area for notched phones */
  body {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  /* Full-width modals on small screens */
  .modal-dialog { margin: 0.5rem; max-width: calc(100vw - 1rem); width: calc(100% - 1rem); }
  /* Ensure result page header stacks and fits */
  .stock-header, .header-actions { width: 100%; }
  .header-actions { align-self: stretch; }
  .header-actions .btn { width: 100%; justify-content: center; }
}

/* Very small screens (320px–375px) */
@media (max-width: 375px) {
  .container, .container-fluid, main.container, main.container-fluid { padding-left: 0.5rem; padding-right: 0.5rem; }
  .hero-section .display-5 { font-size: 1.5rem; }
  .hero-section .lead { font-size: 0.95rem; }
  .hero-buttons .btn { min-width: 0; width: 100%; }
}
/* Prevent long text/URLs from overflowing on small screens */
.market-news-report, .card-body, .table, .news-content { word-wrap: break-word; overflow-wrap: break-word; }
