/* ==========================================================================
   FACETARE ODONTO CLINIC - DISTILLED LUXURY DESIGN SYSTEM
   Direção de Arte: Editorial Suíço, Haute Horlogerie & Atelier de Precisão
   Princípios: Quiet Luxury, Tipografia Impecável, Zero Elementos Redundantes
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg-deep: #08090A;
  --bg-surface: #0E0F12;
  --bg-elevated: #131418;
  --bg-card: #111215;
  
  --line-subtle: rgba(255, 255, 255, 0.06);
  --line-medium: rgba(255, 255, 255, 0.10);
  --line-brass: rgba(197, 168, 128, 0.22);
  
  --color-brass: #C5A880;
  --color-brass-light: #DEC3A4;
  --color-brass-dark: #8C724F;
  --color-bone: #F5F4F0;
  
  --text-primary: #F5F5F7;
  --text-secondary: #A1A4B0;
  --text-muted: #6B6E7B;
  
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base & Scrollbar */
html {
  color-scheme: dark;
  scroll-behavior: auto;
}

/* Neutraliza a classe scroll-smooth do Tailwind no <html> (conflita com a intro por scroll) */
html.scroll-smooth {
  scroll-behavior: auto !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

::selection {
  background-color: var(--color-brass);
  color: #000;
}

::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: #1C1E24;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-brass-dark);
}

/* Tipografia */
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  letter-spacing: -0.015em;
  font-feature-settings: "kern", "liga", "clig";
}

.tracking-atelier {
  letter-spacing: 0.22em;
}

/* Linhas Arquitetônicas - Precisão Suíça */
.hairline-b {
  border-bottom: 1px solid var(--line-subtle);
}
.hairline-t {
  border-top: 1px solid var(--line-subtle);
}
.hairline-all {
  border: 1px solid var(--line-subtle);
}
.hairline-brass {
  border: 1px solid var(--line-brass);
}

/* Botões com Intenção e Nobreza */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background-color: var(--color-bone);
  color: #08090A;
  border: 1px solid var(--color-bone);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--color-brass-light);
  border-color: var(--color-brass-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.6);
}

.btn-primary:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 3px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--line-medium);
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--color-brass);
  color: var(--color-brass-light);
  background-color: rgba(197, 168, 128, 0.04);
}

.btn-outline:active {
  transform: scale(0.985);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 3px;
}

/* Text links discretos */
.link-editorial {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brass);
  transition: color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

.link-editorial:hover {
  color: var(--color-bone);
  transform: translateX(3px);
}

.link-editorial:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Inputs da Mesa de Atendimento */
.input-atelier {
  background-color: #0A0B0E;
  border: 1px solid var(--line-subtle);
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.input-atelier:focus {
  outline: none;
  border-color: var(--color-brass);
  box-shadow: 0 0 0 1px rgba(197, 168, 128, 0.4);
  background-color: #0F1014;
}

/* Efeito tátil no controle do Slider */
#beforeAfterContainer {
  touch-action: pan-y;
}

#beforeAfterContainer:active #sliderHandle > div {
  transform: translate(-50%, -50%) scale(1.1);
  border-color: var(--color-brass-light);
  box-shadow: 0 0 16px rgba(197, 168, 128, 0.35);
}

/* Slider Antes/Depois - Minimalista e Direto */
#beforeAfterContainer {
  touch-action: pan-y;
}

#compareRange::-webkit-slider-thumb {
  width: 48px;
  height: 100%;
  cursor: ew-resize;
  opacity: 0;
}

#compareRange::-moz-range-thumb {
  width: 48px;
  height: 100%;
  cursor: ew-resize;
  opacity: 0;
}

/* Acordeão de FAQ - Sem bordas pesadas */
.faq-item {
  border-bottom: 1px solid var(--line-subtle);
  transition: border-color 0.25s ease;
}

.faq-item:hover {
  border-color: var(--line-medium);
}

.faq-item.active {
  border-color: var(--line-brass);
}

.faq-item.active .faq-content {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--color-brass);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Micro Header & Header */
#mainHeader nav a {
  white-space: nowrap !important;
  transition: color 0.2s ease;
}

#mainHeader .btn-primary {
  white-space: nowrap !important;
}

/* ==========================================================================
   MOBILE OPTIMIZATIONS (360px, 390px & Touch Devices)
   ========================================================================== */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Previne qualquer overflow horizontal em telas pequenas */
/* IMPORTANTE: nunca usar overflow hidden/auto em html/body, pois quebra o position: sticky da intro.
   overflow-x: clip evita o scroll horizontal sem criar contêiner de rolagem. */
html {
  max-width: 100%;
}

body {
  max-width: 100%;
  overflow-x: clip;
}

/* Áreas de toque confortáveis (Mínimo 44px conforme diretrizes WCAG / Apple HIG) */
button, 
a.btn-primary, 
a.btn-outline,
.mobile-link,
.faq-btn {
  min-height: 44px;
}

/* Ajustes finos para telas menores que 390px e 360px */
@media (max-width: 390px) {
  .tracking-atelier {
    letter-spacing: 0.16em;
  }

  h1 {
    font-size: 2.15rem !important;
    line-height: 1.15 !important;
  }

  h2 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 360px) {
  .tracking-atelier {
    letter-spacing: 0.12em;
  }

  h1 {
    font-size: 1.95rem !important;
    line-height: 1.18 !important;
  }

  h2 {
    font-size: 1.6rem !important;
  }

  .px-4 {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }
}

/* Safe area padding para botão flutuante em iPhones modernos */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .fixed.bottom-6, .fixed.bottom-4 {
    bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
  }
}

/* ==========================================================================
   PRELOADER & SCROLLYTELLING INTRO
   ========================================================================== */
body.loading-locked {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none;
}

body.loading-locked #mainHeader,
body.loading-locked aside,
body.loading-locked main,
body.loading-locked section:not(#intro-scrolly),
body.loading-locked footer {
  opacity: 0;
  pointer-events: none;
}

body.loaded-ready #mainHeader,
body.loaded-ready aside,
body.loaded-ready main,
body.loaded-ready section:not(#intro-scrolly),
body.loaded-ready footer {
  opacity: 1;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Container Scrollytelling
   Otimizado para 20 frames: a animação avança com leveza e a hero
   começa a subir logo após o início, cobrindo o canvas sem espera. */
#intro-scrolly {
  position: relative;
  width: 100%;
  height: 250vh;               /* desktop: hero começa a subir aos ~50vh e fecha aos ~150vh */
  background-color: var(--bg-deep);

  /* Puxa o conteúdo seguinte 1 tela para cima, sobrepondo o canvas fixo */
  margin-bottom: -100vh;
}

@media (max-width: 768px) {
  #intro-scrolly {
    height: 210vh;             /* mobile: ágil, sobe com apenas 1-2 toques leves */
  }
}

/* Tudo que vem depois da intro fica por cima do canvas e cobre a animação */
#intro-scrolly ~ aside,
#intro-scrolly ~ section,
#intro-scrolly ~ footer {
  position: relative;
  z-index: 20;
}

/* O header principal já é sticky (z-50) e continua acima de tudo */

/* A hero precisa de fundo sólido, senão a animação aparece através dela */
#hero {
  background-color: var(--bg-deep);
}

/* Sombra sutil na borda superior do primeiro elemento que sobe, para dar profundidade */
#intro-scrolly ~ aside {
  box-shadow: 0 -28px 60px -12px rgba(0, 0, 0, 0.65);
}

#introSticky {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#introCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: block;
}

/* ==========================================================================
   REVEAL ON SCROLL (ANIMAÇÕES SUAVES DE SURGIMENTO)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-img {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-img.revealed {
  opacity: 1;
  transform: scale(1);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Desativa animações se o usuário preferir redução de movimento */
@media (prefers-reduced-motion: reduce) {
  .reveal, 
  .reveal-img, 
  .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


