/* XPRO Design System — Custom utilities extending Tailwind */

/* ===== Gradient Text ===== */
.text-gradient-purple {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-pink {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Radiant Gradient ===== */
.bg-radiant-gradient {
  background: linear-gradient(115deg, #c4b5fd 28%, #a78bfa 70%, #8b5cf6 100%);
}

@media (min-width: 640px) {
  .bg-radiant-gradient {
    background: linear-gradient(145deg, #c4b5fd 28%, #a78bfa 70%, #8b5cf6 100%);
  }
}

/* ===== Glassmorphism ===== */
.glass {
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-light {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===== Stagger animation delays ===== */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ===== Button Inset Highlight ===== */
.inset-highlight {
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
}

/* Radiant secondary button — white/15 bg with inset glow */
.btn-secondary-radiant {
  position: relative;
}
.btn-secondary-radiant::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 2px 1px rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

/* ===== Gradient Backgrounds ===== */
.bg-gradient-hero {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
              linear-gradient(to bottom, #09090b, #18181b);
}

.bg-gradient-cta {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #6d28d9 100%);
}

.bg-gradient-card-dark {
  background: linear-gradient(145deg, #27272a 0%, #18181b 100%);
}

/* ===== Ring-based card styling ===== */
.card-ring {
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 0 0 1px rgb(255 255 255 / 0.05);
}

.card-ring:hover {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.1);
}

/* ===== Score bar gradient ===== */
.score-bar-gradient {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

/* ===== Transition Lift ===== */
.transition-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.transition-lift:hover {
  transform: translateY(-1px);
}

.transition-lift:active {
  transform: translateY(0px);
}

/* ===== Testimonials horizontal scroll ===== */
.testimonials-scroll {
  scroll-snap-type: x mandatory;
  scroll-padding-left: max(1.5rem, calc((100vw - 72rem) / 2 + 1.5rem));
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.testimonials-scroll::-webkit-scrollbar {
  display: none;
}

.testimonial-card {
  scroll-snap-align: start;
}

/* ===== Screenshot container ===== */
.screenshot-container {
  --padding: 8px;
  position: relative;
  border-radius: 1.5rem;
}

.screenshot-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.screenshot-inner {
  border-radius: calc(1.5rem - var(--padding));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

/* ===== Bento card fade overlays ===== */
.bento-fade-bottom {
  position: relative;
}

.bento-fade-bottom::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, #09090b 100%);
  pointer-events: none;
}

.bento-fade-top {
  position: relative;
}

.bento-fade-top::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, transparent 50%, #18181b 100%);
  pointer-events: none;
}

/* ===== PlusGrid border pattern ===== */
.plus-grid-borders {
  position: relative;
}

.plus-grid-borders::before {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.plus-grid-borders::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

/* ===== Dot Grid Background ===== */
.dot-grid {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ===== Match Bar Animation ===== */
.match-bar-animate {
  animation: match-bar-fill 1.2s ease-out both;
}

@keyframes match-bar-fill {
  from { width: 0%; }
}

/* ===== Match Ring Animation ===== */
.match-ring-animate {
  animation: match-ring-draw 1.5s ease-out both;
}

@keyframes match-ring-draw {
  from { stroke-dasharray: 0 327; }
}

/* ===== Stagger Fade In Up ===== */
.stagger-fade-in > * {
  opacity: 0;
  transform: translateY(20px);
  animation: stagger-entry 0.5s ease-out forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes stagger-entry {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Dimension nav responsive ===== */
.dim-nav-mobile { display: block; }
.dim-nav-desktop { display: none; }
@media (min-width: 1024px) {
  .dim-nav-mobile { display: none !important; }
  .dim-nav-desktop { display: block !important; }
}

/* ===== Dimension data row accordion ===== */
.dim-row summary { list-style: none; }
.dim-row summary::-webkit-details-marker { display: none; }
.dim-row details + details { border-top: 1px solid #f0ece4; }
.dim-row details[open] > summary { background-color: rgba(76, 29, 149, 0.02); }

/* Smooth open/close animation via grid-template-rows */
.dim-row .dim-row-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease-out, opacity 0.2s ease-out;
  opacity: 0;
}
.dim-row .dim-row-content > div {
  overflow: hidden;
}
.dim-row details[open] .dim-row-content {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* ===== Typewriter cursor ===== */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== Consult Modal Slider ===== */
.consult-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, #4C1D95 0%, #4C1D95 var(--slider-pct, 60%), #e8e4dc var(--slider-pct, 60%), #e8e4dc 100%);
  outline: none;
  margin: 8px 0;
}
.consult-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4C1D95;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(76, 29, 149, 0.25);
  border: 3px solid #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.consult-slider::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 3px 12px rgba(76, 29, 149, 0.35);
}
.consult-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #4C1D95;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(76, 29, 149, 0.25);
  border: 3px solid #fff;
}
.consult-slider::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: #e8e4dc;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ===== Line Clamp ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Light Theme Utilities ===== */
.card-light {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
}
.card-light:hover {
  box-shadow: 0 4px 12px -2px rgb(0 0 0 / 0.08);
}

.btn-pill-black {
  background: #09090b;
  color: #ffffff;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-pill-black:hover {
  background: #27272a;
  transform: translateY(-1px);
}

.btn-pill-purple {
  background: #8b5cf6;
  color: #ffffff;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-pill-purple:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

.quiz-option-light {
  background: #ffffff;
  border: 1.5px solid #e5e5e5;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  transition: all 0.15s ease;
  cursor: pointer;
}
.quiz-option-light:hover {
  border-color: #8b5cf6;
  background: #faf5ff;
}

.glass-white {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===== Quiz Warm Theme Overrides ===== */
/* When question partials render inside .quiz-warm, keep purple accent on warm cream bg */

.quiz-warm .peer:checked ~ div {
  border-color: #4C1D95 !important;
  background-color: rgba(76, 29, 149, 0.05) !important;
}
.quiz-warm .group:hover > div:first-child {
  border-color: rgba(76, 29, 149, 0.4);
  background-color: rgba(76, 29, 149, 0.03);
}
.quiz-warm .group:has(:checked) .flex-shrink-0 {
  border-color: #4C1D95 !important;
  background-color: #4C1D95 !important;
}

/* Radio/checkbox option cards: warm borders + purple hover + active press */
.quiz-warm .quiz-option-light div[class*="border-gray-200"] {
  border-color: #e5e0d8;
  transition: border-color 200ms ease, background-color 200ms ease, transform 160ms ease-out;
}
.quiz-warm .quiz-option-light:hover div[class*="border-gray-200"] {
  border-color: rgba(76, 29, 149, 0.4);
  background-color: rgba(76, 29, 149, 0.04);
}
.quiz-warm .quiz-option-light:active div[class*="border-gray-200"] {
  transform: scale(0.98);
}
.quiz-warm .peer:checked ~ div[class*="border-gray-200"] {
  border-color: #4C1D95 !important;
  background-color: rgba(76, 29, 149, 0.06) !important;
}

/* Text/select inputs: warm bg + purple focus states */
.quiz-warm textarea,
.quiz-warm select,
.quiz-warm input[type="text"] {
  border-color: #e5e0d8 !important;
  background-color: #fffefb !important;
}
.quiz-warm textarea:focus,
.quiz-warm select:focus,
.quiz-warm input[type="text"]:focus {
  border-color: #4C1D95 !important;
  --tw-ring-color: rgba(76, 29, 149, 0.3) !important;
}

/* Slider: purple thumb */
.quiz-warm .slider-purple::-webkit-slider-thumb {
  background: #4C1D95 !important;
  box-shadow: 0 2px 8px rgba(76, 29, 149, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}
.quiz-warm .slider-purple::-webkit-slider-thumb:hover {
  box-shadow: 0 4px 16px rgba(76, 29, 149, 0.4), 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}
.quiz-warm .slider-purple::-moz-range-thumb {
  background: #4C1D95 !important;
  box-shadow: 0 2px 8px rgba(76, 29, 149, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}
.quiz-warm .slider-purple::-moz-range-track {
  background: #e5e0d8 !important;
}

/* Prevent flash-of-content before Stimulus animateIn runs */
.quiz-warm [data-quiz-transition-target="option"] {
  opacity: 0;
  transform: translateY(8px);
}

/* Reduced motion: skip transforms, keep opacity transitions */
@media (prefers-reduced-motion: reduce) {
  .quiz-warm [data-quiz-transition-target="option"],
  .quiz-warm [data-quiz-transition-target="question"] {
    transform: none !important;
  }
}

/* Slider value + percentage accent */
.quiz-warm .text-xpro-purple {
  color: #4C1D95 !important;
}

/* Slider track background */
.quiz-warm .bg-gray-200 {
  background-color: #e5e0d8 !important;
}

/* ===== Dimension Nav Active State ===== */
.dim-nav-active {
  background-color: rgba(76, 29, 149, 0.08) !important;
  color: #4C1D95 !important;
  outline: 1.5px solid rgba(76, 29, 149, 0.25);
  outline-offset: -1.5px;
}
.dim-nav-active .tabular-nums {
  color: #4C1D95 !important;
}

/* ===== V3 Landing Nav ===== */
.v3-nav-scrolled {
  /* pill nav already has frosted glass — just tighten padding on scroll */
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}
