/* ============================================
   CLICK PRIME SEGUROS — Critical CSS
   Inline no <head> em producao para FCP rapido
   ============================================ */

/* --- Reset / Normalize --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

/* --- Design Tokens (Opcao 3 — Paleta Premium) --- */
:root {
  /* Cores principais */
  --color-primary: #5C6450;
  --color-secondary: #F0EDE5;
  --color-accent: #C5A55A;
  --color-accent-text: #725E1F;
  --color-bg: #F0EDE5;
  --color-text: #2D2D2D;
  --color-surface: #FFFFFF;
  --color-surface-alt: #E8E4DC;
  --color-muted: #6B6B6B;

  /* Gradiente dourado metalico */
  --gold-gradient: linear-gradient(45deg, #CA9A43 5%, #E5BC5F 52%, #FFE39B 100%);
  --gold-gradient-btn: linear-gradient(90deg, #CA9A43 0%, #FFDA71 100%);
  --gold-gradient-btn-hover: linear-gradient(90deg, #FFDA71 0%, #CA9A43 100%);

  /* Botoes */
  --color-btn-bg: #C5A55A;
  --color-btn-text: #2D2D2D;
  --color-btn-hover: #A8893E;

  /* Comparativo */
  --color-positive: #5C6450;
  --color-negative: #8B6B6B;

  /* Tipografia fluida */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.925rem + 0.375vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.375rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.625rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  --text-3xl: clamp(1.875rem, 1.4rem + 2.375vw, 3rem);
  --text-4xl: clamp(2.25rem, 1.6rem + 3.25vw, 4rem);

  /* Espacamento */
  --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
  --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.25rem);
  --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.1rem + 2vw, 2.5rem);
  --space-xl: clamp(2rem, 1.4rem + 3vw, 4rem);
  --space-2xl: clamp(3rem, 2rem + 5vw, 6rem);
  --space-section: clamp(4rem, 3rem + 5vw, 8rem);

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;

  /* Transicoes */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* --- Base Typography --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p {
  margin-bottom: var(--space-md);
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding: var(--space-section) 0;
  position: relative;
}

.section--white {
  background-color: #FFFFFF;
}

.section--offwhite {
  background-color: var(--color-bg);
}

.section--dark {
  background-color: var(--color-primary);
  color: var(--color-secondary);
}

.section--dark .section__title {
  color: var(--color-secondary);
}

.section--dark .section__intro {
  color: rgba(240, 237, 229, 0.75);
}

/* Degrades entre secoes removidos — corte seco */

/* --- Button Base --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  transition: background-color var(--transition-base), transform var(--transition-fast);
  min-height: 44px;
  min-width: 44px;
}

.btn--cta {
  background: var(--gold-gradient-btn);
  color: var(--color-btn-text);
  border: 1px solid rgba(202, 154, 67, 0.4);
}

.btn--cta:hover {
  background: var(--gold-gradient-btn-hover);
  transform: translateY(-1px);
}

/* --- Header (above the fold) --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px 0;
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.header--scrolled {
  background-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
}

.header__logo img {
  height: clamp(30px, 2.5vw + 16px, 42px);
  width: auto;
}

.header__nav {
  display: none;
}

@media (min-width: 768px) {
  .header__nav {
    display: flex;
    gap: var(--space-md);
  }
}

.header__nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-secondary);
  transition: color var(--transition-fast);
}

.header__nav a:hover {
  color: var(--color-accent);
}

.header--scrolled .header__nav a {
  color: #FFFFFF;
}

.header--scrolled .header__nav a:hover {
  color: var(--color-accent);
}

/* --- Mobile Menu Slide-Out Panel --- */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.mobile-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-overlay[hidden] {
  display: block;
  opacity: 0;
  pointer-events: none;
}

.mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 55%;
  max-width: 280px;
  z-index: 200;
  background-color: rgba(92, 100, 80, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-xl) var(--space-lg);
  padding-top: calc(var(--space-xl) + 20px);
  gap: var(--space-xs);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.mobile-panel.is-active {
  transform: translateX(0);
}

.mobile-panel[hidden] {
  display: flex;
  transform: translateX(100%);
}

.mobile-panel__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-size: 28px;
  color: #FFFFFF;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-panel a {
  font-size: var(--text-lg);
  font-weight: 500;
  color: #FFFFFF;
  padding: var(--space-sm) 0;
  transition: color var(--transition-fast);
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-panel a:last-of-type {
  border-bottom: none;
}

.mobile-panel a:hover {
  color: var(--color-accent);
}

@media (min-width: 768px) {
  .mobile-overlay,
  .mobile-panel {
    display: none !important;
  }
}

/* --- Hero (above the fold) --- */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding-top: calc(88px + var(--space-xl));
  padding-bottom: var(--space-xl);
  background-color: var(--color-primary);
  position: relative;
}

.hero--photo {
  background-image: linear-gradient(to right, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%), url('../assets/images/fundo-hero-logo.webp');
  background-size: cover;
  background-position: center;
}

/* Hero mobile: imagem acima com degrade para verde */
.hero__mobile-image {
  display: none;
}

@media (max-width: 767px) {
  .hero--photo {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.45) 100%), url('../assets/images/banner-topo-click.webp');
    background-size: cover;
    background-position: center;
    min-height: auto;
    padding-top: calc(70px + var(--space-lg));
    padding-bottom: var(--space-lg);
    flex-direction: column;
    align-items: stretch;
  }

  .hero__mobile-image {
    display: none;
  }

  .hero__content {
    padding-top: 0;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero > .container {
    flex-direction: column;
  }

  /* No mobile, header sempre com fundo verde sobre a imagem */
  body.has-hero-photo .header,
  body:has(.hero--photo) .header {
    background: var(--color-primary);
  }

  body.has-hero-photo .header:not(.header--scrolled) .header__logo img,
  body:has(.hero--photo) .header:not(.header--scrolled) .header__logo img {
    filter: brightness(0) invert(1);
  }
}

.hero > .container {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.hero__content {
  text-align: left;
  max-width: 700px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

@media (max-width: 767px) {
  .hero__content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

.hero__title {
  color: var(--color-secondary);
  margin-bottom: var(--space-md);
  font-size: clamp(1.625rem, 1.3rem + 1.625vw, 2.5rem);
}

.hero__subtitle {
  font-size: var(--text-base);
  color: rgba(240, 237, 229, 0.75);
  margin-bottom: var(--space-lg);
}

.hero__topics {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.hero__topics-row {
  display: flex;
  gap: var(--space-sm);
}

.hero__topic {
  padding: var(--space-xs) var(--space-md);
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-secondary);
  min-width: 180px;
  text-align: center;
  white-space: nowrap;
}

/* --- Texto dourado com negrito (reutilizavel) --- */
.text-gold {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.text-gold-dark {
  background: linear-gradient(45deg, #B8891F 5%, #D4A83A 52%, #E5BC5F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* --- Mobile Menu Toggle --- */
.header__menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .header__menu-toggle {
    display: none;
  }
}

.header__menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-secondary);
  transition: transform var(--transition-base), background-color var(--transition-base);
}

.header--scrolled .header__menu-toggle span {
  background-color: #FFFFFF;
}

/* --- Focus States (a11y WCAG 2.4.7) --- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.whatsapp-float:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
}

/* --- Visually Hidden (a11y) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
