/* --- Variáveis Globais --- */
:root {
  --primary-color: #007BFF; /* Azul Principal */
  --secondary-color: #0d6efd; /* Azul Secundário (Hover) */
  --accent-color: #FD7E14; /* Laranja Destaque */
  --success-color: #28a745; /* Verde Sucesso */
  --light-bg-color: #f8f9fa; /* Fundo Claro */
  --dark-bg-color: #343a40; /* Fundo Escuro */
  --text-color: #333;
  --light-text-color: #fff;
  --border-color: #dee2e6;
  --font-family: 'Poppins', sans-serif;
  --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  --border-radius: 8px;
}

/* --- Reset e Estilos Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--text-color);
  background-color: #fff;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  font-weight: 600;
  color: var(--dark-bg-color);
}

h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #6c757d;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

section {
  padding: 60px 0;
}

/* --- Botões --- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--light-text-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--light-text-color);
}

/* --- Header --- */
header {
  background-color: #fff;
  box-shadow: var(--box-shadow);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-bg-color);
}

.logo h1 span {
  color: var(--primary-color);
}

.logo p {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: -5px;
}

nav ul {
  list-style: none;
  display: flex;
}

nav ul li a {
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
  color: var(--primary-color);
}

.mobile-menu {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Seção Hero --- */
.hero {
  background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url('../images/hero-bg.jpg') no-repeat center center/cover;
  padding-top: 160px;
  padding-bottom: 100px;
  text-align: center;
}

.hero h2 {
  font-size: 3.5rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 1.5rem auto 2.5rem;
  color: #555;
}

.hero-buttons .btn {
  margin: 0 10px;
}

/* --- Seção Serviços --- */
#servicos {
  background-color: var(--light-bg-color);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.service-card {
  background-color: #fff;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.service-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.service-features {
  list-style: none;
  text-align: left;
  margin-top: 1.5rem;
}

.service-features li {
  margin-bottom: 0.5rem;
  color: #555;
}

.service-features .fa-check {
  color: var(--success-color);
  margin-right: 10px;
}

/* --- Seção Portfólio --- */
#portfolio {
  background-color: #fff;
}

.portfolio-filter {
  text-align: center;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  margin: 0 5px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.filter-btn.active, .filter-btn:hover {
  background-color: var(--primary-color);
  color: var(--light-text-color);
  border-color: var(--primary-color);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  min-height: 100px; /* Evita colapso da grade */
}

.portfolio-item {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: visible; /* Garante que nada seja cortado */
  display: flex;
  flex-direction: column;
  min-height: 400px; /* Altura mínima para consistência */
}

.portfolio-item-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.portfolio-item-header h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--dark-bg-color);
}

.btn-visit {
  font-size: 0.9rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.btn-visit:hover {
  color: var(--secondary-color);
}

.portfolio-description {
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  color: #555;
  flex-grow: 1;
}

.iframe-container {
  position: relative;
  width: 100%;
  background-color: #000;
  flex-grow: 0;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.iframe-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.iframe-fallback .fa-exclamation-triangle {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.btn-fallback {
  background-color: var(--accent-color);
  color: #fff;
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  margin-top: 1rem;
}

.portfolio-tech {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.portfolio-tech span {
  background-color: #eee;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  display: inline-block;
}

.portfolio-loader, .portfolio-empty, .portfolio-error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 0;
  color: #6c757d;
  font-size: 1.1rem;
}

.portfolio-empty .fa-folder-open, .portfolio-error .fa-exclamation-circle {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.loader-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.portfolio-cta {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  background-color: var(--light-bg-color);
  border-radius: var(--border-radius);
}

.btn-portfolio {
  background-color: var(--accent-color);
  color: var(--light-text-color);
}

.btn-portfolio:hover {
  background-color: #e66a00;
}

/* --- Seção Sobre --- */
#sobre {
  background-color: var(--light-bg-color);
}

.about .container {
  display: flex;
  align-items: center;
  gap: 50px;
}

.about-content {
  flex: 1;
}

.about-image {
  flex: 1;
  position: relative;
}

.about-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.about-badge {
  position: absolute;
  bottom: 20px;
  left: -30px;
  background-color: var(--accent-color);
  color: var(--light-text-color);
  padding: 15px 25px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.about-badge .fa-award {
  font-size: 1.5rem;
}

.about-content .highlight {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

.about-stats {
  display: flex;
  gap: 30px;
  margin: 2rem 0;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  display: block;
  color: #6c757d;
}

.about-team h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* --- Seção Formulário --- */
.contact-form {
  background-color: #fff;
}

.form-header {
  text-align: center;
  margin-bottom: 3rem;
}

#systemRequestForm {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--light-bg-color);
  padding: 40px;
  border-radius: var(--border-radius);
}

.form-row {
  display: flex;
  gap: 30px;
  margin-bottom: 1.5rem;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  flex-basis: 100%;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-family);
}

.form-group textarea {
  resize: vertical;
}

.requirements-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.requirements-section h3 {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-color);
}

.form-submit {
  text-align: center;
  margin-top: 2rem;
}

.btn-submit {
  background-color: var(--success-color);
  color: var(--light-text-color);
  font-size: 1.2rem;
  padding: 15px 40px;
  border: none;
}

.btn-submit:hover {
  background-color: #218838;
}

.btn-submit .fa-paper-plane {
  margin-right: 10px;
}

.form-required {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #6c757d;
}

/* --- Seção Contato Info --- */
#contato {
  background-color: var(--light-bg-color);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.contact-card {
  text-align: center;
}

.contact-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.contact-link {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 500;
}

.contact-link .fa-arrow-right {
  transition: transform 0.3s ease;
  display: inline-block;
}

.contact-link:hover .fa-arrow-right {
  transform: translateX(5px);
}

/* --- Seção CTA --- */
.cta {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: var(--light-text-color);
  text-align: center;
}

.cta h2 {
  color: var(--light-text-color);
  font-size: 2.2rem;
}

.btn-cta {
  background-color: var(--light-text-color);
  color: var(--primary-color);
  margin-top: 1.5rem;
}

.btn-cta:hover {
  background-color: #f1f1f1;
}

.btn-cta .fa-lightbulb {
  margin-right: 10px;
}

/* --- Footer --- */
footer {
  background-color: var(--dark-bg-color);
  color: #adb5bd;
  padding: 60px 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--light-text-color);
}

.footer-logo h3 span {
  color: var(--primary-color);
}

.footer-social {
  margin-top: 1.5rem;
}

.footer-social a {
  color: var(--light-text-color);
  font-size: 1.2rem;
  margin-right: 15px;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--primary-color);
}

.footer-links h4, .footer-services h4, .footer-newsletter h4 {
  color: var(--light-text-color);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.footer-links ul, .footer-services ul {
  list-style: none;
}

.footer-links li a, .footer-services li a {
  text-decoration: none;
  color: #adb5bd;
  margin-bottom: 10px;
  display: block;
  transition: color 0.3s ease;
}

.footer-links li a:hover, .footer-services li a:hover {
  color: var(--light-text-color);
}

.newsletter-form {
  display: flex;
  margin-bottom: 1rem;
}

.newsletter-form input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--border-radius) 0 0 var(--border-radius);
  background-color: #495057;
  color: var(--light-text-color);
}

.btn-newsletter {
  background-color: var(--primary-color);
  color: var(--light-text-color);
  border: none;
  padding: 0 15px;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  cursor: pointer;
}

.footer-bottom {
  border-top: 1px solid #495057;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.footer-legal a {
  color: #adb5bd;
  text-decoration: none;
  margin-left: 15px;
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: var(--light-text-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* --- Responsividade --- */
@media (max-width: 992px) {
  h2 { font-size: 2.2rem; }
  .about .container { flex-direction: column; }
  .about-image { margin-top: 2rem; }
}

@media (max-width: 768px) {
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: var(--box-shadow);
  }
  nav ul.show {
    display: flex;
  }
  nav ul li {
    text-align: center;
    padding: 1rem 0;
  }
  .mobile-menu {
    display: block;
  }
  .hero h2 { font-size: 2.8rem; }
  .form-row { flex-direction: column; gap: 1.5rem; }
  .footer-content { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; }
  .portfolio-grid {
    grid-template-columns: 1fr; /* Uma coluna em telas menores */
  }
}