/**
 * ==============================================================================
 * Instituto de Fadiga - Estilos Globais
 * ==============================================================================
 */

@import url('variables.css');

/* Resets e Configurações Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

img, video, iframe, svg {
  max-width: 100%;
}

img {
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, textarea, select {
  font: inherit;
  max-width: 100%;
}

button {
  cursor: pointer;
}

/* Acessibilidade - Link para pular ao conteúdo */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  z-index: 9999;
  background: var(--ink);
  color: var(--white);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

/* Layout Container */
.container {
  width: min(calc(100% - 36px), var(--container));
  margin-inline: auto;
  max-width: 100%;
}

.container-narrow {
  width: min(calc(100% - 36px), var(--container-narrow));
  margin-inline: auto;
  max-width: 100%;
}

/* Tipografia Base */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--ink);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

h1, h2 {
  font-family: var(--font-heading);
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 5.2rem);
  margin-bottom: 24px;
  word-break: break-word;
}

h2 {
  font-size: clamp(1.75rem, 3.8vw, 3.4rem);
  margin-bottom: 20px;
  word-break: break-word;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.05rem;
}

p {
  margin-top: 0;
}

/* Eyebrow / Supertítulo */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--warm);
  border-radius: var(--radius-full);
}

/* Seções e Modificadores de Fundo */
.section {
  padding: 104px 0;
  position: relative;
}

.section-sm {
  padding: 76px 0;
}

.section-white { background: var(--white); }
.section-blue { background: var(--blue-soft); }
.section-green { background: var(--green-soft); }
.section-dark { background: var(--brand); color: var(--white); }

.section-dark h1,
.section-dark h2,
.section-dark h3 {
  color: var(--white);
}

.section-head {
  max-width: 760px;
  margin-bottom: 44px;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 680px;
}

.section-dark .section-head p {
  color: rgba(255, 255, 255, 0.82);
}

.section-dark .eyebrow {
  color: #dff1e7;
}

/* Header & Navegação */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(248, 247, 242, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(216, 225, 223, 0.85);
}

.nav {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 175px;
  height: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--brand);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  color: var(--ink);
  cursor: pointer;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(15, 79, 86, 0.2);
}

.btn-primary:hover {
  background: var(--brand-2);
  color: var(--white);
}

.btn-secondary {
  background: var(--green);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--green-dark);
}

.btn-outline {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-light {
  background: var(--white);
  color: var(--brand);
}

.btn-light:hover {
  background: var(--paper);
}

.btn-ghost-light {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  background: transparent;
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
}

.btn-sm {
  padding: 9px 15px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 15px 28px;
  font-size: 1rem;
}

/* Footer Global */
footer,
.footer {
  background: #0b363b;
  color: var(--white);
  padding: 58px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr .7fr .7fr 1fr;
  gap: 32px;
}

.footer-logo img {
  width: 185px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.footer-copy {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
  max-width: 360px;
  margin-top: 18px;
}

.footer-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: #cce2df;
  margin-bottom: 14px;
}

.footer-links {
  display: grid;
  gap: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 42px;
  padding-top: 24px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.84rem;
  width: 100%;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  width: 100%;
}

.footer-creator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  width: 100%;
}

.footer-creator a {
  display: inline-flex;
  align-items: center;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.footer-creator a:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.footer-creator img {
  height: 22px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

/* Botão Flutuante (WhatsApp CTA) */
.floating-cta {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 990;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: var(--brand);
  color: var(--white);
  border-radius: var(--radius-full);
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 10px 28px rgba(15, 79, 86, 0.24), 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.floating-cta:hover {
  transform: translateY(-3px) scale(1.02);
  background: var(--brand-2);
  box-shadow: 0 14px 34px rgba(15, 79, 86, 0.32), 0 4px 10px rgba(0, 0, 0, 0.1);
  color: var(--white);
}

.floating-cta svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--warm);
}

.floating-cta-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.floating-cta-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.floating-cta-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.floating-cta-text span:first-child {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.9;
  white-space: nowrap;
}

.floating-cta-text span:last-child {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Media Queries Globais (Mobile Menu) */
@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
  }
  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 80px;
    left: 20px;
    right: 20px;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
  .nav.open .nav-links .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .section { padding: 56px 0; }
  .section-sm { padding: 42px 0; }
  .header .nav { min-height: 68px; }
  .brand img { width: 140px; }
  .nav.open .nav-links { top: 68px; left: 14px; right: 14px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer { padding-bottom: 84px; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 12px; }
  .footer-creator { justify-content: center; padding-right: 0; }
  .floating-cta {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    gap: 8px;
  }
  .floating-cta-icon { width: 19px; height: 19px; }
  .floating-cta-text span:first-child { font-size: 0.76rem; }
  .floating-cta-text span:last-child { font-size: 0.88rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
