:root {
  --red: #c1161d;
  --red-dark: #a11117;
  --orange: #ef6010;
  --blue: #1a5fb4;
  --green: #2f8a3b;
  --ink: #181a1f;
  --gray: #6b7280;
  --gray-line: #e5e5ea;
  --bg: #f6f6f8;
  --bg-alt: #f7f7f9;
  --white: #fff;
  --shadow: 0 4px 16px rgba(20, 20, 40, 0.06);
  --radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Aba lateral "Avaliar Portal" */
.rate-tab {
  position: fixed;
  left: -34px;
  top: 42%;
  transform: rotate(-90deg);
  transform-origin: center;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  z-index: 40;
  box-shadow: var(--shadow);
}

/* ============ HEADER ============ */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--gray-line);
}
.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand { flex: 0 0 auto; }
.brand__logo { height: 40px; width: auto; }

.segmented {
  margin: 0 auto;
  display: inline-flex;
  border: 2px solid var(--red);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
}
.segmented__opt {
  border: none;
  background: transparent;
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
  padding: 5px 20px;
  border-radius: 999px;
  cursor: pointer;
}
.segmented__opt.is-active {
  background: var(--orange);
  color: #fff;
}

.topbar__user { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  background: transparent;
  border: none;
  color: #444;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: inline-flex;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.05); }

/* Menu */
.mainnav { background: #fff; border-bottom: 1px solid var(--gray-line); }
.mainnav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 34px;
}
.mainnav__link {
  padding: 16px 2px;
  font-size: 14px;
  font-weight: 600;
  color: #2b2b2b;
  border-bottom: 3px solid transparent;
}
.mainnav__link:hover { color: var(--red); border-bottom-color: var(--red); }

/* ============ HERO ============ */
.hero {
  background-color: #eef0f2;
  background-image: url("https://sefmgdev.service-now.com/80a44a3e3b91c710624dd337f4e45a59.iix");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
.hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
}
.hero__content { max-width: 520px; }
.hero__title {
  color: var(--red);
  font-size: 34px;
  font-weight: 800;
  margin: 0 0 10px;
}
.hero__subtitle {
  color: #333;
  font-size: 15px;
  margin: 0 0 22px;
  max-width: 430px;
}
.searchbar {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  max-width: 420px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.searchbar__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: #333;
}
.searchbar__btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============ SECTIONS ============ */
.section { padding: 42px 24px; }
.section--wide { max-width: 1200px; margin: 0 auto; }
.section__title {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 28px;
}
.section__title--center { text-align: center; }
.section__title--bar {
  font-size: 22px;
  padding-left: 12px;
  border-left: 4px solid var(--red);
  margin-bottom: 20px;
}
.center { text-align: center; margin-top: 30px; }

/* Botões */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  border-radius: 6px;
  padding: 12px 26px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); }
.btn--outline {
  background: #fff;
  border-color: var(--red);
  color: var(--red);
  padding: 10px 20px;
}
.btn--outline:hover { background: var(--red); color: #fff; }

/* ============ TABS ============ */
.tabs__head {
  display: flex;
  justify-content: center;
  gap: 60px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 6px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.tab__icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tab__icon img { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.tab__icon--red { background: var(--red); }
.tab__icon--blue { background: var(--blue); }
.tab__icon--green { background: var(--green); }
.tab.is-active[data-tab="cidadao"] { border-bottom-color: var(--red); }
.tab.is-active[data-tab="empresas"] { border-bottom-color: var(--blue); }
.tab.is-active[data-tab="produtor"] { border-bottom-color: var(--green); }

.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.svc-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-height: 150px;
}
.svc-card__tag {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-block;
  margin-bottom: 10px;
}
.svc-card__tag--red { color: var(--red); }
.svc-card__tag--blue { color: var(--blue); }
.svc-card__tag--green { color: var(--green); }
.svc-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.svc-card__desc {
  font-size: 13px;
  color: var(--gray);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.svc-card__lock {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0f0f0 url("https://sefmgdev.service-now.com/lock.png") no-repeat center / 12px;
}

/* ============ CATEGORIA ============ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.cat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 14px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20, 20, 40, 0.1); }
.cat-card__icon { height: 34px; }
.cat-card__icon img { height: 34px; width: auto; }
.cat-card__label { font-size: 14px; font-weight: 700; color: var(--ink); }

/* ============ COMUNICADOS + AJUDA ============ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
}
.news {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.news__thumb {
  flex: 0 0 130px;
  height: 110px;
  border: 1px solid var(--gray-line);
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 10px, #f0f0f0 10px, #f0f0f0 20px);
  border-radius: 4px;
}
.news__title { font-size: 15px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
.news__text { font-size: 13px; color: var(--gray); margin: 0 0 8px; }
.news__date { font-size: 12px; color: #9aa0a6; font-weight: 600; }

.help-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 22px;
  min-height: 120px;
}
.help-card__media {
  flex: 0 0 170px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 60% 60% 0 / 0 50% 50% 0;
  background: #d9d9d9;
}
.help-card__media--dark { background: #4a4a4a; }
.help-card__media img { width: 100%; height: 100%; object-fit: cover; }
.help-card__media--dark img { width: 70%; height: auto; object-fit: contain; }
.help-card__body {
  flex: 1;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.help-card__body p { margin: 0; font-size: 14px; color: #333; }

/* ============ FOOTER ============ */
.footer { margin-top: 30px; }
.footer__top {
  background: #6f6f6f;
  color: #fff;
  position: relative;
  overflow: hidden;
  background-image: url("https://sefmgdev.service-now.com/footer-detail.svg");
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 100%;
}
.footer__top {
  padding: 50px 24px;
  display: flex;
  gap: 40px;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}
.footer__cols { display: flex; gap: 80px; }
.footer__heading {
  color: var(--red);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
}
.footer__col a {
  display: block;
  font-size: 13px;
  color: #f0f0f0;
  margin-bottom: 10px;
}
.footer__col a:hover { text-decoration: underline; }
.footer__brand { text-align: right; }
.footer__sef { height: 54px; margin-left: auto; margin-bottom: 14px; }
.footer__addr {
  font-style: normal;
  font-size: 12px;
  color: #eaeaea;
  line-height: 1.6;
}
.footer__bottom {
  background: #5c5c5c;
  color: #ddd;
  font-size: 12px;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============ CHAT FAB ============ */
/* Posicionado à esquerda para não colidir com o launcher nativo do Nimo (canto direito) */
.chat-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(193, 22, 29, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.chat-fab:hover { background: var(--red-dark); transform: translateY(-2px); }

/* ============ RESPONSIVO ============ */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr; gap: 30px; }
  .footer__top { flex-direction: column; }
  .footer__brand { text-align: left; }
  .footer__sef { margin-left: 0; }
}
@media (max-width: 620px) {
  .cards-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .topbar__inner { flex-wrap: wrap; }
  .segmented { margin: 0; order: 3; width: 100%; justify-content: center; }
  .mainnav__inner { overflow-x: auto; }
  .chat-fab span { display: none; }
  .chat-fab { padding: 16px; }
}
