/* ==========================================================================
   Faces By, Jb — Ultra-Girly White & Pink Luxury Makeup & Lash Theme
   ========================================================================== */

:root {
  /* MANDATORY per modern-web-guidance (animate-to-intrinsic-sizes):
     Transitions to intrinsic keywords are disabled by default for compatibility */
  interpolate-size: allow-keywords;
  color-scheme: light;

  /* Core White & Pink Palette */
  --bg-white: #FFFFFF;
  --bg-blush: #FFF5F9;
  --bg-petal: #FCE7F3;
  --bg-cotton: #FDF2F8;
  --pink-primary: #D81B60;       /* Rich Barbie Berry-Pink (WCAG AA >5.2:1 with #FFF) */
  --pink-hot: #EC4899;           /* Vibrant Peony Pink */
  --pink-soft: #F472B6;          /* Bubblegum Rose */
  --pink-border: #D6689A;        /* 3:1+ Non-text UI boundary contrast on white/blush */
  --pink-border-soft: #F4A8CC;
  --berry-dark: #4A0E2E;         /* Deep Rose-Plum for primary text (>11:1 on white) */
  --berry-muted: #7A2852;        /* Muted Rose-Mauve for secondary text (>6:1 on white) */
  --disabled-pink: #D8B4C8;
  --error-red: #C51162;
  --error-bg: #FCE4EC;
  --valid-green: #188038;

  /* Safe tint generation using color-mix in oklab (per modern-web-guidance color guide) */
  --pink-tint-surface: color-mix(in oklab, var(--pink-hot), white 88%);
  --pink-tint-hover: color-mix(in oklab, var(--pink-primary), white 82%);

  /* Typography */
  --font-display: 'Playfair Display', 'Maname', Georgia, serif;
  --font-script: 'Dancing Script', cursive;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  color: var(--berry-dark);
  background-color: var(--bg-white);
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg-white);
  color: var(--berry-dark);
  overflow-x: hidden;
  /* Dreamy girly pink & pearl sparkle watermark background */
  background-image:
    radial-gradient(circle at 15% 15%, rgba(244, 114, 182, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 35%, rgba(236, 72, 153, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 50% 85%, rgba(251, 207, 232, 0.25) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='84' height='84' viewBox='0 0 84 84' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23EC4899' fill-opacity='0.055'%3E%3Cpath d='M42 14 C44 26, 48 30, 60 32 C48 34, 44 38, 42 50 C40 38, 36 34, 24 32 C36 30, 40 26, 42 14 Z'/%3E%3Ccircle cx='18' cy='66' r='2.5'/%3E%3Ccircle cx='68' cy='18' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

.font-maname {
  font-family: var(--font-display);
}

.font-script {
  font-family: var(--font-script);
}

/* Signature Asymmetric Petal Button (Girly Pink & Pearl Glossy Style) */
.btn-petal {
  font-family: var(--font-display);
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
  border-bottom-right-radius: 9999px;
  border-top-right-radius: 0.9rem;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  font-weight: 600;
}

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

.btn-petal:active {
  transform: scale(0.97);
}

.btn-petal-primary {
  background: linear-gradient(135deg, #EC4899 0%, #D81B60 100%);
  color: #FFFFFF;
  border: 1.5px solid #D81B60;
  box-shadow: 0 10px 24px -6px rgba(216, 27, 96, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.btn-petal-primary:hover {
  background: linear-gradient(135deg, #DB2777 0%, #AD1457 100%);
  box-shadow: 0 14px 28px -6px rgba(216, 27, 96, 0.55);
}

.btn-petal-outline {
  background-color: #FFFFFF;
  color: var(--pink-primary);
  border: 2px solid var(--pink-primary);
  box-shadow: 0 6px 18px -6px rgba(236, 72, 153, 0.22);
}

.btn-petal-outline:hover {
  background-color: var(--bg-petal);
  color: var(--berry-dark);
}

.btn-petal-sand {
  background-color: #FFFFFF;
  color: var(--pink-primary);
  border: 2px solid #FBCFE8;
  box-shadow: 0 8px 20px -6px rgba(131, 24, 67, 0.25);
}

.btn-petal-sand:hover {
  background-color: var(--bg-petal);
  color: var(--berry-dark);
}

/* Soft Girly Card Shadows & Borders */
.girly-card {
  background-color: #FFFFFF;
  border: 1.5px solid var(--pink-border-soft);
  box-shadow: 0 14px 34px -10px rgba(236, 72, 153, 0.14);
}

/* Header transitions */
.site-header {
  transition: background-color 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease;
}

.site-header.header-transparent {
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(244, 114, 182, 0.3);
}

.site-header.header-solid {
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border-bottom: 1.5px solid #FBCFE8;
  box-shadow: 0 10px 30px -8px rgba(236, 72, 153, 0.18);
}

.site-header .nav-link {
  color: var(--berry-dark);
}

.site-header .nav-link.active-tab {
  color: var(--pink-primary);
}

/* Hero Slider Zoom Effect */
.hero-slide-bg {
  transform: scale(1.12);
  transition: transform 6s ease-out;
}

.hero-slide-active .hero-slide-bg {
  transform: scale(1.02);
}

/* Service & Product Card Image Zoom */
.card-zoom-img {
  transform: scale(1.08);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.group:hover .card-zoom-img {
  transform: scale(1.2);
}

/* Native <details> Exclusive FAQ Accordion with intrinsic size animation */
.faq-details {
  border-radius: 1rem;
  overflow: hidden;
  background-color: #FFFFFF;
  box-shadow: 0 6px 20px -8px rgba(236, 72, 153, 0.14);
}

.faq-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.35rem;
  border-radius: 1rem;
  cursor: pointer;
  border: 1.5px solid var(--pink-border);
  background-color: #FFFFFF;
  color: var(--berry-dark);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  user-select: none;
}

.faq-summary:hover {
  background-color: var(--bg-blush);
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-icon-box {
  padding: 0.5rem;
  border-radius: 9999px;
  background-color: var(--bg-petal);
  color: var(--pink-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-inline-start: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.faq-icon-svg {
  transition: transform 0.4s ease;
  transform: rotate(0deg);
}

.faq-details[open] .faq-summary {
  background: linear-gradient(135deg, #EC4899 0%, #D81B60 100%);
  border-color: var(--pink-primary);
  color: #FFFFFF;
}

.faq-details[open] .faq-icon-box {
  background-color: #FFFFFF;
  color: var(--pink-primary);
}

.faq-details[open] .faq-icon-svg {
  transform: rotate(45deg);
}

.faq-details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.35s ease-out, content-visibility 0.35s ease-out allow-discrete;
}

.faq-details[open]::details-content {
  block-size: auto;
}

/* Expandable Service Details in Booking Tab */
.expandable-container {
  block-size: 0;
  overflow: hidden;
  transition: block-size 0.35s ease-out;
}

.expandable-container.is-expanded {
  block-size: auto;
}

/* Native Modal Dialogs & Backdrop (per light-dismiss-a-dialog & css-layout guides) */
dialog.studio-dialog {
  border: 2px solid var(--pink-border);
  background-color: #FFFFFF;
  color: var(--berry-dark);
  border-radius: 1.5rem;
  padding: 0;
  width: min(94dvw, 42rem);
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 25px 60px -12px rgba(216, 27, 96, 0.32);
}

.pill-wrap-balance {
  display: flex;
  flex-wrap: wrap;
  flex-wrap: balance;
}

dialog.studio-dialog::backdrop {
  background-color: rgba(74, 14, 46, 0.45);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Visually hidden helper for accessible file inputs (keeps input in accessibility tree) */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* Receipt Upload Dropzone */
.receipt-dropzone {
  border: 2px dashed var(--pink-border);
  background-color: #FFFFFF;
  border-radius: 1rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.receipt-dropzone:hover,
.receipt-dropzone.is-dragover {
  border-color: var(--pink-primary);
  background-color: var(--bg-blush);
}

.receipt-dropzone:has(input:focus-visible) {
  outline: 3px solid var(--pink-primary);
  outline-offset: 2px;
}

.receipt-dropzone.has-error {
  border-color: var(--error-red);
  background-color: var(--error-bg);
}

/* Form Controls & Validation After Interaction (per validate-input-after-interaction & color guides) */
.studio-input,
.studio-select {
  border: 1.5px solid var(--pink-border); /* >= 3:1 non-text contrast against #FFFFFF and #FFF5F9 */
}

.field-hint {
  display: block;
  color: var(--berry-muted);
  font-size: 0.78rem;
  margin-block-end: 0.3rem;
}

.error-msg {
  display: none;
  color: var(--error-red);
  font-size: 0.8rem;
  font-weight: 600;
  margin-block-start: 0.3rem;
}

/* DO: Only show error styles after user interaction */
.studio-input:user-invalid,
.studio-input.user-invalid-fallback {
  border-color: var(--error-red) !important;
  background-color: var(--error-bg) !important;
}

/* DO: Reveal the error message using the adjacent sibling selector */
.studio-input:user-invalid + .error-msg,
.studio-input.user-invalid-fallback + .error-msg {
  display: block;
}

/* DO: Provide a clear success indication on :user-valid */
.studio-input:user-valid,
.studio-input.user-valid-fallback {
  border-color: var(--valid-green);
}

/* Reinforce contrast when user requests higher contrast (per color guide) */
@media (prefers-contrast: more) {
  .studio-input,
  .studio-select,
  .faq-summary,
  dialog.studio-dialog {
    border-width: 2px;
    border-color: var(--berry-dark);
  }
}

/* Support Forced Colors Mode (per color guide) */
@media (forced-colors: active) {
  .btn-petal,
  .faq-summary,
  .studio-input,
  .studio-select,
  dialog.studio-dialog {
    border: 2px solid ButtonText;
  }
  .btn-petal-primary {
    background: Highlight;
    color: HighlightText;
  }
}

/* Accessible focus outlines */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--pink-primary);
  outline-offset: 2px;
}

/* Touch target sizing on coarse pointers */
@media (pointer: coarse) {
  .studio-input,
  .studio-select {
    min-height: 52px;
  }
}

/* Custom subtle scrollbars for time slots */
.time-slots-scroll::-webkit-scrollbar {
  width: 6px;
}
.time-slots-scroll::-webkit-scrollbar-track {
  background: #FDF2F8;
  border-radius: 999px;
}
.time-slots-scroll::-webkit-scrollbar-thumb {
  background: #F472B6;
  border-radius: 999px;
}

/* MANDATORY Copy-Paste Safety: Disable sizing animations for sensitive users */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  .expandable-container,
  .faq-details::details-content,
  .hero-slide-bg,
  .card-zoom-img {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   3D & Motion Enhancements (Modern Web Guidance Motion Compliant)
   ========================================================================== */

:root {
  --spring-easing: linear(
    0, 0.002, 0.01 0.9%, 0.038 1.8%, 0.156, 0.312 5.8%, 0.789 11.1%, 1.015 14.2%,
    1.096, 1.157, 1.199, 1.224 20.3%, 1.231, 1.231, 1.226, 1.214 24.6%,
    1.176 26.9%, 1.057 32.6%, 1.007 35.5%, 0.984, 0.968, 0.956, 0.949 42%,
    0.946 44.1%, 0.95 46.5%, 0.998 57.2%, 1.007, 1.011 63.3%, 1.012 66.8%,
    0.998 79.4%, 1
  );
  --spring-duration: 0.65s;
}

@supports not (animation-timing-function: linear(0, 1)) {
  :root {
    --spring-easing: cubic-bezier(0.22, 1, 0.36, 1);
    --spring-duration: 0.4s;
  }
}

/* 3D Perspective Containers */
.perspective-container {
  perspective: 1200px;
}

.card-3d {
  position: relative;
  transform-style: preserve-3d;
  /* Initialize individual transform properties to identity values to prevent stacking context shift on hover */
  translate: 0px 0px;
  scale: 1;
  rotate: 0deg;
  transition:
    translate var(--spring-duration) var(--spring-easing),
    scale var(--spring-duration) var(--spring-easing),
    box-shadow 0.35s ease,
    border-color 0.3s ease;
  will-change: transform, translate, scale;
}

@media (hover: hover) and (pointer: fine) {
  .card-3d:hover {
    translate: 0px -6px;
    scale: 1.015;
    box-shadow: 0 22px 44px -12px rgba(216, 27, 96, 0.22), 0 0 0 1px rgba(244, 114, 182, 0.45);
  }
}

.card-3d-content {
  transform: translateZ(20px);
}

/* Floating 3D Badges */
@keyframes float-slow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1.5deg);
  }
}

@keyframes float-reverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(12px) rotate(-1.5deg);
  }
}

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

.animate-float-reverse {
  animation: float-reverse 5s ease-in-out infinite;
}

/* Shimmer Light Sweep on Buttons & Badges */
.shimmer-btn {
  position: relative;
  overflow: hidden;
}

.shimmer-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -80%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 10%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 90%
  );
  transform: rotate(25deg);
  animation: shimmer-sweep 4.5s infinite;
  pointer-events: none;
}

@keyframes shimmer-sweep {
  0% {
    left: -80%;
  }
  30%, 100% {
    left: 140%;
  }
}

/* Pulse Glow Effect for Badges */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.35);
  }
  50% {
    box-shadow: 0 0 28px rgba(236, 72, 153, 0.65);
  }
}

.badge-glow {
  animation: glow-pulse 3s infinite;
}

/* Tab View Transition (compositor-friendly opacity + transform) */
.tab-view {
  animation: tab-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3D Glassmorphism Cards with Dynamic Specular Glare */
.glass-3d-card {
  position: relative;
  isolation: isolate;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 245, 249, 0.88));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(251, 207, 232, 0.9);
  box-shadow: 0 14px 34px -10px rgba(216, 27, 96, 0.11), inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

.glass-3d-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--glare-x, 50%) var(--glare-y, 20%),
    rgba(255, 255, 255, 0.65),
    rgba(251, 207, 232, 0.18) 40%,
    transparent 75%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: -1;
}

.glass-3d-card:hover::before {
  opacity: 1;
}

/* Floating Sparkle Particles */
.particle-sparkle {
  position: absolute;
  pointer-events: none;
  animation: sparkle-float 6s ease-in-out infinite;
}

@keyframes sparkle-float {
  0% {
    transform: translateY(0) scale(0.8) rotate(0deg);
    opacity: 0.2;
  }
  50% {
    transform: translateY(-25px) scale(1.1) rotate(180deg);
    opacity: 0.85;
  }
  100% {
    transform: translateY(0) scale(0.8) rotate(360deg);
    opacity: 0.2;
  }
}

/* ==========================================================================
   Interactive 3D Before/After Glam Reveal
   ========================================================================== */
.before-after-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 2rem;
  box-shadow: 0 25px 50px -12px rgba(216, 27, 96, 0.25);
  /* Allow smooth vertical page scrolling on mobile/tablet while dragging horizontally */
  touch-action: pan-y;
  border: 3px solid #FBCFE8;
  background: #FFF5F9;
}

.before-after-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: inset(0 50% 0 0);
  will-change: clip-path;
}

.before-after-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #FFFFFF;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.9), 0 0 2px rgba(0, 0, 0, 0.4);
  cursor: ew-resize;
  touch-action: none;
  z-index: 20;
  will-change: left;
}

.before-after-handle-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #EC4899, #D81B60);
  border: 3px solid #FFFFFF;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(216, 27, 96, 0.5);
  cursor: ew-resize;
  pointer-events: auto;
  user-select: none;
}

/* 3D Glass Stat Cards */
.stat-3d-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.5rem;
  padding: 1.5rem 1rem;
  translate: 0px 0px;
  scale: 1;
  transition:
    translate var(--spring-duration) var(--spring-easing),
    scale var(--spring-duration) var(--spring-easing),
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}

.stat-3d-card:hover {
  translate: 0px -6px;
  scale: 1.03;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 15px 30px rgba(74, 14, 46, 0.3);
}

/* Respect Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  .card-3d:hover,
  .stat-3d-card:hover {
    transform: none !important;
    translate: 0px 0px !important;
    scale: 1 !important;
  }
  .animate-float-slow,
  .animate-float-reverse,
  .shimmer-btn::after,
  .badge-glow,
  .particle-sparkle,
  .tab-view {
    animation: none !important;
  }
}
