/* ============================================================
   PORTAL EREMPAF — Estilo Institucional
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul:        #1a3c8f;
  --azul-escuro: #122d6e;
  --azul-nav:    #1e2d6f;
  --vermelho:    #c0392b;
  --amarelo:     #f0c030;
  --verde:       #27ae60;
  --cinza-bg:    #f4f6f9;
  --texto:       #1a1a2e;
  --branco:      #ffffff;
  --font-main:   'Montserrat', sans-serif;
  --font-body:   'Open Sans', sans-serif;
  --surface:     #ffffff;
  --border:      #dbe2ee;
  --shadow-sm:   0 8px 24px rgba(18,45,110,.08);
  --shadow-md:   0 18px 48px rgba(18,45,110,.14);
  --radius:      14px;
}

body {
  font-family: var(--font-body);
  background: var(--cinza-bg);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

button, select, input, textarea { font: inherit; }
a, button, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(240,192,48,.75); outline-offset: 3px; }

/* ── HEADER ── */
.header {
  background: linear-gradient(110deg, var(--azul-escuro), var(--azul));
  padding: 20px 0;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-text { display: flex; flex-direction: column; gap: 6px; }

.header-title {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 800;
  color: var(--branco);
  line-height: 1.3;
}

.header-bar {
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--verde) 33%, var(--amarelo) 33% 66%, var(--vermelho) 66%);
  border-radius: 2px;
}

.header-slogan {
  font-size: 13px;
  color: var(--amarelo);
  font-weight: 600;
  font-style: italic;
}


/* ── NAV ── */
.nav {
  background: var(--azul-nav);
  border-bottom: none;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-link {
  color: var(--branco);
  text-decoration: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 14px;
  padding: 14px 28px;
  display: block;
  transition: background 0.15s;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.nav-link:hover { background: rgba(255,255,255,0.08); }
.nav-link.active { background: rgba(255,255,255,0.10); border-bottom-color: var(--amarelo); }

.nav-red-line {
  height: 3px;
  background: var(--vermelho);
}

/* ── MAIN ── */
.main {
  flex: 1;
  padding: clamp(24px, 4vw, 48px) 0;
}

.main-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(24px, 4vw, 42px);
  align-items: start;
}

/* ── CARROSSEL ── */
.carrossel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #ccc;
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow-md);
}

.carrossel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  object-fit: cover;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.slide-placeholder {
  background: linear-gradient(135deg, #244a9e 0%, #10265d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-placeholder:nth-child(2) { background: linear-gradient(135deg, #146142, #123f36); }
.slide-placeholder:nth-child(3) { background: linear-gradient(135deg, #8b3029, #4e2030); }
.slide-content { width: min(82%, 520px); color: white; text-align: left; display: grid; gap: 12px; }
.slide-content strong { font: 800 clamp(24px, 4vw, 42px)/1.12 var(--font-main); letter-spacing: -.03em; }
.slide-content p { max-width: 42ch; color: rgba(255,255,255,.82); font-size: clamp(14px, 1.6vw, 17px); }
.slide-eyebrow, .portal-eyebrow { font: 700 11px/1 var(--font-main); letter-spacing: .14em; text-transform: uppercase; color: var(--amarelo); }

.placeholder-text {
  color: rgba(255,255,255,0.4);
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 600;
}

.carrossel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: white;
  border: none;
  width: 40px;
  height: 60px;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}

.carrossel-btn:hover { background: rgba(0,0,0,0.65); }
.carrossel-prev { left: 0; border-radius: 0 4px 4px 0; }
.carrossel-next { right: 0; border-radius: 4px 0 0 4px; }

.carrossel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carrossel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.carrossel-dot.ativo { background: white; }

/* ── PORTAL CARD ── */
.portal-card {
  background: white;
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.portal-title {
  font-family: var(--font-main);
  font-size: 22px;
  font-weight: 800;
  color: var(--azul);
  text-align: left;
  margin-bottom: 4px;
}
.portal-description { color: #5f6b7d; font-size: 14px; margin-top: -12px; }

.select-group { display: flex; flex-direction: column; }

.select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.select-wrap label { position: absolute; left: 14px; top: 7px; z-index: 1; font: 700 10px/1 var(--font-main); color: #667085; text-transform: uppercase; letter-spacing: .07em; pointer-events: none; }

.select-wrap select {
  width: 100%;
  padding: 24px 42px 9px 14px;
  border: 1.5px solid #d0d8e8;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--texto);
  background: white;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-wrap select:focus {
  outline: none;
  border-color: var(--azul); box-shadow: 0 0 0 4px rgba(26,60,143,.10);
}

.select-arrow {
  position: absolute;
  right: 14px;
  font-size: 18px;
  color: #666;
  pointer-events: none;
}

.btn-acessar {
  background: var(--azul);
  color: white;
  border: none;
  border-radius: 9px;
  padding: 16px;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform .2s, box-shadow .2s;
  letter-spacing: 0.03em;
  margin-top: 4px;
}
.btn-acessar:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(26,60,143,.22); }

.btn-acessar:hover { background: var(--azul-escuro); }

.aviso-erro {
  color: var(--vermelho);
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

.portal-footer-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--verde) 33%, var(--amarelo) 33% 66%, var(--vermelho) 66%);
  border-radius: 2px;
  margin-top: 4px;
}

/* ── FOOTER ── */
.footer {
  background: var(--azul);
  color: white;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}

.footer-heading {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: white;
}

.footer-line {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  line-height: 1.7;
  margin-bottom: 6px;
}

.footer-icon {
  font-size: 10px;
  margin-right: 6px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s;
}

.footer-links a:hover { color: white; }

/* Pernambuco */
.pe-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pe-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.pe-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pe-gov {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}

.pe-name {
  font-family: var(--font-main);
  font-size: 20px;
  font-weight: 800;
  color: white;
  line-height: 1;
}

.pe-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
}

.footer-bottom {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.footer-credito-destaque {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.footer-credito-destaque a {
  color: var(--amarelo);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-credito-destaque a:hover { color: white; text-decoration: underline; }

.footer-institucional {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ── RESPONSIVO ── */
@media (max-width: 768px) {
  .header-title { font-size: 15px; }
  .header-logo { width: 56px; height: 56px; }
  .nav-link { padding: 12px 14px; font-size: 13px; }

  .main-inner {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 560px) {
  .header { padding: 14px 0; }
  .header-inner, .main-inner { padding-left: 16px; padding-right: 16px; }
  .header-brand { gap: 12px; }
  .header-title { font-size: 13px; }
  .header-title br { display: none; }
  .header-slogan { font-size: 11px; }
  .nav-inner { padding: 0 6px; }
  .main-inner { gap: 18px; }
  .carrossel { aspect-ratio: 4 / 3; }
  .slide-content { width: 76%; }
  .slide-content strong { font-size: 24px; }
  .carrossel-btn { width: 38px; height: 48px; }
  .portal-card { padding: 28px 20px 22px; }
  .footer-inner { padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
