/* ====================================================== */
/* 1. CONFIGURAÇÃO GLOBAL E VARIÁVEIS                     */
/* ====================================================== */
:root {
  --color1: #ffffff;
  --color2: #000000;
}

html {
  font-size: 100%; /* Define a base para que 1rem = 16px */
  scroll-behavior: smooth;
}

body {
  font-size: 1.2rem; /* Agora 1.2rem = 19.2px */
  font-family: "Nortura-SemiExpanded", sans-serif;
  font-style: normal;
  font-weight: 500;
  overflow-x: hidden; /* Evita rolagem horizontal indesejada */
  background-color: var(--color1);
  color: var(--color2);
}

* {
  margin: 0;
  padding: 0;
  border: none;
  text-decoration: none;
  box-sizing: border-box; /* Layouts mais previsíveis */
}

/* Correção de Acessibilidade: 
  Remove o outline em cliques, mas o mantém para navegação via teclado.
*/
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--color2);
  outline-offset: 2px;
}

/* ====================================================== */
/* 2. DEFINIÇÃO DE FONTES                                 */
/* ====================================================== */
@font-face {
  font-family: "Nortura";
  src: url("font/northura-medium.otf") format("opentype"),
    url("font/northura-medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nortura-SemiExpanded";
  src: url("font/northura-mediumsemiexpanded.otf") format("opentype"),
    url("font/northura-mediumsemiexpanded.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ====================================================== */
/* 3. ESTILOS GLOBAIS E UTILITÁRIOS (Desktop-First)       */
/* ====================================================== */

/* Otimização: Agrupando botões */
.btn,
.btn-2 {
  width: fit-content;
  padding: 1em 5em;
  border-radius: 05px;
  font-family: "Nortura-SemiExpanded", sans-serif;
  font-size: 1em;
  cursor: pointer;
  /* Correção de Performance: Transição aplicada apenas aqui */
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn {
  background-color: var(--color2);
  color: var(--color1);
}

.btn-2 {
  background-color: var(--color1);
  color: var(--color2);
}

/* Otimização: Agrupando títulos idênticos */
h1,
h2 {
  font-size: 2.5em;
  font-weight: 500;
  text-transform: uppercase;
}

h3 {
  font-size: 1.5em;
  font-weight: 500;
  text-transform: uppercase;
}

p {
  font-family: "Nortura", sans-serif;
  font-size: 1em;
  font-weight: 500;
}

span {
  font-family: "Nortura-SemiExpanded", sans-serif;
  font-weight: 500;
  font-style: normal;
}

/* ====================================================== */
/* 4. SEÇÕES DA PÁGINA (Desktop-First Base)               */
/* ====================================================== */

/* --- header section --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99;
}

section {
  padding: 150px 0px;
  width: 100%;
}

.top-bar {
  background-color: var(--color2);
  display: flex;
  justify-content: center;
  flex-direction: row;
  color: var(--color1);
  padding: 1em 0;
  text-align: center;
  font-size: 0.9em;
}

/* --- home section --- */
.home-container {
  position: relative;
  min-height: 90vh;
  align-content: center;
  padding: 80px 0 60px 0;
  background: var(--color1);
  z-index: 12;
}
.home-content {
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 50px;
  width: 85%;
}

.box-text {
  max-width: 45%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.logo-home {
  position: relative;
  margin: 0px 0px 0px 0px;
  padding: 0;
  width: 15vw;
  height: auto;
  left: 0;
}

.box-text p {
  font-size: 1em;
  font-weight: 300;
}

.caixa-video {
  position: relative;
  width: 400px;
  height: 700px;
  overflow: hidden;
  border-radius: 10px;
}

.caixa-video video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play {
  width: 20%;
  height: 20%;
}

#playIconOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  font-size: 60px;
  color: white;
  background-color: #00000030;
  width: 100%;
  height: 100%;
  border-radius: 0%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-left: 10px;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  pointer-events: none;
}

#playIconOverlay.visible {
  opacity: 1;
}

.icon-play {
  width: 80px;
  height: 80px;
}

/* --- carousel section --- */
.carrossel-container {
  width: 100vw;
  overflow: hidden;
  padding: 40px 0;
  position: relative;
  border-top: 0.5px solid var(--color1);
  background: var(--color2);
  z-index: 11;
}

.carrossel {
  display: flex;
  width: max-content;
  animation: scroll 30s linear infinite;
}

.card {
  flex: 0 0 auto;
  background-color: var(--color1);
  color: var(--color2);
  border-radius: 8px;
  padding: 20px 20px;
  margin: 0 10px;
  display: flex;
  align-items: center;
  font-size: 0.8em;
  white-space: nowrap;
}

.card i {
  margin-right: 8px;
}

@keyframes scroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.card img {
  width: 22px;
  height: 22px;
  margin-right: 10px;
  object-fit: contain;
}

/* --- marcas section --- */
.marcas-container {
  display: flex;
  flex-direction: row;
  height: 70vh;
  justify-content: space-evenly;
  align-items: center;
  gap: 50px;
  padding: 80px 0;
  overflow-y: hidden;
  background: var(--color1);
  color: var(--color2);
  z-index: 10;
  overflow-x: hidden;
}

.marcas-content {
  max-width: 40%;
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  gap: 40px;
}

.marcas-content .btn {
  background: var(--color2);
  color: var(--color1);
}

.marcas-logos {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 20px;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.marcas-logos::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 125%;
  background: linear-gradient(
    180deg,
    #ffffff 05%,
    #ffffff00 20%,
    #ffffff00 80%,
    #ffffff 95%
  );
}

.marcas-collum1 {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: spin1-desktop 90s linear infinite;
}

/* Animação Desktop (Vertical) */
@keyframes spin1-desktop {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

.marcas-collum2 {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: spin2-desktop 90s linear infinite;
}

/* Animação Desktop (Vertical) */
@keyframes spin2-desktop {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100%);
  }
}

.cards-logo {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  border: 1px solid #e9e9e9;
  background: #f5f5f5;
  color: var(--color2);
  z-index: -1;
}

/* --- projetos section --- */
.projetos-container {
  width: 100%;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 50px;
  background-color: var(--color2);
  color: var(--color1);
  padding: 100px 0;
  overflow: hidden;
}

.carousel-box {
  width: 100%;
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 15%,
    black 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 15%,
    black 90%,
    transparent 100%
  );
}

.carousel-track {
  display: flex;
  width: calc(800px * 10); /* 10 slides de 800px */
  animation: scrollAnimationDesktop 30s linear infinite;
}

/* Animação Desktop */
@keyframes scrollAnimationDesktop {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-800px * 5)); /* 5 slides originais */
  }
}

.carousel-box:hover .carousel-track {
  animation-play-state: paused;
}

.carousel-slide {
  width: 800px; /* Largura Desktop */
  flex-shrink: 0;
  padding: 0 10px;
  box-sizing: border-box;
}

.carousel-slide img {
  width: 100%;
  border-radius: 8px;
  display: block;
  transition: transform 0.3s ease;
}

.carousel-slide img:hover {
  transform: scale(1.03);
}

/* --- tipos section --- */

.tipos-container {
  height: auto;
  padding: 120px 0;
  width: 100%;
  display: flex;
  gap: 60px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.tipos-content {
  max-width: 70%;
  text-align: center;
}

.tipo-card p {
  padding-top: 10px;
  font-size: 0.8em;
  font-weight: 300;
}

.tipos-cards {
  display: grid;
  width: 90%;
  grid-template-columns: repeat(2, 1fr); /* 2 colunas no Desktop */
  place-items: center;
  gap: 40px;
  z-index: 9;
}

.tipo-card {
  width: 90%;
  padding: 20px;
}

/* --- duvidas section --- */
.duvidas-container {
  width: 100%;
  min-height: 60vh;
  padding: 80px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--color1);
  text-align: center;
  z-index: 9;
}

.duvidas-accordion {
  max-width: 60%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0;
}

.duvida-item {
  width: 100%;
  background-color: black;
  border-radius: 8px;
  padding: 20px;
  cursor: pointer;
}

.duvidas-accordion .duvida-question {
  width: 100%;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1em;
  color: var(--color1);
  cursor: pointer;
}

.duvidas-accordion .duvida-question span {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duvida-answer {
  color: var(--color1);
  text-align: left;
  font-size: 0.9em;
  opacity: 0;
  height: 0;
  /* Transição movida para cá para funcionar ao abrir/fechar */
  transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease,
    padding 0.3s ease;
}

.duvida-answer.active {
  opacity: 1;
  height: auto; /* Altura automática */
  margin-top: 10px;
  padding: 10px 0;
}

/* --- footer section --- */
footer {
  width: 100%;
  min-height: 5vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0;
  background-color: var(--color2);
  color: var(--color1);
  text-align: center;
}

/* ====================================================== */
/* 5. MODAL POP-UP                                        */
/* ====================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.modal-overlay.visivel {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.modal-container {
  /* Correção de Bug: Posição relativa para o botão fechar */
  position: relative;
  background-color: #ffffff;
  padding: 2em;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  transform: translateY(20px);
  transition: transform 0.3s ease-out;
}

.modal-overlay.visivel .modal-container {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 1em;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  color: #000;
}

.fechar-btn {
  /* Correção de Bug: Posicionado relativo ao .modal-container */
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  font-size: 2.5em;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
}

.fechar-btn:hover {
  color: #000;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
  text-align: center;
  width: 100%;
}

.modal-body p {
  font-size: 1em;
  color: #495057;
  padding-top: 1em;
}

#contatoForm {
  width: 100%;
}

.form-campo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 1rem;
  width: 100%;
}

.form-campo label {
  display: block;
  text-align: left;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
}

.form-campo input,
.form-campo textarea {
  width: 100%;
  padding: 18px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.8em;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

/* O :focus-visible definido globalmente já cuida disso */
/* .form-campo input:focus, ... */

.input-select {
  border: solid 1px #ced4da;
  border-radius: 4px;
  font-size: 0.8em;
  padding: 18px;
  width: 100%;
}

.botao-submit {
  width: 100%;
  background-color: #000000;
  transition: background-color 0.2s;
}

.botao-submit:hover {
  background-color: #2e2e2e;
}

/* --- obrigado section --- */
.obrigado-container {
  position: relative;
  min-height: 95vh;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  gap: 50px;
  background: var(--color1);
  z-index: 12;
}

.box-obrigado {
  max-width: 80%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.box-obrigado p {
  font-size: 1.2em;
  font-weight: 300;
}

/* ====================================================== */
/* 6. CSS RESPONSIVO (Abordagem Desktop-First)            */
/* ====================================================== */

/* --- 6.1. Breakpoint 1: Tablets (Telas <= 1023px) --- */
@media (max-width: 1023px) {
  /* Ajusta larguras de conteúdo */
  .box-text,
  .marcas-content {
    max-width: 60%;
    align-items: center;
    text-align: center;
  }

  /* Faz o grid de "tipos" virar coluna única */
  .tipos-cards {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Ajusta larguras de conteúdo */
  .tipos-content,
  .duvidas-accordion {
    max-width: 80%;
  }
}

/* --- 6.2. Breakpoint 2: Mobile (Telas <= 767px) --- */
@media (max-width: 767px) {
  body {
    /* Fonte fluida para mobile */
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
  }

  h1,
  h2 {
    font-size: clamp(1.3em, 1.5em + 1vw, 2em);
    text-align: center;
  }

  h3 {
    font-size: clamp(1.1em, 1.3em + 0.5vw, 1.5em);
  }

  section {
    padding: clamp(60px, 50px + 5vw, 150px) 0px;
  }

  .projetos-container {
    padding: clamp(60px, 40px + 4vw, 100px) 0;
  }

  /* Botões maiores no mobile */
  .btn,
  .btn-2 {
    padding: 1.3em 22vw;
  }

  /* Layouts de seção empilhados */
  .home-container {
    width: 100%;
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding-top: 100px;
    gap: 30px;
    padding: 80px 0 80px 0;
  }

  /* Largura total para conteúdo */
  .box-text,
  .marcas-content,
  .tipos-content,
  .duvidas-accordion {
    max-width: 90%;
    align-items: center; /* Centraliza botão */
  }

  .box-text p {
    font-size: 1.1em;
  }

  .box-text {
    width: 100%;
  }

  .logo-home {
    width: 35vw;
  }

  .home-content {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 50px;
    width: 100%;
  }

  .caixa-video {
    width: 90%;
    height: 600px;
  }

  /* --- Sessão Marcas (Mobile) --- */
  .marcas-container {
    height: 90vh;
    gap: 0px;
    padding: 60px 0;
  }

  .marcas-content {
    justify-content: center;
  }

  /* No mobile, os logos rolam na horizontal */
  .marcas-logos {
    flex-direction: column; /* Colunas de logos se tornam "linhas" */
    height: auto;
    width: 100%;
    gap: 20px;
    padding: 0;
  }

  .marcas-logos::after {
    /* Gradiente horizontal */
    height: 100%;
    width: 125%;
    background: linear-gradient(
      90deg,
      #ffffff 05%,
      #ffffff00 20%,
      #ffffff00 80%,
      #ffffff 95%
    );
  }

  .marcas-collum1 {
    flex-direction: row; /* Vira linha */
    gap: 20px;
    animation-name: spin1-mobile; /* Muda para a animação mobile */
  }

  /* Animação Mobile (Horizontal) */
  @keyframes spin1-mobile {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(-100%);
    }
  }

  .marcas-collum2 {
    flex-direction: row; /* Vira linha */
    gap: 20px;
    animation-name: spin2-mobile; /* Muda para a animação mobile */
  }

  /* Animação Mobile (Horizontal) */
  @keyframes spin2-mobile {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(100%);
    }
  }

  /* --- Sessão Projetos (Mobile) --- */
  .carousel-box {
    /* Fade mais curto para telas menores */
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 5%,
      black 95%,
      transparent 100%
    );
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      black 5%,
      black 95%,
      transparent 100%
    );
  }

  /* Ajusta o carrossel para slides menores */
  .carousel-slide {
    width: 350px; /* Largura do slide no mobile */
  }

  .carousel-track {
    width: calc(350px * 10); /* 10 slides * 350px */
    animation-name: scrollAnimationMobile; /* Muda para animação mobile */
  }

  /* Animação Mobile */
  @keyframes scrollAnimationMobile {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(calc(-350px * 5)); /* 5 slides originais */
    }
  }

  /* --- Sessão Tipos (Mobile) --- */
  .tipos-container {
    min-height: 50vh;
    height: auto;
    padding: 80px 0;
    gap: 40px;
  }

  .tipos-cards {
    display: grid;
    grid-template-columns: 1fr; /* Já definido no breakpoint de tablet, mas garantido aqui */
    width: 90%;
    gap: 30px;
    z-index: 0;
  }

  .tipo-card {
    width: 100%;
    text-align: center;
  }
}
