@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Spectral:ital,wght@0,400;0,600;1,400&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Light Mode Palette (Based on User Reference Image & HQZ Brand) */
  --bg-main: #F1F5F9;
  --bg-topbar: #F8FAFC;
  --bg-white: #FFFFFF;
  --bg-navy-dark: #0B192C;
  --bg-navy-hero: linear-gradient(135deg, #0B1E3D 0%, #050C1A 100%);
  
  --gold-primary: #D4AF37;
  --gold-secondary: #C5A059;
  --gold-light: #F3E5AB;

  --cyan-primary: #00A8E8;
  --cyan-hover: #0086BA;

  --emerald-neon: #00CC66;
  --emerald-light: #3FE0A8;

  --text-dark: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --text-light-muted: #94A3B8;
  --text-white: #FFFFFF;

  --border-light: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-gold: rgba(212, 175, 55, 0.4);

  /* Fonts */
  --font-heading: 'Poppins', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-spectral: 'Spectral', serif;
  --font-cinzel: 'Cinzel', serif;

  /* Layout */
  --max-width: 1320px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

[id] {
  scroll-margin-top: 140px;
}

body {
  background-color: var(--bg-main);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-dark);
  font-weight: 700;
}

.text-gold {
  color: var(--gold-secondary) !important;
}

.text-cyan {
  color: var(--cyan-primary) !important;
}

.text-emerald {
  color: var(--emerald-neon) !important;
}

/* 1. TOP UTILITY HEADER BAR */
.top-bar {
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-light);
  padding: 0.5rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.top-bar-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.top-bar-left span.star-icon {
  color: var(--gold-primary);
  font-size: 0.9rem;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.top-bar-link {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease;
}

.top-bar-link:hover {
  color: var(--bg-navy-dark);
}

/* 2. MAIN BRAND & SEARCH HEADER WITH OFFICIAL HQZ LOGO */
.main-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 0;
  position: relative;
  z-index: 100;
}

.main-header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand-logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.brand-text-wrapper {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--bg-navy-dark);
  letter-spacing: 0.5px;
  line-height: 1;
}

.brand-hq-badge {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  color: #000;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.brand-subtitle {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-top: 2px;
}

/* Central Search Input */
.header-search-bar {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.header-search-input-wrapper {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 50px;
  padding: 0.25rem 0.25rem 0.25rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.header-search-input-wrapper:focus-within {
  border-color: var(--bg-navy-dark);
  box-shadow: 0 0 0 3px rgba(11, 25, 44, 0.1);
}

.header-search-input-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-dark);
  background: transparent;
}

.header-search-btn {
  background: var(--bg-navy-dark);
  color: var(--text-white);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-search-btn:hover {
  background: #1E293B;
}

/* Search Dropdown Overlay Menu */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 380px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none; /* Controlled via JS */
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
}

.search-result-item {
  padding: 0.75rem 1rem;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: #EDF2F7;
  border-color: var(--cyan-primary);
}

/* Client Area Pill Button */
.client-area-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 30px;
  padding: 0.4rem 1.2rem 0.4rem 0.6rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.client-area-btn:hover {
  border-color: var(--bg-navy-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.client-lock-icon {
  background: var(--bg-navy-dark);
  color: var(--text-white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.client-text-wrapper {
  display: flex;
  flex-direction: column;
}

.client-text-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.2;
}

.client-text-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* 3. DARK NAVY NAVIGATION BAR WITH MEGA DROPDOWNS */
.navy-navbar {
  background: var(--bg-navy-dark);
  box-shadow: 0 4px 12px rgba(11, 25, 44, 0.15);
  position: relative;
  z-index: 90;
}

.navy-navbar-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.navy-nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.2rem;
  overflow-x: visible;
}

.navy-nav-list > li {
  position: relative;
}

.navy-nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.9rem;
  color: var(--text-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
}

.navy-nav-list a:hover,
.navy-nav-list a.active {
  color: var(--cyan-primary);
  background: rgba(255, 255, 255, 0.05);
}

.navy-nav-list a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--cyan-primary);
}

/* Nested Dropdown Sub-menus */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  list-style: none;
  display: none;
  flex-direction: column;
  padding: 0.5rem 0;
  z-index: 1000;
}

.navy-nav-list > li:hover .dropdown-menu {
  display: flex;
}

.dropdown-menu li a {
  color: var(--text-dark) !important;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  display: block;
  transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
  background: #F1F5F9 !important;
  color: var(--cyan-primary) !important;
  padding-left: 1.5rem;
}

/* 4. MAIN LAYOUT WITH 2 COLUMNS */
.layout-container {
  max-width: var(--max-width);
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

/* 5. LEFT SIDEBAR */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 1.25rem 1rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--bg-navy-dark);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding-bottom: 0.8rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-header span.icon {
  color: var(--gold-primary);
  font-size: 1rem;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  border-bottom: 1px solid #F1F5F9;
}

.sidebar-menu li:last-child {
  border-bottom: none;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.4rem;
  color: var(--text-body);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-menu a:hover {
  color: var(--cyan-primary);
  padding-left: 0.7rem;
}

.sidebar-menu a span.chevron {
  color: #94A3B8;
  font-size: 0.75rem;
}

/* 6. RIGHT MAIN CONTENT AREA */
.main-column {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Classificação Tributária Radio Component */
.classifica-box {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.radio-options-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.2rem;
}

.radio-options-row label {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.radio-options-row input[type="radio"] {
  accent-color: var(--cyan-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Hero Dark Card */
.hero-card {
  background: var(--bg-navy-hero);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3rem;
  color: var(--text-white);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(11, 25, 44, 0.15);
}

.hero-card-star-watermark {
  position: absolute;
  right: 5%;
  bottom: -15%;
  width: 320px;
  height: 320px;
  opacity: 0.12;
  pointer-events: none;
}

.hero-card-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero-card-title {
  font-size: 2.5rem;
  line-height: 1.25;
  color: var(--text-white);
  margin-bottom: 1.25rem;
  font-weight: 800;
}

.hero-card-subtitle {
  font-size: 1.1rem;
  color: #E2E8F0;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.hero-card-subtext {
  font-size: 0.95rem;
  color: #94A3B8;
  margin-bottom: 2rem;
}

.btn-cyan {
  background: var(--cyan-primary);
  color: var(--text-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.8rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 168, 232, 0.4);
  transition: all 0.25 ease;
  cursor: pointer;
}

.btn-cyan:hover {
  background: var(--cyan-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 168, 232, 0.5);
}

/* White Content Cards Grid */
.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #E2E8F0;
  padding-bottom: 0.5rem;
  position: relative;
}

.section-title-bar h2 {
  font-size: 1.5rem;
  color: var(--bg-navy-dark);
  position: relative;
}

.section-title-bar h2::after {
  content: '';
  position: absolute;
  bottom: -0.6rem;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--cyan-primary);
}

.section-title-bar a.view-all {
  color: var(--cyan-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.white-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.white-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.white-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
  border-color: var(--gold-primary);
}

.white-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  color: var(--bg-navy-dark);
  background: #F8FAFC;
}

.white-card-title {
  font-size: 1.15rem;
  color: var(--gold-secondary);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.white-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Glass & Dark Interactive Panels adapted for Light Mode */
.light-panel {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.light-panel-dark {
  background: var(--bg-navy-dark);
  color: var(--text-white);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.badge-tag {
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-secondary);
  border: 1px solid var(--gold-primary);
}

.badge-emerald {
  background: rgba(0, 204, 102, 0.15);
  color: var(--emerald-neon);
  border: 1px solid var(--emerald-neon);
}

/* FOOTER LIGHT / DARK MIX */
footer {
  background: var(--bg-navy-dark);
  color: var(--text-white);
  padding: 4rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: #94A3B8;
  font-size: 0.88rem;
  margin-top: 1rem;
}

.footer-col h4 {
  color: var(--gold-primary);
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul li a {
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.88rem;
}

.footer-col ul li a:hover {
  color: var(--cyan-primary);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #94A3B8;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .layout-container {
    grid-template-columns: 1fr;
  }

  .main-header-container {
    flex-wrap: wrap;
  }

  .header-search-bar {
    order: 3;
    max-width: 100%;
  }

  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .top-bar-left, .top-bar-right {
    font-size: 0.75rem;
  }
  .hero-card-title {
    font-size: 1.8rem;
  }
  .footer-container {
    grid-template-columns: 1fr;
  }
}
