/* ============================================
   IBDAP - Instituto Brasileiro de Desenvolvimento da Administração Pública
   Main Stylesheet
   ============================================ */

/* --- Force Light Mode --- */
html {
  color-scheme: light;
  background: #f4f6f8;
}

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --primary: #1a3a5c;
  --primary-light: #2d5f8a;
  --primary-dark: #0f2440;
  --accent: #5a9e2f;
  --accent-light: #7bc043;
  --accent-dark: #3d7a1c;
  --white: #ffffff;
  --bg: #f4f6f8;
  --bg-alt: #e8ecf1;
  --surface: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
  --text-muted: #95a5a6;
  --border: #dfe6e9;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-md: rgba(0, 0, 0, 0.12);
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #27ae60;
  --info: #3498db;

  /* Typography */
  --font-primary: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading: 'Montserrat', 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Sizes */
  --container-max: 1200px;
  --container-narrow: 900px;
  --nav-height: 72px;
  --footer-min: 200px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;

  /* Transitions */
  --transition: 0.3s ease;
  --transition-fast: 0.15s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: page-in 0.18s ease both;
}

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

/* Disable ALL transitions/animations during page load to prevent flash */
body.is-loading *,
body.is-loading *::before,
body.is-loading *::after {
  transition-duration: 0ms !important;
  animation-duration: 0ms !important;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.section {
  padding: var(--space-3xl) 0;
}

.section--alt {
  background: var(--bg-alt);
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.section__title {
  text-align: center;
  margin-bottom: var(--space-sm);
  position: relative;
}

.section__subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.section__divider {
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: var(--space-md) auto var(--space-lg);
  border-radius: 2px;
}

/* --- Header & Navigation --- */
.header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.header--scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  border-bottom-color: transparent;
  background: rgba(255, 255, 255, 0.97);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.header__logo img {
  height: 44px;
  width: auto;
}

.header__logo span {
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  position: relative;
  color: var(--text-muted);
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.7rem;
  right: 0.7rem;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav__link:hover {
  color: var(--primary);
}

.nav__link:hover::after {
  transform: scaleX(1);
}

.nav__link--active {
  color: var(--primary);
  font-weight: 600;
}

.nav__link--active::after {
  transform: scaleX(1);
}

/* Dropdown */
.nav__item--dropdown {
  position: relative;
}

.nav__item--dropdown > .nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__item--dropdown > .nav__link::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.45;
  order: 1;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
  margin-top: 1px;
}

.nav__item--dropdown:hover > .nav__link::before {
  transform: rotate(180deg);
  opacity: 0.7;
}

.nav__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.11), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.07);
  min-width: 210px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  padding: 6px 0;
  z-index: 100;
}

.nav__item--dropdown:hover .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__dropdown a {
  display: flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast), padding-left var(--transition-fast);
}

.nav__dropdown a:hover {
  background: var(--bg);
  color: var(--primary);
  padding-left: 1.35rem;
}

.nav__dropdown:empty {
  display: none;
}

/* Dropdown group with submenu */
.nav__dropdown-group {
  position: relative;
}

.nav__dropdown-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.1rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav__dropdown-group-title::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  border-left: 4px solid currentColor;
  opacity: 0.4;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav__dropdown-group:hover > .nav__dropdown-group-title {
  background: var(--bg);
  color: var(--primary);
}

.nav__dropdown-group:hover > .nav__dropdown-group-title::after {
  opacity: 0.7;
}

.nav__dropdown-submenu {
  position: absolute;
  left: 100%;
  top: 0;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.11), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.07);
  min-width: 260px;
  max-width: 400px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  padding: 6px 0;
  z-index: 101;
}

.nav__dropdown-group:hover > .nav__dropdown-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.nav__dropdown-submenu a {
  white-space: normal;
  line-height: 1.35;
}

/* Mobile Menu Toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  z-index: 1001;
}

.nav__toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav__toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav__toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero / Banner --- */
.hero {
  margin-top: var(--nav-height);
  position: relative;
  overflow: hidden;
  background: var(--primary-dark);
  min-height: 700px;
}

.hero__slider {
  position: relative;
  width: 100%;
  height: 700px;
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex;
  align-items: center;
}

.hero__slide.active {
  opacity: 1;
}

.hero__slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
}

.hero__slide-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 650px;
  padding: var(--space-2xl);
}

.hero__slide-content h2 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero__slide-content p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

.hero__slide-content .btn {
  padding: 0.8rem 1.6rem;
  font-size: 0.95rem;
}

.hero__controls {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-sm);
  z-index: 10;
}

.hero__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: all var(--transition);
  cursor: pointer;
}

.hero__dot.active {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: scale(1.2);
}

.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--transition);
  backdrop-filter: blur(4px);
}

.hero__arrow:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hero__arrow--prev { left: var(--space-lg); }
.hero__arrow--next { right: var(--space-lg); }

/* --- Welcome Bar --- */
.welcome-bar {
  display: none;
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: var(--space-lg) 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-align: center;
  white-space: nowrap;
}

.btn--primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(90, 158, 47, 0.3);
}

.btn--secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn--secondary:hover {
  background: var(--white);
  color: var(--primary);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn--outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn--accent-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--accent-outline:hover {
  background: var(--accent);
  color: var(--white);
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

.btn--lg {
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
}

.btn--block {
  width: 100%;
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 2px 8px var(--shadow);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.card > div:first-child {
  margin: var(--space-lg) var(--space-md) 0;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 24px var(--shadow-md);
  transform: translateY(-4px);
}

.card__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card__body {
  padding: var(--space-lg);
  flex: 1;
}

.card__title {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
}

.card__text {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.card__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.card__badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--white);
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

/* --- Services Carousel --- */
.services-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.services-carousel__track {
  display: flex;
  gap: var(--space-xl);
  overflow: hidden;
  scroll-behavior: smooth;
  flex: 1;
  padding-top: 8px;
  margin-top: -8px;
}

.services-carousel__track .service-card {
  min-width: calc((100% - var(--space-xl) * 2) / 3);
  max-width: calc((100% - var(--space-xl) * 2) / 3);
  flex-shrink: 0;
}


.services-carousel__arrow {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px var(--shadow-md);
  transition: all var(--transition);
  z-index: 2;
}

.services-carousel__arrow:hover {
  background: var(--primary-light);
  transform: scale(1.1);
}

.services-carousel__arrow:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
}

.service-card {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  padding: 0;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all var(--transition);
  border: 2px solid transparent;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px var(--shadow-md);
  border-color: var(--accent);
}

.service-card__icon {
  width: calc(100% - var(--space-lg) * 2);
  height: 140px;
  margin: var(--space-lg) auto 0;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 0;
  overflow: hidden;
  color: var(--white);
  font-size: 1.75rem;
  position: relative;
}

.service-card__icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.service-card__title {
  font-size: 1.05rem;
  margin-bottom: var(--space-xs);
  padding: var(--space-lg) var(--space-lg) 0;
}

.service-card__text {
  color: var(--text-light);
  font-size: 0.85rem;
  padding: var(--space-sm) var(--space-lg) var(--space-xl);
  line-height: 1.6;
}

/* --- News Grid --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-xl);
}

/* --- Partners Grid --- */
.partners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-xl);
  align-items: center;
}

.partner-card {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: all var(--transition);
}

.partner-card:hover {
  box-shadow: 0 4px 16px var(--shadow-md);
  transform: scale(1.05);
}

.partner-card img {
  max-height: 60px;
  max-width: 140px;
  object-fit: contain;
  filter: grayscale(30%);
  transition: filter var(--transition);
}

.partner-card:hover img {
  filter: grayscale(0);
}

/* --- Documents List (Transparência) --- */
.documents-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.document-item {
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  box-shadow: 0 1px 4px var(--shadow);
  transition: all var(--transition);
  border-left: 4px solid var(--primary);
}

.document-item:hover {
  box-shadow: 0 4px 12px var(--shadow-md);
  border-left-color: var(--accent);
}

.document-item__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--border-radius);
  color: var(--primary);
  font-size: 1.5rem;
}

.document-item__info {
  flex: 1;
}

.document-item__title {
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--primary-dark);
}

.document-item__desc {
  color: var(--text-light);
  font-size: 0.9rem;
}

.document-item__date {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: var(--space-xs);
}

.document-item__actions {
  flex-shrink: 0;
}

/* Document Groups (Transparency page) */
.document-group {
  background: var(--surface);
  border-radius: var(--border-radius);
  box-shadow: 0 1px 4px var(--shadow);
  border-left: 4px solid var(--primary-dark);
  overflow: hidden;
}

.document-group__header {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.document-group__header:hover {
  background: var(--bg);
}

.document-group__info {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex: 1;
}

.document-group__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: var(--border-radius);
  color: var(--white);
}

.document-group__title {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1rem;
}

.document-group__desc {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 2px;
}

.document-group__count {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

.document-group__chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.document-group.open .document-group__chevron {
  transform: rotate(180deg);
}

.document-group__children {
  display: none;
  padding: 0 var(--space-lg) var(--space-lg);
  gap: var(--space-md);
}

.document-group.open .document-group__children {
  display: flex;
  flex-direction: column;
}

.document-group__children .document-item {
  border-left-width: 3px;
  box-shadow: 0 1px 3px var(--shadow);
}

/* --- Forms --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(45, 95, 138, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-message {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-lg);
  font-weight: 500;
  display: none;
}

.form-message--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  display: block;
}

.form-message--error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  display: block;
}

.form-toast {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 2200;
  min-width: 260px;
  max-width: min(92vw, 420px);
  padding: 0.9rem 1rem;
  border-radius: 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
  font-weight: 600;
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.form-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.form-toast--success {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.form-toast--error {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

@media (max-width: 480px) {
  .form-toast {
    right: 10px;
    left: 10px;
    max-width: none;
    min-width: 0;
  }
}

/* File Upload */
.file-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--border-radius);
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.file-upload:hover {
  border-color: var(--primary-light);
  background: rgba(45, 95, 138, 0.03);
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload__icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.file-upload__text {
  color: var(--text-light);
  font-size: 0.95rem;
}

.file-upload__text strong {
  color: var(--primary-light);
}

/* --- Careers page panel --- */
.careers-panel {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  box-shadow: 0 2px 8px var(--shadow);
}

/* --- Page Header (Internal pages) --- */
.page-header {
  margin-top: var(--nav-height);
  background:
    radial-gradient(circle at 12% 18%, rgba(122, 192, 67, 0.18), transparent 42%),
    radial-gradient(circle at 88% 16%, rgba(26, 58, 92, 0.18), transparent 46%),
    linear-gradient(135deg, #eef3f8 0%, #f7fafc 55%, #edf2f7 100%);
  color: var(--text);
  padding: calc(var(--space-3xl) + 0.5rem) 0 var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(26, 58, 92, 0.08);
}

.page-header::before {
  content: "";
  position: absolute;
  left: -8%;
  bottom: -95px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(26, 58, 92, 0.18), rgba(45, 95, 138, 0.06));
  filter: blur(1px);
}

.page-header::after {
  content: "";
  position: absolute;
  right: -6%;
  top: -112px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(122, 192, 67, 0.2), rgba(122, 192, 67, 0.05));
}

.page-header .container {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  color: var(--primary-dark);
  font-size: clamp(2rem, 1.25rem + 1.6vw, 2.8rem);
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: var(--space-md);
  position: relative;
  display: inline-block;
  padding-bottom: var(--space-sm);
}

.page-header h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 84px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
}

.page-header p {
  color: #4d637b;
  font-size: clamp(1rem, 0.88rem + 0.45vw, 1.2rem);
  max-width: 760px;
  margin: 0 auto;
  font-weight: 500;
  position: relative;
}

/* Blog detail header tuning */
#articleHeader h1 {
  font-size: clamp(1.55rem, 1.2rem + 1vw, 2.1rem);
  line-height: 1.2;
}

#articleHeader h1::after {
  width: 70%;
  min-width: 90px;
  max-width: 240px;
}

/* --- Quem Somos: Mission and Values --- */
.about-ibdap-card {
  display: flex;
  gap: var(--space-2xl);
  align-items: center;
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  box-shadow: 0 2px 8px var(--shadow);
}

.about-ibdap-card__logo {
  width: 200px;
  height: auto;
  flex-shrink: 0;
}

.about-ibdap-card__title {
  margin-bottom: var(--space-lg);
}

.mvv-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.mvv-card {
  background: var(--surface);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  box-shadow: 0 10px 24px rgba(26, 58, 92, 0.08);
  border: 1px solid rgba(26, 58, 92, 0.08);
  position: relative;
  overflow: hidden;
}

.mvv-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
}

.mvv-card--mission::before {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.mvv-card--values::before {
  background: linear-gradient(90deg, var(--accent), #8ac926);
}

.mvv-card__title {
  margin-bottom: var(--space-lg);
  color: var(--primary-dark);
}

.mvv-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-sm);
}

.mvv-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(45, 95, 138, 0.08), rgba(45, 95, 138, 0.03));
  border: 1px solid rgba(45, 95, 138, 0.18);
  color: var(--primary-dark);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
  min-height: 48px;
}

/* --- Footer --- */
.footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-xl) 0 0;
  margin-top: auto;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer__brand img {
  height: 56px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  align-self: flex-start;
}

.footer__brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
}

.footer__title {
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-lg);
  position: relative;
  padding-bottom: var(--space-sm);
}

.footer__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__links a {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.footer__links a:hover {
  color: var(--accent-light);
  padding-left: 4px;
}

.footer__contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.footer__contact-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-light);
}

.footer__bottom {
  margin-top: var(--space-lg);
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --- WhatsApp Float Button --- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 60px;
  height: 60px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  transition: all var(--transition);
  animation: pulse-whatsapp 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  color: var(--white);
}

.whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: var(--white);
}

@keyframes pulse-whatsapp {
  0% { box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.6); }
  100% { box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4); }
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--white);
  text-align: center;
  padding: var(--space-lg) 0;
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: var(--space-sm);
  font-size: 1.25rem;
}

.cta-section p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: var(--space-md);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-section .btn {
  padding: 0.55rem 1.4rem;
  font-size: 0.875rem;
}

/* --- News Ticker --- */
.news-ticker {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  max-width: 700px;
  margin: var(--space-lg) auto 0;
  cursor: pointer;
  transition: all var(--transition);
}

.news-ticker:hover {
  background: rgba(255, 255, 255, 0.1);
}

.news-ticker__icon {
  flex-shrink: 0;
  color: var(--accent-light);
}

.news-ticker__text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
}

.pagination__btn {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  background: var(--white);
}

.pagination__btn:hover,
.pagination__btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* --- Filter / Search --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
  width: 100%;
}

.filter-bar .form-control {
  max-width: 100%;
  flex: 1;
  min-width: 250px;
}

.filter-bar .btn {
  flex-shrink: 0;
}

/* --- Article (Single post) --- */
.article {
  max-width: 800px;
  margin: 0 auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.article__cover {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  margin-bottom: var(--space-2xl);
  border-radius: var(--radius-lg);
}

.article__body {
  padding: 0;
}

.article__meta {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.article__content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.article__content p {
  margin-bottom: var(--space-lg);
}

.article__content h2,
.article__content h3 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.article__content img {
  border-radius: var(--border-radius);
  margin: var(--space-xl) 0;
}

/* --- Loading / Empty States --- */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  font-size: 1.05rem;
  margin: 0;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .hero__slide-content h2 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .grid-2col {
    grid-template-columns: 1fr;
  }

  .header__inner {
    justify-content: flex-start;
  }

  .nav__toggle {
    display: flex;
    gap: 4px;
    padding: 6px 4px;
    margin-left: auto;
    margin-right: -4px;
  }

  .nav__toggle span {
    width: 24px;
  }

  .nav__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
  }

  .nav__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
  }

  /* Mobile overlay */
  .nav__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .nav__overlay.open {
    display: block;
    opacity: 1;
  }

  .nav__list {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(160deg, #0d2b5e 0%, #0a1f44 100%);
    flex-direction: column;
    align-items: stretch;
    padding: 0 var(--space-sm) var(--space-xl);
    gap: 2px;
    transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 1000;
  }

  .nav__list.open {
    right: 0;
  }

  /* Drawer header area */
  .nav__list::before {
    content: 'Menu';
    display: block;
    padding: calc(var(--nav-height) * 0.5 + 8px) var(--space-sm) var(--space-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin: 0 calc(var(--space-sm) * -1) var(--space-sm);
    flex-shrink: 0;
  }

  .nav__link {
    color: rgba(255, 255, 255, 0.78);
    padding: 0.72rem var(--space-md);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .nav__link::after {
    display: none;
  }

  .nav__link::before {
    display: none;
  }

  .nav__link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.09);
  }

  .nav__link--active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.13);
    font-weight: 600;
  }

  /* Dropdown inside drawer */
  .nav__item--dropdown > .nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav__item--dropdown > .nav__link::after {
    display: block !important;
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255,255,255,0.45);
    flex-shrink: 0;
    transition: transform 0.2s ease;
    position: static;
    transform: scaleX(1);
    background: none;
    border-radius: 0;
  }

  .nav__item--dropdown.open > .nav__link::after {
    transform: rotate(180deg);
  }

  .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid rgba(255,255,255,0.12);
    background: transparent;
    border-radius: 0;
    display: none;
    padding: 2px 0;
    margin: 0 var(--space-sm) 4px calc(var(--space-lg) + var(--space-sm));
  }

  .nav__item--dropdown.open .nav__dropdown {
    display: block;
  }

  .nav__dropdown a {
    color: rgba(255, 255, 255, 0.6);
    padding: 0.55rem var(--space-md);
    font-size: 0.85rem;
    border-radius: 6px;
    margin: 1px 0;
  }

  .nav__dropdown a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    padding-left: var(--space-md);
  }

  /* Mobile submenu groups */
  .nav__dropdown-group {
    position: static;
  }

  .nav__dropdown-group-title {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.55rem var(--space-md);
    font-size: 0.85rem;
    border-radius: 6px;
    margin: 1px 0;
    font-weight: 600;
  }

  .nav__dropdown-group-title::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(255,255,255,0.45);
    border-bottom: 0;
    transition: transform 0.2s ease;
  }

  .nav__dropdown-group.open > .nav__dropdown-group-title::after {
    transform: rotate(180deg);
  }

  .nav__dropdown-group-title:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
  }

  .nav__dropdown-submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid rgba(255,255,255,0.08);
    background: transparent;
    border-radius: 0;
    display: none;
    padding: 2px 0;
    margin: 0 0 4px var(--space-md);
    min-width: 0;
    max-width: none;
  }

  .nav__dropdown-group.open > .nav__dropdown-submenu {
    display: block;
  }

  .nav__dropdown-submenu a {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    padding: 0.45rem var(--space-md);
  }

  .nav__dropdown-submenu a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    padding-left: var(--space-md);
  }

  .hero__slider,
  .hero {
    min-height: 460px;
    height: 460px;
  }

  .hero__slide-content {
    max-width: 100%;
    padding: var(--space-xl) var(--space-xl) var(--space-2xl);
  }

  .hero__slide-content h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
  }

  .hero__slide-content p {
    font-size: 1rem;
    margin-bottom: var(--space-lg);
    line-height: 1.55;
  }

  .hero__arrow {
    display: none;
  }

  .hero__controls {
    bottom: var(--space-md);
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .services-carousel {
    gap: 0;
  }

  .services-carousel__track {
    width: 100%;
  }

  .services-carousel__track .service-card {
    min-width: calc(100% - 12px);
    max-width: calc(100% - 12px);
  }

  .services-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .services-carousel__arrow--prev {
    left: 2px;
  }

  .services-carousel__arrow--next {
    right: 2px;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .partners-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }


  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-control {
    max-width: 100%;
    min-width: 0;
  }

  .page-header {
    padding: var(--space-2xl) 0;
  }

  .careers-panel {
    padding: var(--space-lg);
  }

  .about-ibdap-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
    padding: var(--space-lg);
  }

  .about-ibdap-card__logo {
    width: 150px;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .page-header::before,
  .page-header::after {
    width: 180px;
    height: 180px;
  }

  .article__cover {
    max-height: 400px;
  }

  .article__body {
    padding: var(--space-lg);
  }

  .whatsapp-float {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
  }

  .whatsapp-float svg {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero__slide-content {
    padding: var(--space-lg) var(--space-xl) var(--space-xl);
  }

  .hero__slide-content .btn {
    padding: 0.7rem 1.35rem;
    font-size: 0.9rem;
  }

  .hero__slider,
  .hero {
    min-height: 350px;
    height: 350px;
  }

  .hero__slide-content h2 {
    font-size: 1.3rem;
  }

  .partners-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .about-ibdap-card {
    padding: var(--space-md);
    gap: var(--space-md);
  }

  .about-ibdap-card__logo {
    width: 128px;
  }

  .document-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .document-item__actions {
    align-self: flex-end;
  }

  /* Prevent text overflow on narrow screens */
  main {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
}

/* --- Print Styles --- */
@media print {
  .header,
  .whatsapp-float,
  .hero__controls,
  .hero__arrow,
  .footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .page-header {
    margin-top: 0;
    background: none;
    color: black;
    padding: var(--space-lg) 0;
  }

  .page-header h1 {
    color: black;
  }
}
