@layer variables, base, components, utilities;

@layer variables {
  :root {
    --color-primary: #3cb371;
    --color-secondary: #1e90ff;
    --color-accent: #ffa500;
    --color-text: #333333;
    --color-background: #ffffff;
    --font-primary: "Open Sans", sans-serif;
    --font-secondary: "Pacifico", cursive;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  }
}

@layer base {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    scroll-behavior: smooth;
  }

  section:not(#hero) {
    clip-path: polygon(0 0, 100% 3%, 100% 100%, 0 97%);
  }

  h1,
  h2,
  h3 {
    font-weight: 700;
    line-height: 1.2;
  }
  h2 {
    text-align: center;
    color: var(--color-primary);
    text-transform: uppercase;

    &.bg-green {
      color: var(--color-background);
    }
  }

  a {
    text-decoration: none;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
  }

  .cta {
    display: flex;
    align-items: center;
    margin-top: 50px;
  }

  .cta-button {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-background);
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    &:hover {
      transform: translateY(-3px);
      box-shadow: 9px 9px 15px #d9d9d9, -9px -9px 15px #ffffff;
    }

    &.bg-green:hover {
      transform: translateY(-3px);
      box-shadow: none;
    }
  }
}

@layer components {
  header {
    background-color: var(--color-background);
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;

    & nav {
      height: 70px;
      display: flex;
      justify-content: space-around;
      align-items: center;

      & .logo {
        height: 40px;
      }

      & ul {
        display: flex;
        gap: 2rem;
        list-style: none;

        & li {
          & a {
            color: #000;
            font-weight: 600;
            transition: color 0.3s ease;

            &:hover {
              color: var(--color-accent);
            }
          }
        }
      }
    }
  }

  #hero {
    background: linear-gradient(
        0deg,
        rgba(60, 179, 113, 0.5) 53%,
        rgba(112, 177, 141, 0.5) 93%
      ),
      url("../img/image\ 8.jpg") center/cover no-repeat;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--color-background);

    & h1 {
      font-size: 3rem;
      margin-bottom: 1rem;
    }

    & h2 {
      font-size: 1.5rem;
      margin-bottom: 2rem;
    }

    .cta-button {
      margin-top: 30px !important;
    }
  }
}

#sobre {
  padding: 5rem 0;
  text-align: center;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  justify-items: center;

  & .img {
    width: 100%;

    & .profile-image {
      width: 300px;
      border-radius: 0.8rem;
      margin-bottom: 2rem;
    }
  }

  & .bio {
    width: 70%;
    text-align: left;

    & h2 {
      margin-bottom: 1rem;
    }

    & .credentials {
      list-style: none;
      margin: 2rem 0;

      & li {
        margin-bottom: 0.5rem;
        list-style: disc;
        margin-left: 1.5rem;
      }
    }
  }
}

#servicos {
  background-color: var(--color-primary);
  padding: 5rem 0;

  & .service-grid {
    width: 90%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    justify-self: center;
  }

  & .service-card {
    background-color: var(--color-background);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease;

    &:hover {
      transform: translateY(-5px);
    }

    & img {
      width: 80px;
      margin-bottom: 1rem;
    }

    & h3 {
      margin-bottom: 1rem;
    }

    & p {
      margin-bottom: 1.5rem;
    }
  }
}

#metodologia {
  padding: 5rem 0;

  & ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 2rem 0;
    list-style: none;
    text-align: center;

    & li {
      width: 250px;
      height: 140px;
      padding: 20px;
      border-radius: 10px;
      background: #ffffff;
      box-shadow: 9px 9px 25px #d9d9d9, -9px -9px 25px #ffffff;
      transition: transform 0.3s ease;

      &:hover {
        transform: translateY(-5px);
      }

      .step-number {
        width: 40px;
        height: 40px;
        margin: 0 auto 10px;
        border-radius: 50%;
        background-color: var(--color-primary);
        color: var(--color-background);
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: 600;
      }
    }
  }

  h3 {
    margin-top: 60px;
    text-align: center;
    color: var(--color-primary);
  }
}

#resultados {
  background-color: var(--color-primary);
  padding: 5rem 0;

  & .results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    justify-self: center;
    margin-top: 3rem;
  }

  & .result-card {
    width: 500px;
    background-color: var(--color-background);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    overflow: hidden;

    & img {
      width: 100%;
      height: 200px;
      object-fit: cover;
    }

    & p {
      padding: 1rem;
      font-style: italic;
    }

    & span {
      display: block;
      padding: 0 1rem 1rem;
      font-weight: 600;
    }
  }
}

#depoimentos {
  padding: 5rem 0;

  & .testimonial-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
  }

  & .testimonial {
    flex: 0 0 300px;
    scroll-snap-align: start;
    background: #ffffff;
    box-shadow: 9px 9px 18px #d9d9d9, -9px -9px 18px #ffffff;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;

    & img {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      margin-bottom: 1rem;
    }

    & p {
      font-style: italic;
      margin-bottom: 1rem;
    }

    & span {
      font-weight: 600;
    }
  }
}

#parcerias {
  background-color: var(--color-primary);
  padding: 5rem 0;

  & .partners-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 3rem;

    & img {
      height: 150px;
      filter: grayscale(100%);
      transition: filter 0.3s ease;

      &:hover {
        filter: grayscale(0%);
      }
    }
  }
}

#blog {
  padding: 5rem 0;

  & .blog-posts {
    max-width: 1280px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    justify-self: center;
    gap: 2rem;
    margin-top: 3rem;
  }

  & article {
    background: #ffffff;
    box-shadow: 9px 9px 18px #d9d9d9, -9px -9px 18px #ffffff;
    border-radius: 10px;
    padding: 2rem;

    & h3 {
      margin-bottom: 1rem;
    }

    & p {
      margin-bottom: 1rem;
    }

    & a {
      font-weight: 600;
      color: var(--color-secondary);
    }
  }
}

#faq {
  background-color: var(--color-primary);
  padding: 5rem 0;

  & .faq-list {
    max-width: 800px;
    margin: 3rem auto 0;

    & details {
      background-color: var(--color-background);
      border-radius: 8px;
      padding: 1rem;
      margin-bottom: 1rem;
      cursor: pointer;

      & summary {
        font-weight: 600;
      }

      & p {
        margin-top: 1rem;
      }
    }
  }
}

#contato {
  padding: 5rem 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  justify-items: center;
  align-items: end;

  & form {
    background-color: var(--color-primary);
    width: 600px;
    display: grid;
    gap: 1rem;
    padding: 2rem;
    border-radius: 10px;

    & input,
    & select {
      width: 100%;
      padding: 0.8rem;
      border: 1px solid #ddd;
      border-radius: 5px;
    }

    & textarea {
      height: 150px;
    }

    & button {
      justify-self: start;
      margin-top: 10px;
      width: 100%;
      border: none;
    }
  }

  & .contact-info {
    h2 {
      font-size: 42px;
      text-align: left;
      margin-bottom: 10px;
    }
    text-align: left;
    margin-top: 3rem;

    & ul {
      font-size: 26px;
      margin-bottom: 0.5rem;
      list-style: none;
      li {
        margin-top: 5px;
        display: flex;
        gap: 5px;
        align-items: center;
      }
    }
  }
}

footer {
  background-color: var(--color-primary);
  color: var(--color-background);
  padding: 3rem 0 1rem;

  & .footer-content {
    max-width: 1280px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-self: center;
    gap: 2rem;
    padding-bottom: 2rem;
    margin: auto;
  }

  a {
    color: var(--color-background);
    font-size: 1rem;
  }

  & .footer-logo {
    img {
      width: 250px;
    }

    li {
      width: 250px;
      display: flex;
      justify-content: center;
      gap: 0.5rem;
      margin-top: 0.5rem;
      a > i {
        font-size: 2rem;
      }
    }
  }

  & .footer-links,
  & .contact {
    h3 {
      margin: 0 0 0.5rem 0;
    }

    li {
      margin-bottom: 0.2rem;
    }
  }

  .contact {
    list-style: none;
  }

  .footer-links li {
    margin-left: 1.1rem;
  }

  & p {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
  }
}

@layer utilities {
  /* Tablets e telas médias */
  @media (max-width: 1024px) {
    .container {
      padding: 20px;
    }

    #sobre {
      grid-template-columns: 1fr;
      gap: 2rem;

      & .bio {
        width: 90%;
        text-align: center;

        & .credentials {
          display: grid;
          grid-template-columns: repeat(2, 1fr);
          gap: 1rem;
        }
      }
    }

    #metodologia {
      & ul {
        flex-wrap: wrap;

        & li {
          width: calc(50% - 20px);
        }
      }
    }

    #resultados {
      & .results-grid {
        grid-template-columns: 1fr;

        & .result-card {
          width: 100%;
          max-width: 500px;
          margin: 0 auto;
        }
      }
    }

    #blog {
      & .blog-posts {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    #contato {
      grid-template-columns: 1fr;
      gap: 3rem;

      & form {
        width: 90%;
        max-width: 600px;
      }

      & .contact-info {
        text-align: center;

        & h2 {
          text-align: center;
        }
      }
    }

    footer {
      & .footer-content {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px;

        & .footer-logo {
          grid-column: 1 / -1;
          justify-self: center;
          text-align: center;
        }
      }
    }
  }

  /* Dispositivos móveis */
  @media (max-width: 768px) {
    header {
      & nav {
        height: auto;
        padding: 1rem;

        & ul {
          display: none;
        }
      }
    }

    #hero {
      padding: 0 20px;

      & h1 {
        font-size: 2rem;
      }

      & h2 {
        font-size: 1.2rem;
      }
    }

    #sobre {
      grid-template-columns: 1fr !important;
      & .img {
        & .profile-image {
          width: 80%;
          max-width: 300px;
        }
      }
    }

    #servicos {
      & .service-grid {
        width: 100%;
        grid-template-columns: 1fr;
      }
    }

    #metodologia {
      & ul {
        flex-direction: column;

        & li {
          width: 100%;
          max-width: 300px;
        }
      }
    }

    #resultados {
      & .results-grid {
        grid-template-columns: 1fr !important;

        & .result-card {
          width: 100%;
          max-width: 500px;
          margin: 0 auto;
        }
      }
    }

    #depoimentos {
      & .testimonial-carousel {
        flex-direction: column;
        gap: 1.5rem;

        & .testimonial {
          width: 90%;
          margin: 0 auto;
        }
      }
    }

    #parcerias {
      & .partners-grid {
        & img {
          height: 100px;
        }
      }
    }

    #blog {
      & .blog-posts {
        grid-template-columns: 1fr !important;
      }
    }

    #contato {
      padding-left: 1rem;
      grid-template-columns: 1fr !important;
      & form {
        width: 90% !important;
        max-width: 600px;
      }

      .contact-info {
        h2 {
          font-size: 28px !important;
        }
        text-align: left;
        margin-top: 3rem;

        & ul {
          font-size: 18px !important;
          margin-bottom: 0.5rem;
          list-style: none;
          li {
            margin-top: 5px;
            display: flex;
            gap: 5px;
            align-items: center;
          }
        }
      }
    }

    #faq {
      & .faq-list {
        width: 90%;
      }
    }

    footer {
      & .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        justify-items: center;

        & .footer-links,
        & .contact {
          & ul {
            display: flex;
            flex-direction: column;
            align-items: center;
          }
        }

        & .footer-links li {
          margin-left: 0;
        }
      }
    }
  }

  /* Dispositivos móveis pequenos */
  @media (max-width: 480px) {
    #hero {
      & h1 {
        font-size: 1.8rem;
      }

      & h2 {
        font-size: 1rem;
      }
    }

    #sobre {
      & .bio {
        width: 95%;
      }
    }

    #contato {
      & .contact-info {
        & h2 {
          font-size: 32px;
        }

        & ul {
          font-size: 20px;
        }
      }

      & form {
        width: 95%;
      }
    }

    footer {
      & .footer-logo {
        & img {
          width: 200px;
        }
      }
    }
  }
}
