/* Almanaque Profissional RB — V3 Executive 3D Design System */
:root {
  --rb-dark: #070e1b;
  --rb-slate: #0f172a;
  --rb-emerald: #10b981;
  --rb-emerald-deep: #059669;
  --rb-amber: #f59e0b;
  --rb-surface: #f4f7fb;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  background-color: var(--rb-surface) !important;
  background-image:
    radial-gradient(circle at 8% 0%, rgba(16, 185, 129, 0.06) 0%, transparent 38%),
    radial-gradient(circle at 92% 18%, rgba(14, 165, 233, 0.05) 0%, transparent 40%) !important;
}

h1, h2, h3, .font-display {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
}

/* Header logo crisp sizing & responsive mobile wrap (zero horizontal overflow) */
header > div {
  height: auto !important;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}

header img[src*="rbb_logo"] {
  width: auto !important;
  height: 44px !important;
  border-radius: 12px !important;
  background: transparent !important;
  padding: 0 !important;
  object-fit: contain !important;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.45);
}

@media (min-width: 1024px) {
  header > div {
    height: 64px !important;
    flex-wrap: nowrap !important;
  }
  nav[aria-label="Modulos da plataforma"],
  nav[aria-label="Módulos da plataforma"] {
    top: 64px !important;
  }
}

@media (max-width: 1023px) {
  nav[aria-label="Modulos da plataforma"],
  nav[aria-label="Módulos da plataforma"] {
    position: static !important;
    top: auto !important;
  }
}

@media (max-width: 767px) {
  html, body {
    overflow-x: clip !important;
  }
  header > div {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  header button[onclick*="painel"] {
    flex-shrink: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  header img[src*="rbb_logo"] {
    height: 36px !important;
    max-width: 210px !important;
  }
  header button[onclick*="painel"] > div {
    display: none !important;
  }
  header > div > div.flex.items-center.gap-2 {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px !important;
  }
  #header-action-btn {
    padding: 0.45rem 0.75rem !important;
    font-size: 11px !important;
  }
}

footer img[src*="rbb_logo"] {
  width: auto !important;
  height: 48px !important;
  border-radius: 12px !important;
  background: transparent !important;
  padding: 0 !important;
  object-fit: contain !important;
}

/* =========================================================
   MENU PRINCIPAL: 7 OPÇÕES 100% VISÍVEIS (ZERO CORTES)
   ========================================================= */
nav[aria-label="Modulos da plataforma"],
nav[aria-label="Módulos da plataforma"] {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.09) !important;
  box-shadow: 0 10px 28px -14px rgba(15, 23, 42, 0.16) !important;
}

#main-nav-tabs {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.5rem !important;
  overflow: visible !important;
  align-items: stretch !important;
}

@media (min-width: 640px) {
  #main-nav-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  #main-nav-tabs {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
  }
}

#main-nav-tabs .nav-pill {
  white-space: normal !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  text-align: left !important;
  min-height: 62px !important;
  padding: 0.55rem 0.65rem !important;
  border-radius: 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  color: #1e293b !important;
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.08), 0 6px 14px -6px rgba(15, 23, 42, 0.12) !important;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease !important;
  position: relative;
}

#main-nav-tabs .nav-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.55) !important;
  box-shadow: 0 5px 0 rgba(16, 185, 129, 0.22), 0 12px 22px -8px rgba(15, 23, 42, 0.18) !important;
}

#main-nav-tabs .nav-pill.rb-nav-active {
  background: linear-gradient(135deg, #064e3b 0%, #0f172a 70%, #070e1b 100%) !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 0 #047857, 0 14px 26px -8px rgba(6, 78, 59, 0.45) !important;
  transform: translateY(-1px);
}

.rb-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
}

.rb-nav-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  letter-spacing: 0.04em;
}

#main-nav-tabs .nav-pill.rb-nav-active .rb-nav-step {
  background: rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
}

.rb-nav-label {
  font-size: 11.5px;
  line-height: 1.24;
  font-weight: 700;
  width: 100%;
}

/* On narrow mobile, make the 7th item span neatly or keep balanced 2-col grid */
@media (max-width: 639px) {
  #main-nav-tabs .nav-pill[data-nav="academia"] {
    grid-column: span 2 / span 2;
    min-height: 54px !important;
  }
}

/* =========================================================
   3D DEPTH CARDS & HERO MODERNIZATION
   ========================================================= */
.rb-stage-3d {
  perspective: 1200px;
}

.rb-tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  will-change: transform;
  position: relative;
}

.rb-tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(16, 185, 129, 0.18) 0%, transparent 58%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 2;
}

.rb-tilt-card:hover .rb-tilt-glare {
  opacity: 1;
}

.rb-hero-modern {
  background: linear-gradient(145deg, #060c18 0%, #0d1729 52%, #071917 100%) !important;
  box-shadow: 0 28px 60px -18px rgba(7, 14, 27, 0.55) !important;
  border: 1px solid rgba(16, 185, 129, 0.26) !important;
}

.rb-card-elevate {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.rb-card-elevate:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px -14px rgba(15, 23, 42, 0.18);
  border-color: rgba(16, 185, 129, 0.4) !important;
}

/* Align Hero CTA buttons cleanly in 1 row on desktop without orphan wrap */
.rb-hero-cta-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0.65rem !important;
}
@media (min-width: 640px) {
  .rb-hero-cta-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
.rb-hero-cta-row > button {
  width: 100%;
  padding: 0.78rem 0.9rem !important;
  font-size: 0.8rem !important;
  line-height: 1.25 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* =========================================================
   SISTEMA AUTOEXPLICATIVO "i" (HOVER + CLICK POPOVER)
   ========================================================= */
.rb-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.16);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.45);
  font-family: 'Plus Jakarta Sans', Georgia, serif;
  font-style: italic;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  vertical-align: middle;
}

.rb-nav-active .rb-info-btn,
.rb-info-btn-dark {
  background: rgba(16, 185, 129, 0.24);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.55);
}

.rb-info-btn:hover,
.rb-info-btn:focus-visible {
  transform: scale(1.15);
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  outline: none;
}

#rb-info-popover {
  position: fixed;
  z-index: 9999;
  width: min(370px, calc(100vw - 24px));
  background: linear-gradient(160deg, #0b1324 0%, #0f172a 100%);
  color: #f8fafc;
  border: 1px solid rgba(16, 185, 129, 0.55);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 28px 60px -12px rgba(2, 6, 23, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: none;
  animation: rbPopIn 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

#rb-info-popover.open {
  display: block;
}

@keyframes rbPopIn {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.rb-guide-banner {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 4px solid #059669;
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 8px 20px -12px rgba(5, 150, 105, 0.25);
}

.rb-sources-strip {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 18px;
  padding: 14px 18px;
}

@media print {
  #rb-info-popover, .rb-no-print {
    display: none !important;
  }
}
