:root {
  --ufpb-green: #143f82;
  --ufpb-blue: #143f82;
  --ufpb-blue-dark: #0b2d63;
  --ufpb-blue-soft: #eef4fb;
  --ink: #1f2933;
  --muted: #667085;
  --line: #e6eaf0;
  --paper: #ffffff;
  --soft: #f6f8fa;
  --gold: #8aa0bf;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
}

.portal-hero {
  min-height: 650px;
  padding: 28px clamp(20px, 4vw, 64px) 72px;
  background:
    linear-gradient(135deg, rgba(8, 31, 69, .96), rgba(20, 63, 130, .88)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.055) 0, rgba(255,255,255,.055) 1px, transparent 1px, transparent 80px);
  background-position: center;
  background-size: cover;
  color: #fff;
}

.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.portal-brand,
.portal-link,
.portal-button,
.portal-demo-card a {
  text-decoration: none;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.portal-brand span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 50%;
  font-weight: 800;
}

.portal-logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  padding: 6px;
}

.portal-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.portal-actions,
.portal-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.portal-link {
  color: rgba(255,255,255,.84);
  font-weight: 700;
}

.portal-link:hover {
  color: #fff;
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: #fff;
  color: var(--ufpb-blue-dark);
  font-weight: 800;
  box-shadow: 0 14px 34px rgba(0,0,0,.16);
}

.portal-button:hover {
  color: var(--ufpb-blue-dark);
  transform: translateY(-1px);
}

.portal-button-dark {
  background: var(--ufpb-blue-dark);
  color: #fff;
}

.portal-button-dark:hover {
  color: #fff;
}

.portal-button-light {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.portal-button-light:hover {
  color: #fff;
}

.portal-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 56px;
  align-items: end;
  width: min(1180px, 100%);
  margin: 118px auto 0;
}

.portal-eyebrow,
.portal-card-label {
  display: inline-block;
  color: #d6b979;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.portal-hero h1 {
  max-width: 820px;
  margin: 14px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.65rem, 6vw, 5.4rem);
  line-height: 1;
}

.portal-hero p {
  max-width: 710px;
  color: rgba(255,255,255,.84);
  font-size: 1.14rem;
  line-height: 1.75;
}

.portal-demo-card {
  padding: 30px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  box-shadow: 0 26px 70px rgba(0,0,0,.2);
  backdrop-filter: blur(18px);
}

.portal-demo-card h2 {
  margin: 12px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.85rem;
}

.portal-demo-card a {
  display: inline-flex;
  margin-top: 10px;
  color: #fff;
  font-weight: 800;
}

.portal-section {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 48px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 84px 0 34px;
}

.portal-section h2 {
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.portal-section p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.85;
}

.portal-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 84px;
}

.portal-features article {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(16,24,40,.06);
}

.portal-features i {
  color: var(--ufpb-green);
  font-size: 1.8rem;
}

.portal-features h3 {
  margin: 18px 0 10px;
  font-size: 1.18rem;
}

.portal-features p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.content-tabs,
.content-accordion {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.tab-buttons button,
.accordion-item-custom > button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ufpb-blue-dark);
  font-weight: 800;
}

.tab-buttons button {
  padding: 10px 14px;
}

.tab-buttons button.active {
  border-color: var(--ufpb-blue);
  background: var(--ufpb-blue);
  color: #fff;
}

.tab-panel {
  display: none;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tab-panel.active {
  display: block;
}

.accordion-item-custom {
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.accordion-item-custom > button {
  display: block;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
}

.accordion-panel {
  display: none;
  padding: 0 16px 16px;
}

.accordion-item-custom.open .accordion-panel {
  display: block;
}

.hero {
  min-height: 350px;
  position: relative;
  display: flex;
  align-items: end;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.hero-compact { min-height: 280px; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 20, 16, .36), rgba(8, 20, 16, .72));
}

.hero-content {
  position: relative;
  color: #fff;
  padding-bottom: 76px;
}

.eyebrow, .section-kicker {
  display: inline-block;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 900px;
  margin: 12px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 1.02;
}

.hero p { font-size: 1.15rem; color: rgba(255,255,255,.86); }

.profile-intro {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  padding: 72px 12px;
}

.profile-photo {
  width: 230px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 7px solid #fff;
  box-shadow: 0 24px 60px rgba(31, 41, 51, .16);
}

.profile-copy h2, .content-section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.profile-copy p { color: var(--muted); line-height: 1.8; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 14px 24px; margin: 22px 0; }
.contact-grid span { color: var(--ink); }
.contact-grid i { color: var(--ufpb-green); margin-right: 8px; }

.social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.social-links a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ufpb-green);
  text-decoration: none;
  transition: .2s ease;
}
.social-links a:hover { background: var(--ufpb-green); color: #fff; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.site-nav .container {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-nav a {
  color: var(--ink);
  padding: 8px 12px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 6px;
}
.site-nav a:hover { background: var(--soft); color: var(--ufpb-green); }
.nav-dropdown {
  position: relative;
  display: inline-flex;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: none;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 18px 40px rgba(31,41,51,.14);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: grid;
  gap: 4px;
}
.nav-dropdown-menu a {
  width: 100%;
  text-align: left;
}

.theme-toggle {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.content-section {
  padding: 88px 12px;
  border-bottom: 1px solid var(--line);
}

.rich-content {
  margin-top: 24px;
  color: #344054;
  font-size: 1.04rem;
  line-height: 1.85;
}
.embedded-file-card {
  display: flex;
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(31,41,51,.05);
}

.inline-upload-box {
  margin-top: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.inline-upload-box h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.embedded-file-card > i {
  color: var(--ufpb-green);
  font-size: 1.7rem;
}
.embedded-file-title {
  color: var(--ufpb-green);
  font-weight: 800;
  text-decoration: none;
}
.embedded-file-title:hover {
  text-decoration: underline;
}
.embedded-file-card p { margin: 6px 0 0; }
.rich-content .embedded-image {
  display: inline-block;
  width: min(230px, 100%);
  margin: 12px 14px 14px 0;
  vertical-align: top;
}
.rich-content .embedded-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(31,41,51,.12);
  cursor: zoom-in;
}
.rich-content .embedded-image figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.45;
}
.rich-content img { max-width: 100%; height: auto; border-radius: 10px; box-shadow: 0 16px 38px rgba(31,41,51,.12); cursor: zoom-in; }
.rich-content .embedded-image img { max-width: none; height: auto; }
.rich-content table,
.rich-content .content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 26px rgba(31,41,51,.05);
}
.rich-content td,
.rich-content th {
  border: 1px solid var(--line);
  padding: 12px 14px;
  vertical-align: top;
}
.rich-content th {
  color: var(--ufpb-blue-dark);
  background: var(--ufpb-blue-soft);
  font-weight: 800;
}
.rich-content tr:nth-child(even) td {
  background: #f9fbfd;
}
.rich-content blockquote { border-left: 4px solid var(--gold); padding-left: 20px; color: var(--muted); }

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.page-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.page-link-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 26px rgba(31,41,51,.05);
}
.page-link-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.page-link-card p {
  margin: 0;
  color: var(--muted);
}
.child-pages {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.file-card {
  display: flex;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(31,41,51,.06);
}
.file-card > i { color: var(--ufpb-green); font-size: 2rem; }
.file-card h3 { font-size: 1.05rem; }
.file-card p { color: var(--muted); min-height: 48px; }
.section-files {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.section-files > h3 {
  margin-bottom: 18px;
  font-size: 1.1rem;
}

.contact-form {
  max-width: 850px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.site-footer { padding: 34px 0; color: var(--muted); background: #f2f4f7; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.footer-inner p { margin: 0; }
.footer-admin-link {
  color: #667085;
  font-size: .88rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.footer-admin-link:hover,
.footer-admin-link:focus {
  color: var(--ufpb-green);
  border-color: currentColor;
}
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--ufpb-green);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(7, 12, 18, .86);
}
.image-modal img { max-width: min(1100px, 95vw); max-height: 86vh; border-radius: 10px; }
.image-modal button { position: fixed; top: 20px; right: 28px; color: #fff; background: none; border: 0; font-size: 42px; }

.dark-mode body { background: #111827; color: #f9fafb; }
.dark-mode .site-nav { background: rgba(17,24,39,.92); border-color: #273244; }
.dark-mode .site-nav a, .dark-mode .profile-copy p, .dark-mode .rich-content { color: #d0d5dd; }
.dark-mode .content-section, .dark-mode .file-card, .dark-mode .contact-form { border-color: #273244; background: #151f2e; }
.dark-mode .site-footer { background: #0b1220; }
.dark-mode .footer-admin-link { color: #98a2b3; }
.dark-mode .footer-admin-link:hover,
.dark-mode .footer-admin-link:focus { color: #d1fadf; }

@media (max-width: 768px) {
  .portal-hero {
    min-height: auto;
    padding: 22px 18px 52px;
  }
  .portal-nav,
  .portal-actions,
  .portal-cta {
    align-items: stretch;
    flex-direction: column;
  }
  .portal-nav {
    gap: 22px;
  }
  .portal-brand {
    width: 100%;
  }
  .portal-actions,
  .portal-button,
  .portal-link {
    width: 100%;
  }
  .portal-link {
    text-align: center;
  }
  .portal-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 64px;
  }
  .portal-demo-card {
    padding: 24px;
  }
  .portal-section,
  .portal-features {
    grid-template-columns: 1fr;
  }
  .hero { min-height: 320px; background-attachment: scroll; }
  .profile-intro { grid-template-columns: 1fr; gap: 28px; padding: 48px 16px; }
  .profile-photo { width: 180px; }
  .content-section { padding: 58px 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
