/* =================================================================
   DESIGN SYSTEM FINETIPS — Layout Components
   Arquivo: layout-components.css
   Descrição: Estilos para componentes de layout: Menu Header,
              Footer e Stats Section — suporta light e dark mode.
   ================================================================= */

/* ---- Bloco de Preview ---- */
.component-preview-block {
  margin-bottom: var(--spacing-lg);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(65, 86, 123, 0.2);
  background-color: #F8FAFC;
  overflow: hidden;
}

body.dark-mode .component-preview-block {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: #102363;
}

/* ---- Stats Preview ---- */
.layout-stats-preview .layout-stats-inner {
  border-radius: var(--radius-lg);
}

.component-mode-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
}

/* =================================================================
   MENU HEADER
   ================================================================= */

.btn-primary-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 37px;
  padding: 0 28px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFFFFF;
  background-color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary-demo:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-primary-demo:active {
  background-color: var(--primary-pressed);
  border-color: var(--primary-pressed);
  transform: scale(0.97);
}

/* ---- Menu Header — Light Mode ---- */
.layout-header-inner {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  padding: var(--spacing-md) var(--spacing-xl);
  background-color: #F8FAFC;
  position: relative;
}

.layout-header-inner::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: var(--active-indicator-left, 0);
  width: var(--active-indicator-width, 0);
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 1px;
  transition: left var(--transition-fast), width var(--transition-fast);
}

.layout-header-logo {
  height: 24px;
  width: auto;
  flex-shrink: 0;
}

.layout-header-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  flex: 1;
  justify-content: center;
}

.layout-header-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748B;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.layout-header-link:hover {
  color: var(--primary-color);
}

.layout-header-link.is-active {
  color: var(--primary-color);
  font-weight: 600;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* ---- Menu Header — Dark Mode ---- */
body.dark-mode .layout-header-inner {
  background-color: #102363;
}

body.dark-mode .layout-header-link {
  color: #FFFFFF;
}

body.dark-mode .layout-header-link:hover {
  color: var(--primary-color);
}

/* =================================================================
   FOOTER
   ================================================================= */

/* ---- Footer — Light Mode ---- */
.layout-footer-inner {
  padding: var(--spacing-xl);
  background-color: #222D4C;
}

.layout-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.layout-footer-logo {
  height: 24px;
  width: auto;
}

.layout-footer-contact {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.75rem;
  color: #FFFFFF;
}

.layout-footer-social {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.layout-footer-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--primary-color);
  transition: background-color var(--transition-fast);
}

.layout-footer-social-icon:hover {
  background-color: var(--primary-light);
}

.layout-footer-social-icon img {
  width: 24px;
  height: 24px;
}

/* ---- Grupo esquerdo: logo + contato + social ---- */
.layout-footer-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

/* ---- Toggle de tema Sol/Lua ---- */
.layout-footer-theme {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.layout-footer-theme-icon {
  width: 18px;
  height: 18px;
  color: #94A3B8;
}

.layout-footer-theme-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: var(--primary-color);
  border-radius: 999px;
}

.layout-footer-theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background-color: #FFFFFF;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

body.dark-mode .layout-footer-theme-knob {
  transform: translateX(20px);
}

.layout-footer-divider {
  height: 1px;
  margin: var(--spacing-lg) 0;
  background-color: rgba(255, 255, 255, 0.2);
}

.layout-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  font-size: 0.75rem;
}

.layout-footer-copy {
  color: #FFFFFF;
}

.layout-footer-legal {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.layout-footer-legal a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  transition: color var(--transition-fast);
}

.layout-footer-legal a:hover {
  color: var(--primary-hover);
}

.layout-footer-legal span {
  color: rgba(255, 255, 255, 0.5);
}

/* ---- Footer — Dark Mode ---- */
body.dark-mode .layout-footer-inner {
  background-color: #222D4C;
}

body.dark-mode .layout-footer-contact {
  color: #FFFFFF;
}

body.dark-mode .layout-footer-divider {
  background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .layout-footer-copy {
  color: #FFFFFF;
}

body.dark-mode .layout-footer-legal span {
  color: rgba(255, 255, 255, 0.5);
}

/* =================================================================
   STATS SECTION
   ================================================================= */

/* ---- Stats — Light Mode ---- */
.layout-stats-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 40px 40px;
  text-align: center;
  background-color: transparent;
  border-radius: var(--radius-lg);
}

.layout-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--spacing-md);
  border-right: 1px solid rgba(65, 86, 123, 0.2);
}

.layout-stat-item:last-child {
  border-right: none;
}

.layout-stat-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 64px;
  line-height: 1.2;
  color: #FF5D00;
}

.layout-stat-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: #64748B;
  white-space: nowrap;
}

/* ---- Stats Icon ---- */
.layout-stat-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--spacing-sm);
}

/* ---- Stats Text + Icon ---- */
.layout-stat-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: #0F172A;
  margin-top: var(--spacing-xs);
}

.layout-stat-divider {
  width: 40px;
  height: 3px;
  background-color: var(--primary-color);
  margin: var(--spacing-md) 0;
  border-radius: 2px;
}

.layout-stat-description {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: #0f172ab8;
  line-height: 1.5;
  max-width: 300px;
}

/* ---- Stats Text Variant ---- */
.layout-stats-text .layout-stat-item {
  justify-content: center;
}

/* ---- Stats Icon Variant ---- */
.layout-stats-icon .layout-stat-number {
  margin-top: var(--spacing-xs);
}

/* ---- Stats Text + Icon Variant ---- */
.layout-stats-text-icon {
  padding: var(--spacing-3xl) 0;
}

.layout-stats-text-icon .layout-stat-item {
  padding: 0;
}

/* ---- Stats — Dark Mode ---- */
body.dark-mode .layout-stats-inner {
  background-color: transparent;
}

body.dark-mode .layout-stat-item {
  border-right-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .layout-stat-label {
  color: #FFFFFF;
}

body.dark-mode .layout-stat-title {
  color: #FFFFFF;
}

body.dark-mode .layout-stat-description {
  color: rgba(255, 255, 255, 0.72);
}

body.dark-mode .layout-stat-number {
  color: #FF5D00;
}

/* ---- Stats — Light Mode override ---- */
body:not(.dark-mode) .layout-stat-label {
  color: #0F172A;
}

body:not(.dark-mode) .layout-stat-title {
  color: #0F172A;
}

body:not(.dark-mode) .layout-stat-description {
  color: #0f172ab8;
}

body:not(.dark-mode) .layout-stat-icon {
  color: #FF5D00;
}

body:not(.dark-mode) .layout-stat-number {
  color: #FF5D00;
}

/* =================================================================
   RESPONSIVO
   ================================================================= */

@media (max-width: 768px) {
  .layout-header-nav {
    display: none;
  }

  .layout-header-inner {
    justify-content: space-between;
  }

  .layout-footer-top,
  .layout-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  /* Linha 1: logo sozinho | Linha 2: e-mail + redes | Linha 3: toggle */
  .layout-footer-left {
    flex-wrap: wrap;
    width: 100%;
    gap: var(--spacing-md);
  }

  .layout-footer-logo {
    flex: 0 0 100%;
  }

  .layout-footer-contact {
    font-size: 0.8125rem;
  }

  .layout-stats-inner {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .layout-stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(65, 86, 123, 0.2);
    padding-bottom: var(--spacing-xl);
  }

  .layout-stat-item:last-child {
    border-bottom: none;
  }

  .layout-stat-number {
    font-size: 1.5rem;
  }

  .layout-stats-text-icon .layout-stat-item {
    padding: 0 var(--spacing-md) var(--spacing-xl);
  }
}

/* =================================================================
   CTA SECTION
   ================================================================= */

/* ---- CTA Base ---- */
.cta-section {
  position: relative;
  padding: var(--spacing-2xl) var(--spacing-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cta-tag {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-md);
  background-color: rgba(255, 93, 0, 0.15);
  color: var(--primary-color);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
}

.cta-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 24px;
  line-height: 1.4;
}

.cta-highlight {
  color: var(--primary-color);
}

.cta-description {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--spacing-md);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ---- CTA Simples ---- */
.cta-simple .cta-description {
  max-width: 400px;
}

/* ---- CTA com Imagem no Fundo ---- */
.cta-bg-image .cta-description {
  max-width: 400px;
}

.cta-button {
  display: inline-block;
  padding: 10px 28px;
  background-color: var(--primary-color);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.cta-button:hover {
  background-color: var(--primary-hover);
  color: #FFFFFF;
}

/* ---- CTA Simples ---- */
.cta-simple {
  background: linear-gradient(135deg, #0A1628 0%, #102363 100%);
}

/* ---- CTA com Imagem no Fundo ---- */
.cta-bg-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cta-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 22, 40, 0.85) 0%, rgba(16, 35, 99, 0.75) 100%);
  z-index: 1;
}

.cta-content {
  position: relative;
  z-index: 2;
}

/* ---- CTA com Imagem na Direita ---- */
.cta-right-image {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: linear-gradient(135deg, #0A1628 0%, #102363 50%, #FF5D00 100%);
  text-align: left;
  padding: 0;
  min-height: 200px;
  overflow: hidden;
}

.cta-right-image .cta-content {
  flex: 1;
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.cta-right-image .cta-tag {
  display: inline-block;
  width: auto;
}

.cta-right-image .cta-description {
  margin-left: 0;
  margin-right: 0;
}

.cta-right-image .cta-button {
  display: inline-block;
  width: auto;
}

.cta-right-image .cta-image-wrapper {
  flex-shrink: 0;
  width: 260px;
  height: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cta-right-image .cta-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: bottom center;
  vertical-align: bottom;
  line-height: 0;
}

.cta-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ---- CTA com Imagem Vazada ---- */
.cta-cutout-image {
  background: linear-gradient(135deg, #0A1628 0%, #102363 50%, #FF5D00 100%);
  text-align: left;
  padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-xl) 16px;
  padding-right: 280px;
  min-height: 300px;
  position: relative;
  overflow: visible;
  width: 100%;
}

.cta-cutout-image .cta-content {
  position: relative;
  z-index: 2;
}

.cta-cutout-image .cta-image-wrapper {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 320px;
  height: 350px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  z-index: 1;
  overflow: visible;
}

.cta-cutout-image .cta-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom right;
  transform: translateY(20px);
}

/* Permitir overflow no component-preview-block para este card */
.component-preview-block:has(.cta-cutout-image) {
  overflow: visible;
}

/* ---- CTA — Dark Mode ---- */
body.dark-mode .cta-simple {
  background: linear-gradient(135deg, #050E30 0%, #081648 100%);
}

body.dark-mode .cta-bg-image .cta-overlay {
  background: linear-gradient(135deg, rgba(5, 14, 48, 0.9) 0%, rgba(8, 22, 72, 0.8) 100%);
}

body.dark-mode .cta-right-image {
  background: linear-gradient(135deg, #050E30 0%, #081648 50%, #FF5D00 100%);
}

body.dark-mode .cta-cutout-image {
  background: linear-gradient(135deg, #050E30 0%, #081648 50%, #FF5D00 100%);
}

/* ---- CTA — Responsivo ---- */
@media (max-width: 768px) {
  .cta-title {
    font-size: 1.125rem;
  }

  .cta-right-image {
    flex-direction: column;
  }

  .cta-right-image .cta-content {
    padding: var(--spacing-xl);
  }

  .cta-image-wrapper {
    width: 100%;
    height: 200px;
  }

  .cta-cutout-image {
    padding-right: var(--spacing-xl);
    min-height: auto;
    overflow: visible;
  }

  .cta-cutout-image .cta-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    margin-top: var(--spacing-lg);
    transform: none;
  }

  .cta-cutout-image .cta-image {
    transform: none;
  }
}

/* ---- CTA Card New ---- */
.cta-card-new {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--spacing-xl);
  background: linear-gradient(135deg, #31175D 0%, #31175D 50%, #FF5D00 100%);
  border-radius: var(--radius-xl);
  padding: 0 80px;
  position: relative;
  overflow: hidden;
  height: 336.08px;
  align-items: center;
}

/* Vetor brain_cta centralizado no fundo do card (250px de altura) */
.cta-card-new::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/finetips-eddmartins-brain-cta.svg") center center / auto 230px no-repeat;
  z-index: 0;
  pointer-events: none;
}

.cta-content-new,
.cta-image-new {
  position: relative;
  z-index: 1;
}

.cta-content-new {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: 0;
}

.cta-title-new {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.3;
  color: #FFFFFF;
  margin: 0;
}

.cta-description-new {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 480px;
}

.cta-button-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.cta-button-new:hover {
  background-color: var(--primary-hover);
  color: #FFFFFF;
}

.cta-image-new {
  align-self: flex-end;
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.cta-image-new img {
  height: 336.08px;
  width: auto;
  display: block;
  object-fit: contain;
  object-position: bottom;
}

@media (max-width: 768px) {
  .cta-card-new {
    grid-template-columns: 1fr;
    padding: var(--spacing-xl) var(--spacing-lg) 0;
    text-align: center;
    height: auto;
    align-items: stretch;
  }

  .cta-content-new {
    align-items: center;
    gap: var(--spacing-lg);
  }

  .cta-description-new {
    max-width: 100%;
  }

  /* Título do CTA menor no mobile */
  .cta-title-new {
    font-size: 32px;
  }

  /* Quebras manuais do desktop causam linhas órfãs no mobile */
  .cta-title-new br {
    display: none;
  }

  /* Foto do especialista na base do card, depois do botão (full-bleed) */
  .cta-image-new {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: auto;
    margin-inline: calc(var(--spacing-lg) * -1);
  }

  .cta-image-new img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    object-position: bottom;
  }

  .cta-card-new::before {
    background-size: auto 180px;
  }
}

/* Alvos de toque ≥ 44px no mobile */
@media (max-width: 768px) {
  .layout-footer-social-icon {
    width: 44px;
    height: 44px;
  }

  .layout-footer-theme {
    min-height: 44px;
    padding: 10px 14px;
  }

  .layout-footer-legal a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}
