/* ==========================================================================
   TUPÃ EX - PÁGINA DE SOLUÇÃO ESPECÍFICA (INSTOR ROBÓTICA)
   Estilos estritamente fiéis ao Figma (Node 68:17145)
   Design System Instor - 100% Nativo CSS3 (Sem animações inventadas)
   ========================================================================== */

/* Variáveis de Cores Exatas do Figma */
:root {
  --tupa-primary: #4c662b;
  --tupa-primary-light: #7eac26;
  --tupa-secondary-container: #dce7c7;
  --tupa-on-secondary-container: #404a33;
  --tupa-outline-variant: #c5c8ba;
  --tupa-surface-low: #f8fdf2;
  --tupa-video-bg: #d8d8d8;
  --tupa-black: #000000;
  --tupa-white: #ffffff;
}

/* --------------------------------------------------------------------------
   Hero Section (Figma Node 68:17192)
   Background: #000000 puro com overlay de 70%
   -------------------------------------------------------------------------- */
.tupa-hero-section {
  position: relative;
  background-color: var(--tupa-black);
  color: var(--tupa-white);
  padding: 56px 0 60px;
  min-height: 419px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.tupa-hero-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--tupa-black);
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

.tupa-hero-container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  width: 100%;
  box-sizing: border-box;
}

.tupa-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tupa-hero-bar {
  width: 87px;
  height: 5px;
  background-color: var(--tupa-primary-light);
  margin-bottom: 24px;
}

.tupa-hero-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 52px;
  color: var(--tupa-white);
  margin: 0 0 8px 0;
}

.tupa-hero-subtitle {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 52px;
  color: var(--tupa-primary-light);
  margin: 0 0 16px 0;
}

.tupa-hero-desc {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 20px;
  line-height: 1.4;
  color: var(--tupa-white);
  margin: 0;
  max-width: 644px;
}

.tupa-hero-desc p {
  margin: 0 0 6px 0;
}

.tupa-hero-desc p:last-child {
  margin-bottom: 0;
}

.tupa-hero-visual {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.tupa-hero-visual img {
  width: 100%;
  max-width: 638px;
  height: auto;
  max-height: 447px;
  object-fit: cover;
  display: block;
}

/* --------------------------------------------------------------------------
   Main Content Area (Figma Node 68:17206 & 68:17207)
   Background 100% Branco Puro (#ffffff)
   -------------------------------------------------------------------------- */
.tupa-main-content {
  background-color: var(--tupa-white);
  padding: 40px 0;
}

.tupa-content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Grade de Recursos Tecnológicos (Technology Features - Figma 68:17208)
   -------------------------------------------------------------------------- */
.tupa-tech-grid {
  display: grid;
  grid-template-columns: 530px 1fr;
  gap: 24px;
  align-items: stretch;
  padding: 40px 0;
}

.tupa-tech-cards-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.tupa-feature-card {
  background-color: var(--tupa-white);
  border: 1px solid var(--tupa-outline-variant);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  box-sizing: border-box;
  overflow: hidden;
}

.tupa-tech-grid .tupa-tech-cards-col .tupa-feature-card {
  height: 248px;
  min-height: 248px;
}

.tupa-feature-card.tinted {
  background-color: var(--tupa-secondary-container);
}

.tupa-feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tupa-feature-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tupa-feature-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--tupa-on-secondary-container);
  letter-spacing: -0.25px;
  margin: 0;
}

.tupa-feature-list {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 18px;
  line-height: normal;
  color: var(--tupa-on-secondary-container);
  letter-spacing: -0.25px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tupa-feature-list p,
.tupa-feature-list li {
  margin: 0 0 2px 0;
}

.tupa-feature-list .gas-types {
  font-weight: 700;
}

/* Coluna Direita: Certificação & Imagem Técnica do Robô */
.tupa-tech-spec-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.tupa-cert-card {
  background-color: var(--tupa-white);
  border: 1px solid var(--tupa-outline-variant);
  border-radius: 20px;
  padding: 16px;
  height: 248px;
  min-height: 248px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  overflow: hidden;
}

.tupa-cert-badge {
  width: 114px;
  height: 100px;
  object-fit: cover;
  display: block;
}

.tupa-cert-code {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--tupa-on-secondary-container);
  letter-spacing: -0.25px;
  margin: 0;
  line-height: normal;
}

.tupa-spec-robot-wrap {
  width: 100%;
  height: 484px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tupa-spec-robot-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* --------------------------------------------------------------------------
   Seção de Vídeos (Figma Node 68:17488)
   Background dos cards: #d8d8d8 estrito conforme Figma
   -------------------------------------------------------------------------- */
.tupa-videos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 40px 0;
  width: 100%;
  box-sizing: border-box;
}

.tupa-video-box {
  background-color: var(--tupa-video-bg);
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tupa-video-box iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --------------------------------------------------------------------------
   Linhas Alternadas de Funcionalidades (Figma Nodes 69:18702 até 70:18809)
   Detecção de Corrosão, Mapeamento 3D, IA, Vazamento
   -------------------------------------------------------------------------- */
.tupa-row-container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 40px 0;
  width: 100%;
  box-sizing: border-box;
}

.tupa-row-media {
  width: 600px;
  height: 450px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.tupa-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
}

.tupa-row-media-tall {
  width: 600px;
  height: 489px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.tupa-row-media-tall img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
}

.tupa-row-media-clean {
  flex: 1 1 0;
  height: 447px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tupa-row-media-clean img {
  max-width: 638px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tupa-row-text {
  flex: 1 1 0;
  background-color: var(--tupa-white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
}

.tupa-row-heading {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 48px;
  font-weight: 900;
  line-height: 62.4px;
  color: var(--tupa-primary);
  margin: 0;
}

.tupa-row-desc {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 20px;
  line-height: normal;
  color: var(--tupa-black);
  margin: 0;
}

.tupa-row-desc p {
  margin: 0 0 4px 0;
}

.tupa-row-desc p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Carrossel de Imagens (Figma Node 68:17271 com estrutura de caldeiras)
   -------------------------------------------------------------------------- */
.tupa-carrossel-section {
  background-color: var(--tupa-white);
  padding: 40px 0;
  width: 100%;
}

.instor-carrossel-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  box-sizing: border-box;
  gap: 24px;
  text-align: center;
}

.instor-carrossel-viewport {
  width: 100%;
  position: relative;
}

.instor-carrossel-track {
  display: flex;
  gap: 20px;
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 16px 12%;
  box-sizing: border-box;
  scrollbar-width: none;
}

.instor-carrossel-track::-webkit-scrollbar {
  display: none;
}

.instor-carrossel-slide {
  flex: 0 0 76%;
  height: 480px;
  background-color: var(--tupa-secondary-container);
  scroll-snap-align: center;
  border-radius: 20px;
  border: 1px solid var(--tupa-outline-variant);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.instor-carrossel-slide.active {
  opacity: 1;
}

.instor-carrossel-img {
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover !important;
  object-position: center;
  display: block;
}

.instor-carrossel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--tupa-outline-variant);
  color: var(--tupa-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease, color 0.2s ease;
  z-index: 10;
  user-select: none;
}

.instor-carrossel-arrow:hover {
  background-color: var(--tupa-primary);
  color: var(--tupa-white);
}

.instor-carrossel-arrow.prev {
  left: 16px;
}

.instor-carrossel-arrow.next {
  right: 16px;
}

.instor-carrossel-arrow i {
  font-size: 20px;
}

.instor-carrossel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.instor-carrossel-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--tupa-outline-variant);
  cursor: pointer;
  transition: background-color 0.3s ease, width 0.3s ease, border-radius 0.3s ease;
}

.instor-carrossel-dot.active {
  background-color: var(--tupa-primary);
  width: 36px;
  border-radius: 12px;
}

/* Lightbox Modal */
.instor-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 24px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.instor-lightbox-overlay.open {
  display: flex;
  opacity: 1;
}

.instor-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.instor-lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
}

.instor-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  color: var(--tupa-white);
  font-size: 36px;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Seção Petrobras (Figma Node 68:17300)
   Background: #f8fdf2 estrito conforme Figma
   -------------------------------------------------------------------------- */
.tupa-parceria-section {
  background-color: var(--tupa-surface-low);
  padding: 40px 0;
  width: 100%;
}

.tupa-parceria-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.tupa-parceria-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 41.6px;
  color: var(--tupa-black);
  margin: 0;
}

.tupa-parceria-logo {
  width: 151px;
  height: 151px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tupa-parceria-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* --------------------------------------------------------------------------
   Call To Action (Figma Node 68:17304)
   Container background: #ffffff | Card background: #dce7c7
   -------------------------------------------------------------------------- */
.tupa-cta-section {
  background-color: var(--tupa-white);
  padding: 40px 0;
  width: 100%;
}

.tupa-cta-card {
  background-color: var(--tupa-secondary-container);
  border: 1px solid var(--tupa-outline-variant);
  border-radius: 20px;
  padding: 40px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}

.tupa-cta-title {
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--tupa-on-secondary-container);
  letter-spacing: -0.25px;
  line-height: normal;
  margin: 0;
  max-width: 744px;
}

.tupa-cta-card .instor-btn,
.tupa-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  background-color: var(--tupa-primary);
  color: var(--tupa-white);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border-radius: 16px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.15px;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tupa-cta-card .instor-btn:hover,
.tupa-cta-btn:hover {
  background-color: #3d5222;
  color: var(--tupa-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 102, 43, 0.3);
}

.tupa-cta-card .instor-btn:active,
.tupa-cta-btn:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsividade Mobile & Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .tupa-hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .tupa-hero-content {
    align-items: center;
  }

  .tupa-hero-bar {
    margin: 0 auto 24px;
  }

  .tupa-hero-visual {
    justify-content: center;
  }

  .tupa-tech-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 0;
  }

  .tupa-tech-spec-col {
    order: -1;
    gap: 12px;
    width: 100%;
    margin-bottom: 8px;
  }

  .tupa-cert-card {
    height: auto;
    min-height: auto;
    padding: 20px 16px;
    gap: 12px;
  }

  .tupa-cert-badge {
    width: 90px;
    height: 80px;
  }

  .tupa-cert-code {
    font-size: 26px;
  }

  .tupa-spec-robot-wrap {
    height: auto;
    min-height: auto;
    padding: 0;
    margin: 0;
  }

  .tupa-spec-robot-wrap img {
    height: auto;
    max-height: 280px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
  }

  .tupa-videos-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .tupa-video-box {
    aspect-ratio: 16 / 9;
    width: 100%;
    padding: 0;
  }

  .tupa-row-container {
    flex-direction: column;
  }

  .tupa-row-container.reverse {
    flex-direction: column;
  }

  .tupa-row-media,
  .tupa-row-media-tall {
    width: 100%;
    height: 360px;
  }

  .tupa-row-media-clean {
    width: 100%;
    height: auto;
  }

  .tupa-cta-card {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }

  .instor-carrossel-slide {
    flex: 0 0 84%;
    height: 380px;
  }

  .instor-carrossel-track {
    padding: 12px 8%;
  }
}

@media (max-width: 768px) {
  .tupa-hero-title {
    font-size: 36px;
    line-height: 42px;
  }

  .tupa-hero-subtitle {
    font-size: 24px;
    line-height: 32px;
  }

  .tupa-hero-desc {
    font-size: 17px;
  }

  .tupa-cert-code {
    font-size: 22px;
  }

  .tupa-cert-badge {
    width: 80px;
    height: 70px;
  }

  .tupa-spec-robot-wrap img {
    max-height: 220px;
  }

  .tupa-row-heading {
    font-size: 32px;
    line-height: 40px;
  }

  .tupa-row-desc {
    font-size: 17px;
  }

  .tupa-parceria-title {
    font-size: 24px;
    line-height: 32px;
  }

  .tupa-cta-title {
    font-size: 24px;
  }

  .tupa-cta-card .instor-btn,
  .tupa-cta-btn {
    width: 100%;
  }

  .instor-carrossel-slide {
    flex: 0 0 92%;
    height: 280px;
  }

  .instor-carrossel-track {
    padding: 10px 4%;
  }

  .instor-carrossel-arrow {
    display: none;
  }
}
