:root {
  --bg: #f4f6f8;
  --bg-secondary: #ffffff;
  --card: #ffffff;
  --card2: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --brand: #b8e900;
  --brand2: #8cb100;
  --danger: #ff4d4d;
  --ok: #b8e900;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  --radius: 18px;
  --radius-sm: 14px;
  --border: 1px solid rgba(17, 24, 39, 0.08);
  --max-width: 1180px;
}

body.dark {
  --bg: #000000;
  --bg-secondary: #050505;
  --card: #0a0a0a;
  --card2: #121212;
  --text: #ffffff;
  --muted: #a1a1a1;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  --border: 1px solid rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(184, 233, 0, 0.08), transparent 50%),
    radial-gradient(900px 500px at 80% 30%, rgba(255, 255, 255, 0.03), transparent 55%),
    linear-gradient(180deg, var(--bg-secondary), var(--bg));
  background-attachment: fixed;
  transition: background 0.3s ease, color 0.3s ease;
  line-height: 1.5;
}

/* TOPBAR & LOGO */
.topbar {
  width: min(var(--max-width), 92vw);
  margin: 0 auto;
  padding: 24px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  height: 42px;
  width: auto;
  display: block;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  background: var(--card);
  border: var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: 0.2s;
}
.btn-home svg { width: 18px; height: 18px; }
.btn-home:hover {
  background: var(--brand);
  color: #000;
  border-color: var(--brand);
  transform: translateY(-2px);
}

/* THEME TOGGLE */
.theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: 0.2s;
}
.theme-toggle:hover { transform: translateY(-2px) scale(1.05); }

.theme-toggle svg {
  width: 20px;
  height: 20px;
  display: none;
}
body.dark .sun-icon { display: block !important; }
body:not(.dark) .moon-icon { display: block !important; }

/* MAIN STRUCTURE */
main {
  width: min(var(--max-width), 92vw);
  margin: 0 auto;
  padding: 12px 0 72px;
}

section {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(4px);
}

body:not(.dark) section {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.88));
}

/* HERO */
#hero {
  text-align: center;
  padding: 56px 32px;
  background: radial-gradient(circle at top left, rgba(184, 233, 0, 0.12), transparent 30%);
}
#hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 10px; letter-spacing: -1px; }
#hero p { color: var(--muted); font-size: 1.1rem; }

/* SECTION HEADERS */
.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}
.section-header-flex h2 { 
  margin: 0; 
  font-weight: 800; 
  font-size: 1.8rem;
}

/* SEARCH BAR */
.search-wrapper {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  position: relative;
}
.search-input {
  width: 100%;
  border-radius: 20px;
  padding: 12px 18px 12px 45px;
  border: var(--border);
  outline: none;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: 0.3s;
  font-size: 14px;
}
.search-input:focus { border-color: var(--brand); }

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-icon svg { width: 100%; height: 100%; }

/* VAGAS GRID */
#lista-vagas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.vacancy-card {
  background: var(--card2);
  border: var(--border);
  padding: 24px;
  border-radius: var(--radius-sm);
  transition: 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.vacancy-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.vacancy-card h3 { 
  margin: 0 0 8px; 
  color: var(--text); 
  font-weight: 700; /* Bold in card */
}
.vacancy-card .setor { color: var(--brand2); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* INSTITUCIONAL */
.institucional-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.card-identidade {
  cursor: pointer;
  transition: all 0.3s ease;
  border: var(--border);
  padding: 20px;
  border-radius: var(--radius-sm);
  background: var(--card);
  position: relative;
  overflow: hidden;
}
.card-identidade:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--brand); }
.institucional-titulo { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.institucional-icone { width: 55px; height: 55px; object-fit: contain; }

.card-identidade h3 { font-weight: 800; }
.card-identidade p { font-weight: 400; } /* Removed bolding */
.card-identidade h3::after {
  content: ' ▼';
  font-size: 0.7em;
  float: right;
  transition: 0.3s;
  opacity: 0.5;
  font-weight: normal;
}
.card-identidade.aberto h3::after { transform: rotate(180deg); color: var(--brand); opacity: 1; }
.card-conteudo {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  opacity: 0;
}
.card-identidade.aberto .card-conteudo {
  max-height: 400px;
  opacity: 1;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed var(--border);
}

/* FEATURES */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.feature-card {
  background: var(--card2);
  padding: 24px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 2px solid transparent;
  transition: 0.3s;
}
.feature-card:hover { border-color: var(--brand); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(184, 233, 0, 0.15); }

/* NEWSLETTER */
.newsletter-wrapper { text-align: center; padding: 3rem 5%; background: var(--card2); border-radius: var(--radius-sm); }
.newsletter-form-flex { margin-top: 20px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.newsletter-input {
  padding: 14px 18px;
  border-radius: 12px;
  border: var(--border);
  background: var(--card);
  color: var(--text);
  outline: none;
  flex: 1;
  max-width: 300px;
}
.newsletter-btn { width: auto; padding: 14px 28px; font-weight: 700; border-radius: 12px; background: var(--brand); cursor: pointer; border: none; }
.newsletter-feedback { margin-top: 15px; font-size: 14px; font-weight: bold; }

/* MODAL */
.candidate-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.candidate-modal {
  background: var(--card);
  width: min(750px, 95vw);
  max-height: 90vh;
  border-radius: var(--radius);
  padding: 35px;
  position: relative;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.candidate-modal-header { display: flex; justify-content: space-between; margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.candidate-close { background: none; font-size: 2rem; color: var(--muted); border: none; cursor: pointer; }

/* VACANCY FORMATTING (IMPORTANT) */
.vaga-bloco { margin-bottom: 25px; }

.vaga-bloco h3 { 
  font-size: 1.1rem; 
  color: var(--brand2); 
  margin-bottom: 12px; 
  text-transform: uppercase; 
  letter-spacing: 0.8px; 
  font-weight: 800; /* Extra bold for visibility */
}

/* Modal Vacancy Title */
.candidate-modal-header h2 {
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 4px;
}

/* Institutional and Identification Cards */
#institutional .section-header h2 {
  color: var(--text); /* Black/Dark */
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
}

#institutional .section-header p {
  font-weight: 400;
  color: var(--text); /* Safe for dark mode */
}

.card-identidade h3 { 
  font-weight: 900; 
  font-size: 1.4rem; /* Larger */
}

.vaga-bloco b, .vaga-bloco strong {
  color: var(--brand2);
}

.vaga-bloco p, #mDescricao, #mRequisitos, #mCompetencias, #mBeneficios, #mRemuneracao {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
  opacity: 1; /* More visible */
  line-height: 1.6;
}
.vaga-bloco ul { margin: 10px 0; padding-left: 25px; color: var(--text); }
.vaga-bloco li { margin-bottom: 5px; }

/* Hero Title Bold */
#hero h1 { 
  font-weight: 900; 
  letter-spacing: -2px;
}

.pipefy-notice { 
  display: none; /* Removed !important to allow JS toggling */
  margin-top: 35px; 
  margin-bottom: 20px;
  padding: 30px 20px; 
  background: var(--card2); 
  border-radius: 18px; 
  border: 1px dashed var(--brand); 
  text-align:center;
  flex-shrink: 0; /* No squashing */
}

.pipefy-notice.aberto { display: block !important; }

.pipefy-btn { 
  text-decoration: none; 
  display: inline-block; 
  padding: 14px 40px; 
  background: var(--brand); 
  color: #000; 
  font-weight: 700; 
  border-radius: 14px; 
  transition: 0.3s;
  box-shadow: 0 8px 25px rgba(184, 233, 0, 0.2);
}
.pipefy-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(184, 233, 0, 0.3);
}

.pipefy-notice h3 { margin-bottom: 10px; font-weight: 800; }
.pipefy-notice p { margin-bottom: 20px; font-size: 0.95rem; opacity: 0.8; }

/* ADMIN AVATAR */
.admin-access { position: fixed; right: 30px; bottom: 30px; z-index: 100; }
.admin-avatar { 
  width: 50px; 
  height: 50px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  box-shadow: var(--shadow); 
  transition: 0.3s;
  background: var(--card);
  color: var(--text);
  border: var(--border);
}
.admin-avatar:hover {
  background: var(--brand);
  color: #000;
  border-color: var(--brand);
}

/* FOOTER (VANILLA CSS UPGRADE) */
.site-footer { 
  background: #000; 
  color: #fff; 
  padding: 64px 0 32px; 
  border-top: 1px solid rgba(184, 233, 0, 0.2); 
  font-family: inherit;
}

.footer-container {
  width: min(var(--max-width), 92vw);
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; }
}

.footer-logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  text-decoration: none;
  color: #fff;
  display: block;
  margin-bottom: 24px;
}
.footer-logo-text span { color: var(--brand); }

.footer-desc {
  color: #9ca3af;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.footer-social-flex { display: flex; gap: 16px; }
.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: 0.3s;
  text-decoration: none;
}
.social-icon:hover { transform: scale(1.1); }
.social-icon.insta:hover { background: #E1306C; }
.social-icon.linkdn:hover { background: #0077B5; }
.social-icon svg { width: 20px; height: 20px; }

.footer-col-title {
  color: #fff;
  font-weight: 700;
  margin-bottom: 24px;
  padding-left: 12px;
  border-left: 4px solid var(--brand);
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { 
  color: #9ca3af; 
  text-decoration: none; 
  font-size: 0.875rem; 
  transition: 0.2s; 
}
.footer-links a:hover { color: var(--brand); }

/* LINK ESPECIAL PORTAL */
.link-portal { color: var(--brand) !important; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ping-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: footer-pulse 2s infinite; }

@keyframes footer-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.footer-map-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #333;
  margin-bottom: 16px;
  height: 192px;
  position: relative;
  background: #1a1a1a;
}
.footer-map-link { position: absolute; inset: 0; z-index: 2; }
.footer-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(1) invert(1) opacity(0.7);
  transition: 0.5s;
}
.footer-map-wrap:hover .footer-iframe { filter: grayscale(0) invert(0) opacity(1); }

.footer-contact-item {
  display: flex;
  gap: 12px;
  color: #9ca3af;
  font-size: 0.875rem;
  margin-top: 16px;
}
.footer-contact-item svg { width: 20px; height: 20px; color: var(--brand); flex-shrink: 0; }

.footer-contact-list {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #1f2937;
  list-style: none;
}
.footer-contact-list li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; transition: 0.2s; }
.footer-contact-list li:hover { color: #fff; }
.footer-contact-list svg { width: 16px; height: 16px; color: #4b5563; }
.footer-contact-list li:hover svg { color: var(--brand); }

.footer-bottom {
  border-top: 1px solid #1f2937;
  padding-top: 32px;
  text-align: center;
  color: #6b7280;
  font-size: 0.75rem;
}

/* RESPONSIVITY IMPROVEMENTS */
@media (max-width: 768px) {
  .topbar { padding: 15px 0; }
  .site-logo { height: 32px; }
  
  #hero { padding: 40px 20px; }
  #hero h1 { font-size: 2.2rem; font-weight: 900; }
  
  .section-header-flex { flex-direction: column; align-items: stretch; }
  .search-wrapper { max-width: none; }
  
  .candidate-modal { padding: 25px 20px; }
  .candidate-modal-header h2 { font-size: 1.6rem; font-weight: 800; }
  
  .features-grid, .institucional-container { grid-template-columns: 1fr; }
  .vacancy-card { padding: 20px; }
}

@media (max-width: 480px) {
  .topbar-actions .btn-home span { display: none; }
  .topbar-actions .btn-home { padding: 10px; }
  
  .vaga-bloco h3 { font-size: 0.95rem; }
  .candidate-close svg { width: 22px; height: 22px; }
}

.loading-message { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--muted); }