/* ==========================================================================
   Clínica Elera — Antigravity Spatial & Glassmorphism Design System
   Brand Palette:
   - Teal Primary:   #009B8A
   - Lime Secondary: #A6CE39
   - Rose Accent:    #E63E8D
   ========================================================================== */

:root {
  --elera-teal: #009b8a;
  --elera-teal-dark: #007668;
  --elera-teal-light: #e6f7f5;
  --elera-lime: #a6ce39;
  --elera-lime-dark: #84a824;
  --elera-pink: #e63e8d;
  --elera-pink-light: #fcebf3;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow-weightless: 0 20px 40px rgba(0, 45, 40, 0.06), 0 4px 12px rgba(0, 155, 138, 0.04);
  --shadow-weightless-hover: 0 30px 60px rgba(0, 80, 70, 0.12), 0 8px 20px rgba(0, 155, 138, 0.08);
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: #f4faf9;
  color: #0f2926;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Outfit', sans-serif;
}

/* --------------------------------------------------------------------------
   Spatial Background & Isometric Floor Grid
   -------------------------------------------------------------------------- */
.spatial-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  perspective: 1200px;
}

.isometric-bg-grid {
  position: absolute;
  width: 200vw;
  height: 200vh;
  left: -50vw;
  top: -30vh;
  background-image:
    linear-gradient(to right, rgba(0, 155, 138, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 155, 138, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: rotateX(60deg) rotateZ(-45deg) translateZ(-120px);
  transform-origin: center center;
  mask-image: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.9) 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, rgba(0, 0, 0, 0.9) 0%, transparent 70%);
}

.spatial-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Glassmorphism & Weightless Surfaces
   -------------------------------------------------------------------------- */
.glass-pill {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 28px rgba(0, 50, 45, 0.06);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-weightless);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(0, 155, 138, 0.35);
}

.glass-card-dark {
  background: rgba(11, 37, 34, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 48px rgba(0, 20, 18, 0.28);
}

/* --------------------------------------------------------------------------
   3D Perspective & Tilt Containers
   -------------------------------------------------------------------------- */
.perspective-stage {
  perspective: 1400px;
  transform-style: preserve-3d;
}

.tilt-card {
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(1100px) rotateX(0deg) rotateY(0deg) translateZ(0);
}

.tilt-card-inner-pop {
  transform: translateZ(28px);
  transform-style: preserve-3d;
}

.tilt-card-badge-pop {
  transform: translateZ(44px);
}

.tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    420px circle at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 255, 255, 0.55),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.tilt-card:hover .tilt-glare {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   Isometric 3D Showcase Grid Mode
   -------------------------------------------------------------------------- */
.iso-deck-wrapper {
  perspective: 1800px;
  transform-style: preserve-3d;
  transition: padding 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.iso-deck-grid {
  transform-style: preserve-3d;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.iso-deck-grid.is-isometric {
  transform: rotateX(52deg) rotateZ(-32deg) scale(0.88);
}

.iso-deck-grid.is-isometric .iso-card {
  box-shadow:
    -16px 20px 36px rgba(0, 45, 40, 0.16),
    -4px 6px 0px rgba(0, 155, 138, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.iso-deck-grid.is-isometric .iso-card:hover {
  transform: translateZ(42px) translateY(-8px);
}

/* --------------------------------------------------------------------------
   Floating Keyframes (Disabled when prefers-reduced-motion: reduce)
   -------------------------------------------------------------------------- */
@keyframes floatSlow {
  0%, 100% {
    transform: translate3d(0, 0px, 36px);
  }
  50% {
    transform: translate3d(0, -10px, 36px);
  }
}

@keyframes floatDelayed {
  0%, 100% {
    transform: translate3d(0, 0px, 48px);
  }
  50% {
    transform: translate3d(0, 9px, 48px);
  }
}

.animate-float-slow {
  animation: floatSlow 5.5s ease-in-out infinite;
}

.animate-float-delayed {
  animation: floatDelayed 6.5s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Focus & Accessibility States
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--elera-pink);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Reduced Motion Compliance (Antigravity Design Constraint)
   -------------------------------------------------------------------------- */
@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;
    scroll-behavior: auto !important;
  }
  .iso-deck-grid.is-isometric {
    transform: none !important;
  }
  .tilt-card,
  .tilt-card-inner-pop,
  .tilt-card-badge-pop {
    transform: none !important;
  }
}

