/* =========================================================
   utilities.css — Clínica Blossom
   Acessibilidade, navbar, widgets flutuantes e utilitários
   ========================================================= */

/* ---------------------------------------------------------
   Acessibilidade — Modos alternativos
   --------------------------------------------------------- */

/* Dark mode */
body.dark-mode {
  background: var(--deep);
}

body.dark-mode .nav-logo-invert {
  filter: invert(1) brightness(2);
}

/* High contrast */
body.high-contrast {
  --primary:     oklch(12% 0.01 265);
  --primary-light: oklch(12% 0.01 265);
  --primary-dark:  oklch(12% 0.01 265);
  --deep:        oklch(12% 0.01 265);
  --bg-cream:    oklch(98% 0.004 80);
  --bg-card:     oklch(92% 0.006 80);
  --text:        oklch(12% 0.01 265);
  --text-light:  oklch(12% 0.01 265);
  --border:      oklch(12% 0.01 265);
}

/* Large text */
body.large-text {
  font-size: 18px;
}

body.large-text h1 {
  font-size: clamp(48px, 6vw, 80px) !important;
}

body.large-text h2 {
  font-size: clamp(36px, 5vw, 56px) !important;
}

/* Reduce motion */
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration:        0.01ms !important;
  animation-iteration-count: 1      !important;
  transition-duration:       0.01ms !important;
  scroll-behavior:           auto   !important;
}

/* ---------------------------------------------------------
   Navbar
   --------------------------------------------------------- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  transition: background 0.3s ease;
  padding: 0 24px;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1100px;
  margin: 0 auto;
}

.nav-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
}

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

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
  display: block;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay */
.nav-mobile {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-md);
  z-index: 8999;
}

.nav-mobile.open {
  transform: translateX(0);
}

.nav-mobile a {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  transition: var(--transition);
}

.nav-mobile a:hover {
  background: var(--bg-cream);
  color: var(--primary);
}

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

  .hamburger {
    display: flex;
  }

  .nav-cta .btn-outline {
    display: none;
  }
}

/* ---------------------------------------------------------
   Accessibility widget
   --------------------------------------------------------- */
#accessibility-btn {
  position: fixed;
  left: 20px;
  bottom: 80px;
  z-index: 7900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--text-light);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#accessibility-btn:hover {
  background: var(--bg-cream);
  color: var(--primary);
  border-color: var(--primary);
}

#accessibility-menu {
  position: fixed;
  left: 20px;
  bottom: 132px;
  z-index: 7900;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}

#accessibility-menu.open {
  display: flex;
}

.a11y-option {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  font-family: var(--font-body);
  width: 100%;
}

.a11y-option:hover {
  background: var(--bg-cream);
  color: var(--primary);
}

.a11y-option.active {
  color: var(--primary);
  font-weight: 600;
}

/* ---------------------------------------------------------
   Back to top
   --------------------------------------------------------- */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 7800;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

#back-to-top:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ---------------------------------------------------------
   Cookie bar
   --------------------------------------------------------- */
#cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9500;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 -4px 20px rgba(26, 31, 46, 0.08);
  transform: translateY(100%);
  transition: transform 0.4s ease;
  flex-wrap: wrap;
}

#cookie-bar.visible {
  transform: translateY(0);
}

#cookie-bar p {
  font-size: 14px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0;
  line-height: 1.6;
}

#cookie-bar a {
  color: var(--primary);
  text-decoration: underline;
}

#cookie-bar a:hover {
  color: var(--primary-dark);
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Reveal animations
   --------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------
   Utilitários gerais
   --------------------------------------------------------- */

/* Alinhamento */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

/* Margin top */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }

/* Margin bottom */
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

/* Display */
.hidden { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Flex helpers */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8       { gap: 8px; }
.gap-16      { gap: 16px; }
.gap-24      { gap: 24px; }

/* Width helpers */
.w-full { width: 100%; }

/* Section padding */
.section-pad {
  padding: 80px 0;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Section header */
.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.section-eyebrow::before,
.section-eyebrow::after {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--primary);
  display: inline-block;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  color: var(--deep);
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

/* Divider */
.divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  margin: 16px auto 0;
}
