/* ============================================
   K V REDDY & CO. - COST ACCOUNTANTS
   Professional Website Stylesheet
   ============================================ */

/* === CSS VARIABLES === */
:root {
  /* Color Palette - Professional Trust Theme */
  --primary-navy: #051945; /* Darker navy for better contrast */
  --primary-blue: #13468B; /* Deeper blue */
  --accent-gold: #D4AF37;
  --accent-amber: #F7931E;
  --dark-slate: #131A26; /* Darkened slate */
  --text-dark: #2C3E50;
  --text-light: #5A6C7D;
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FA;
  --bg-accent: #FFF8E7;
  --border-light: #E1E8ED;
  --success-green: #27AE60;
  --error-red: #E74C3C;
  
  /* Typography */
  --font-display: 'Crimson Pro', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(10, 36, 99, 0.08);
  --shadow-md: 0 4px 12px rgba(10, 36, 99, 0.12);
  --shadow-lg: 0 8px 24px rgba(10, 36, 99, 0.16);
  --shadow-xl: 0 16px 48px rgba(10, 36, 99, 0.20);
  
  /* Transitions */
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  line-height: 1.6;
  background: var(--bg-white);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-base);
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-navy);
  margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p {
  margin-bottom: var(--space-sm);
  color: var(--text-light);
}

.lead-text {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-light);
  line-height: 1.7;
}

/* === HEADER & NAVIGATION === */
.top-bar {
  background: var(--dark-slate);
  color: white;
  padding: var(--space-xs) 0;
  font-size: 0.9rem;
}

.top-bar-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.contact-info {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-item i {
  color: var(--accent-gold);
}

.social-links {
  display: flex;
  gap: var(--space-sm);
}

.social-links a:not(.login-link-top) {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: var(--transition-base);
}

.social-links a:not(.login-link-top):hover {
  background: var(--accent-gold);
  transform: translateY(-2px);
}

/* Main Header */
.main-header {
  background: var(--bg-white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  width: 120px;
  height: 60px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.1);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text h1 {
  font-size: 1.5rem;
  margin: 0;
  color: var(--primary-navy);
}

.logo-text p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0;
  font-weight: 500;
}

/* Navigation */
header ul,
header li,
nav ul,
nav li,
.main-nav,
.main-nav ul,
.main-nav li,
.dropdown-menu,
.dropdown-menu li,
#visible-portal-switcher,
#visible-portal-switcher li,
#main-navigation,
#main-navigation ul,
#main-navigation li {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
}

.main-nav > ul {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.main-nav a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 6px;
  position: relative;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary-blue);
  background: var(--bg-accent);
}

.portal-nav a:hover, .portal-nav a.active,
.office-nav a:hover, .office-nav a.active,
.admin-nav a:hover, .admin-nav a.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Dropdown Menu */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 240px;
  box-shadow: var(--shadow-lg);
  border-radius: 8px;
  margin-top: var(--space-xs);
  padding: 6px !important;
  animation: fadeInDown 0.3s ease;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.has-dropdown:hover .dropdown-menu {
  display: flex;
}

.dropdown-menu li {
  margin: 0;
  width: 100%;
  list-style: none !important;
}

.dropdown-menu a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 14px !important;
  color: var(--text-dark) !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  border-radius: 6px;
  white-space: nowrap !important;
  transition: var(--transition-fast);
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: var(--bg-light) !important;
  color: var(--primary-blue) !important;
  transform: translateX(4px);
}

/* User Badge Container */
#user-badge {
  position: relative;
}

.user-badge-inner {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-navy);
  cursor: pointer;
}

/* === HERO SECTION === */
.hero-section {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-blue) 100%);
  color: white;
  padding: var(--space-xl) var(--space-md);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.hero-text h1 {
  color: white;
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: var(--space-md);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.hero-text .tagline {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-lg);
  font-weight: 300;
}

.hero-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gold);
  color: var(--primary-navy);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--accent-amber);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: var(--primary-navy);
}

/* Stats Section */
.stats-section {
  background: white;
  padding: var(--space-lg) var(--space-md);
  margin-top: calc(-1 * var(--space-lg));
  position: relative;
  z-index: 10;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  background: white;
  padding: var(--space-lg);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
}

.stat-item {
  text-align: center;
  padding: var(--space-md);
  border-right: 1px solid var(--border-light);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-blue);
  font-family: var(--font-display);
  display: block;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* === SECTIONS === */
.section {
  padding: var(--space-xl) var(--space-md);
}

.section-alt {
  background: var(--bg-light);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--space-sm);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--accent-gold);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 700px;
  margin: var(--space-md) auto 0;
}

/* Expanded Services Grid */
.services-grid-12 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.service-card-mini {
  background: white;
  padding: var(--space-md);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card-mini:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-gold);
}

.service-card-mini .service-icon {
  width: 45px;
  height: 45px;
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
}

.service-card-mini h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
}

.service-card-mini p {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.service-card-mini ul {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-light);
}

.service-card-mini li {
  margin-bottom: 5px;
  display: flex;
  gap: 8px;
}

.service-card-mini li::before {
  content: '→';
  color: var(--accent-gold);
}

.service-card {
  background: white;
  padding: var(--space-lg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-base);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-navy));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-md);
}

.service-card h3 {
  color: var(--primary-navy);
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}

.service-card p {
  color: var(--text-light);
  margin-bottom: var(--space-md);
  line-height: 1.7;
}

.service-card .btn-link {
  color: var(--primary-blue);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.service-card .btn-link:hover {
  color: var(--accent-gold);
  gap: 0.75rem;
}

/* === ABOUT SECTION === */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.about-text h2 {
  margin-bottom: var(--space-md);
}

.about-features {
  list-style: none;
  margin-top: var(--space-md);
}

.about-features li {
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: start;
  gap: var(--space-sm);
}

.about-features li::before {
  content: '✓';
  color: var(--success-green);
  font-weight: bold;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.about-image {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.about-image img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

/* === CALCULATOR SECTION === */
.calculator-container {
  background: white;
  padding: var(--space-lg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin: var(--space-lg) auto;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: var(--space-sm);
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: var(--transition-base);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(30, 91, 168, 0.1);
}

.result-box {
  background: var(--bg-accent);
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  padding: var(--space-lg);
  margin-top: var(--space-md);
  text-align: center;
}

.result-box h3 {
  color: var(--primary-navy);
  margin-bottom: var(--space-sm);
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  font-family: var(--font-display);
}

/* === CONTACT SECTION === */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.contact-info-card {
  background: white;
  padding: var(--space-lg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.contact-info-card h3 {
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.contact-info-card h3 i {
  color: var(--accent-gold);
}

.contact-details {
  list-style: none;
}

.contact-details li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.contact-details li:last-child {
  border-bottom: none;
}

.contact-details i {
  color: var(--primary-blue);
  width: 24px;
}

.contact-form {
  background: white;
  padding: var(--space-lg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.contact-form h3 {
  margin-bottom: var(--space-md);
}

.contact-form textarea {
  width: 100%;
  padding: var(--space-sm);
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-family: var(--font-body);
  resize: vertical;
  min-height: 150px;
}

.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(30, 91, 168, 0.1);
}

/* === FOOTER === */
.footer {
  background: var(--dark-slate);
  color: white;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.footer-section h3 {
  color: white;
  margin-bottom: var(--space-md);
  font-size: 1.25rem;
}

.footer-section p,
.footer-section li {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-sm);
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition-fast);
}

.footer-section a:hover {
  color: var(--accent-gold);
  padding-left: 5px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-md);
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* === FLOATING WHATSAPP === */
.whatsapp-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  box-shadow: var(--shadow-xl);
  z-index: 999;
  transition: var(--transition-base);
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  background: #128C7E;
}

/* === NEWS TICKER === */
.news-ticker {
  background: #FFF8E7;
  border-bottom: 2px solid var(--accent-gold);
  height: 44px; /* slightly taller for better vertical alignment */
  display: flex;
  overflow: hidden;
  position: relative;
  z-index: 99;
  font-family: var(--font-body);
}

.ticker-label {
  background: var(--primary-navy);
  color: white;
  padding: 0 var(--space-md);
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.ticker-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.ticker-track {
  display: flex;
  align-items: center;
  height: 100%;
  position: absolute;
  white-space: nowrap;
  animation: ticker 25s linear infinite;
  padding-left: 0;
}

.ticker-track span,
.ticker-track span a {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: #0A2463 !important;
  text-decoration: none;
  margin-right: var(--space-xl);
}

.ticker-separator {
  color: var(--accent-gold) !important;
  font-size: 0.6rem !important;
  margin-right: var(--space-xl);
}

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-20%, 0, 0); }
}

.news-ticker:hover .ticker-track {
  animation-play-state: paused;
}

/* === STATUTORY HUB STYLES === */
.service-card ul li {
  margin-bottom: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--border-light);
}

.service-card ul li:last-child {
  border-bottom: none;
}

.service-card ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dark);
  font-size: 0.95rem;
  font-weight: 500;
}

.service-card ul li a:hover {
  color: var(--primary-blue);
  transform: translateX(5px);
}

.service-card ul li i {
  color: var(--primary-blue);
  width: 16px;
}

/* === CALCULATOR UPDATES === */
.calculator-nav .btn {
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  min-width: 120px;
}

.asset-input, .liab-input {
  background: white;
}

/* Mobile Adjustments for Nav */
@media (max-width: 768px) {
  .calculator-nav {
    justify-content: flex-start !important;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
  }
  
  .calculator-nav::-webkit-scrollbar {
    height: 4px;
  }
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* === ANIMATIONS === */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .about-content {
    grid-template-columns: 1fr;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .main-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .main-nav.mobile-active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--accent-gold);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    z-index: 1001;
    animation: fadeInDown 0.25s ease-out;
  }
  
  .main-nav.mobile-active ul {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
  }

  .main-nav.mobile-active li {
    width: 100%;
  }

  .main-nav.mobile-active a {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: var(--space-sm);
    width: 100%;
  }

  .main-nav.mobile-active a .fa-chevron-down {
    margin-left: auto;
  }

  /* Mobile Dropdowns */
  .main-nav.mobile-active .dropdown-menu {
    display: none;
    position: static;
    box-shadow: none;
    background: rgba(10, 36, 99, 0.03);
    border-left: 3px solid var(--accent-gold);
    padding: var(--space-xs) 0 var(--space-xs) var(--space-sm);
    margin: var(--space-xs) 0 0;
    width: 100%;
    animation: none;
  }

  .main-nav.mobile-active .has-dropdown.open .dropdown-menu {
    display: flex;
  }

  .main-nav.mobile-active .has-dropdown > a i {
    transition: transform 0.2s;
  }

  .main-nav.mobile-active .has-dropdown.open > a i {
    transform: rotate(180deg);
  }
  
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    padding: var(--space-md);
  }
  
  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-sm);
  }
  
  .stat-item:nth-child(2n) {
    border-right: none;
  }

  .stat-item:nth-last-child(-n+2) {
    border-bottom: none;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* === UTILITIES === */
.text-center { text-align: center; }
.text-primary { color: var(--primary-blue); }
.text-gold { color: var(--accent-gold); }
.mb-0 { margin-bottom: 0 !important; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

/* === KNOWLEDGE HUB & STATUTORY REPOSITORY === */
.hub-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  min-height: 700px;
  align-items: start;
}

.hub-sidebar {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: var(--space-md);
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border: 1px solid var(--border-light);
  z-index: 50;
}

.hub-nav-group h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  margin: var(--space-md) 0 var(--space-sm);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-light);
}

.hub-nav-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.hub-nav-item {
  list-style: none !important;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: var(--text-dark);
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
}

.hub-nav-item i {
  width: 20px;
  text-align: center;
  color: var(--primary-blue);
  opacity: 0.7;
}

.hub-nav-item:hover {
  background: var(--bg-light);
  color: var(--primary-blue);
}

.hub-nav-item.active {
  background: var(--primary-navy);
  color: white;
}

.hub-nav-item.active i {
  color: var(--accent-gold);
  opacity: 1;
}

.hub-main {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: var(--space-xl);
  border: 1px solid var(--border-light);
  min-height: 600px;
}

/* Master-Detail Drilldown */
.drilldown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.drilldown-card {
  padding: 20px;
  background: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-base);
  text-align: center;
}

.drilldown-card:hover {
  border-color: var(--accent-gold);
  background: white;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.drilldown-card h5 {
  margin: 10px 0 5px;
  font-size: 1rem;
  color: var(--primary-navy);
}

.drilldown-card p {
  font-size: 0.8rem;
  margin: 0;
}

/* API Documentation Styles */
.api-spec-card {
  background: var(--dark-slate);
  color: #e0e6ed;
  border-radius: 12px;
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-family: var(--font-body);
}

.api-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: var(--space-sm);
}

.endpoint-badge {
  background: var(--success-green);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.endpoint-url {
  font-family: var(--font-mono);
  color: var(--accent-gold);
  margin-left: 10px;
  font-size: 0.9rem;
}

.code-block {
  background: #0d1117;
  padding: var(--space-md);
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin: var(--space-sm) 0;
  border: 1px solid rgba(255,255,255,0.05);
  white-space: pre-wrap;
}

@media (max-width: 992px) {
  .hub-layout {
    grid-template-columns: 1fr;
  }
  .hub-sidebar {
    position: static;
    max-height: none;
    margin-bottom: var(--space-md);
  }
}

/* === SHARED INPUT STYLES (from login.html) === */
.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: all 0.2s;
  background: white;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(30,91,168,0.1);
}

.login-input-group {
  margin-bottom: 16px;
}

.login-input-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}

/* === MOBILE NAVIGATION BACKDROP === */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 36, 99, 0.4);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* === MOBILE STYLING FIXES (Menus & Header) === */
@media (max-width: 1200px) {
  /* Hide the visible portal switcher next to user badge on mobile - it is redundant and crowds the header */
  #visible-portal-switcher {
    display: none !important;
  }
  
  /* Force dark text for mobile navigation links to make them readable on light-themed menu dropdown */
  .main-nav.mobile-active a {
    color: var(--primary-navy) !important;
  }
  
  /* Active link states in mobile dropdown navigation */
  .main-nav.mobile-active a.active {
    color: var(--accent-gold) !important;
    font-weight: 700 !important;
  }

  /* Make sure portal icons inherit the link text colors */
  .main-nav.mobile-active a i {
    color: inherit !important;
  }

  /* Align header horizontal padding with body container horizontal padding of 12px */
  .header-content {
    padding: 12px 12px !important;
  }
}

/* === DESKTOP COMPACTNESS FOR MEDIUM SCREENS (1201px to 1350px) === */
@media (min-width: 1201px) and (max-width: 1350px) {
  .main-nav > ul {
    gap: var(--space-xs) !important;
  }
  .main-nav a {
    padding: var(--space-xs) 6px !important;
    font-size: 0.88rem !important;
  }
  #visible-portal-switcher {
    margin-right: 8px !important;
    padding-right: 8px !important;
    gap: 4px !important;
  }
  #visible-portal-switcher a {
    font-size: 0.8rem !important;
    padding: 4px 8px !important;
  }
  .user-name {
    display: none !important;
  }
  .logo-icon {
    width: 100px !important;
    height: 50px !important;
  }
  .logo-text h1 {
    font-size: 1.3rem !important;
  }
}

@media (max-width: 480px) {
  /* Reduce logo size and padding on very small mobile screens */
  .logo-icon {
    width: 90px !important;
    height: 45px !important;
  }
  
  .logo-text h1 {
    font-size: 1.15rem !important;
  }
  
  .logo-text p {
    font-size: 0.7rem !important;
  }
  
  .header-content {
    padding: var(--space-xs) var(--space-sm) !important;
  }
}

/* === GLOBAL MOBILE-FIRST IMPROVEMENTS === */

/* Login page on mobile */
@media (max-width: 576px) {
  .login-card {
    margin: 0 !important;
    border-radius: 0 !important;
    min-height: 100vh !important;
    box-shadow: none !important;
  }
  .login-container {
    padding: 0 !important;
    align-items: stretch !important;
  }
  .login-card .panel-body,
  .login-card > div {
    padding: 24px 20px !important;
  }
}

/* Buttons — global touch-friendly improvements */
@media (max-width: 768px) {
  .btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  
  /* Prevent btn groups from overflowing */
  .btn-group {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Form inputs — prevent iOS zoom (font must be ≥16px) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="date"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
  }
  
  /* Login page form inputs */
  .login-input {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
  }
  
  /* Main site section headings */
  .section-title {
    font-size: 1.6rem !important;
  }
  .section-subtitle {
    font-size: 0.9rem !important;
  }
  
  /* Service cards wrap nicely */
  .services-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Hero banner text */
  .hero-title {
    font-size: 1.8rem !important;
  }
  .hero-subtitle {
    font-size: 0.95rem !important;
  }
  
  /* Calculator / tools pages */
  .calculator-grid,
  .two-col-form {
    grid-template-columns: 1fr !important;
  }
}

/* === OVERLAY / DROPDOWN z-index fix for mobile === */
.dropdown-menu {
  z-index: 9999;
}

/* === NOTIFICATION TOAST responsive === */
@media (max-width: 576px) {
  #notification-container {
    left: 10px !important;
    right: 10px !important;
    bottom: 16px;
    top: auto !important;
  }
  .notification {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* === SMOOTH SCROLLING === */
html {
  scroll-behavior: smooth;
}

/* === Prevent horizontal overflow globally === */
body {
  overflow-x: hidden;
}

/* === Client Login CTA & Top Bar Styles === */
.header-login-btn {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-navy) 100%);
  color: white !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1.5px solid var(--accent-gold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
  cursor: pointer;
}

.header-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: white;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-amber) 100%);
  color: var(--primary-navy) !important;
}

.header-login-btn:hover i {
  color: var(--primary-navy) !important;
}

.header-login-btn i {
  color: var(--accent-gold);
  font-size: 0.85rem;
  transition: var(--transition-base);
}

.login-link-top-styled {
  background: var(--accent-gold) !important;
  color: var(--primary-navy) !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  gap: 6px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: var(--transition-base);
}

.login-link-top-styled:hover {
  background: white !important;
  color: var(--primary-navy) !important;
  transform: scale(1.05);
}

/* Portal Dropdown Menu Legibility and Hover Override */
.portal-nav .dropdown-menu a,
.office-nav .dropdown-menu a,
.admin-nav .dropdown-menu a {
  color: var(--text-dark) !important;
  background: transparent !important;
  padding: 8px 16px !important;
  font-weight: 500 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.portal-nav .dropdown-menu a:hover,
.office-nav .dropdown-menu a:hover,
.admin-nav .dropdown-menu a:hover {
  color: var(--primary-blue) !important;
  background: var(--bg-light) !important;
  transform: translateX(4px) !important;
}

/* Mobile adjustments for dropdown text readability in portals */
@media (max-width: 768px) {
  .portal-nav.mobile-active .dropdown-menu a,
  .office-nav.mobile-active .dropdown-menu a,
  .admin-nav.mobile-active .dropdown-menu a {
    color: var(--primary-navy) !important;
    background: transparent !important;
  }
}

/* Mobile Header and Login Button Adjustments */
@media (max-width: 768px) {
  .top-bar {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .header-login-btn span {
    display: none !important;
  }
  .header-login-btn {
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    gap: 0 !important;
    border-radius: 50% !important;
    width: 38px;
    height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}




