/* ==========================================================================
   CUREX24 — Premium UI Layer
   Purely additive polish on top of styles.css, enhancements.css,
   and advanced-animations.css. No existing rules are modified.

   Goals:
   - Move the visual quality from "polished SaaS" to "top-tier premium SaaS"
     (Stripe / Linear / Vercel / Anthropic aesthetic).
   - Zero new JavaScript. Pure CSS, respects prefers-reduced-motion.

   Sections:
     1.  Premium serif display accent (Fraunces) for .serif-accent
     2.  Hero: mesh gradient + grid pattern + soft edge fade
     3.  Hero panel: glass + conic halo border
     4.  Buttons: gradient sheen + multi-layer depth
     5.  Section chips + heading underline accent
     6.  Feature 3D cards: animated conic gradient border
     7.  Offer card: rainbow border + radial glow
     8.  Workflow numbers: gradient ring + hover lift
     9.  Marquee edge fade
    10.  Premium scrollbar + selection
    11.  Footer brand wordmark gradient
    12.  Card micro-polish (roles, automation, trust, highlights)
   ========================================================================== */

/* Premium serif display (Fraunces) is loaded via a <link> tag in index.html
   for better render performance — avoid the render-blocking CSS @import. */

:root {
  --premium-serif: "Fraunces", "Iowan Old Style", "Georgia", "Times New Roman", serif;

  /* Premium gradient stops (cool, calm, trustworthy) */
  --pg-1: #2563eb;   /* primary blue */
  --pg-2: #0ea5e9;   /* sky */
  --pg-3: #14b8a6;   /* teal */
  --pg-4: #7c3aed;   /* violet accent */

  --premium-grad: linear-gradient(120deg, var(--pg-1) 0%, var(--pg-2) 35%, var(--pg-3) 70%, var(--pg-4) 100%);
  --premium-grad-soft: linear-gradient(120deg,
    rgba(37,99,235,0.10) 0%,
    rgba(14,165,233,0.08) 35%,
    rgba(20,184,166,0.08) 70%,
    rgba(124,58,237,0.10) 100%);
}

/* Headline accent — promote inherited inline span to a true premium serif.
   Higher specificity than .serif-accent in styles.css so this wins. */
h1 .serif-accent,
h2 .serif-accent,
h3 .serif-accent {
  font-family: var(--premium-serif);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.01em;
  font-feature-settings: "ss01", "ss02", "calt";
  font-optical-sizing: auto;
  background: linear-gradient(120deg, #1d4ed8 0%, #0ea5e9 45%, #14b8a6 100%);
  -webkit-background-clip: text;
          background-clip: text;
  /* Solid fallback for browsers without background-clip:text */
  color: #1d4ed8;
  padding-right: 0.04em; /* prevent italic clip on the right */
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  h1 .serif-accent,
  h2 .serif-accent,
  h3 .serif-accent {
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* ---------- 2. HERO — mesh gradient + grid pattern ----------------------- */
.hero {
  /* Add an extra layered overlay via box-shadow-less ::before approach:
     we layer the new visuals using a wrapper-less technique by stacking
     two backgrounds onto the .hero (additive — the original `background`
     declaration still applies; this rule has the same specificity but
     comes later in the cascade and so overrides it). */
  background:
    /* 1. Soft conic mesh — three colored radial blobs */
    radial-gradient(60% 50% at 12% 18%, rgba(124, 58, 237, 0.12), transparent 60%),
    radial-gradient(50% 40% at 88% 10%, rgba(14, 165, 233, 0.16), transparent 60%),
    radial-gradient(55% 60% at 75% 95%, rgba(20, 184, 166, 0.10), transparent 65%),
    /* 2. Subtle grid pattern (dark dot grid on light) */
    radial-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    /* 3. Base vertical wash (kept similar to the original) */
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  background-size:
    auto, auto, auto,
    22px 22px,
    auto;
  background-position:
    0 0, 0 0, 0 0,
    0 0,
    0 0;
}

/* Soft top-edge sheen + bottom fade so the hero feels like a glass surface */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, transparent 12%),
    linear-gradient(0deg,   var(--bg) 0%, transparent 14%);
  z-index: 0;
}

/* ---------- 3. HERO PANEL — glassy depth + conic halo border ------------- */
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.78) 100%);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 30px 60px -20px rgba(15, 23, 42, 0.22),
    0 12px 24px -10px rgba(37, 99, 235, 0.12);
}

/* Animated conic halo behind the panel for a premium product-card feel */
.hero-grid .panel { position: relative; isolation: isolate; }
.hero-grid .panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from 0deg,
    rgba(37, 99, 235, 0.55),
    rgba(14, 165, 233, 0.35),
    rgba(20, 184, 166, 0.55),
    rgba(124, 58, 237, 0.35),
    rgba(37, 99, 235, 0.55)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-grid .panel::before { animation: premium-spin 16s linear infinite; }
}
@keyframes premium-spin {
  to { transform: rotate(360deg); }
}

/* Panel feed rows: lift + ring on hover (was a flat translate) */
.panel-feed li {
  transition:
    transform 0.25s var(--ease, ease),
    box-shadow 0.25s var(--ease, ease),
    background 0.25s var(--ease, ease),
    border-color 0.25s var(--ease, ease);
}
.panel-feed li:hover {
  transform: translateX(2px) translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.25);
}

/* ---------- 4. BUTTONS — gradient sheen sweep + premium depth ------------ */
.btn-primary {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(120deg, #1d4ed8 0%, #2563eb 45%, #0ea5e9 100%);
  background-size: 180% 180%;
  background-position: 0% 50%;
  border-color: transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 0 0 1px rgba(37, 99, 235, 0.35),
    0 8px 18px -6px rgba(37, 99, 235, 0.45),
    0 2px 4px rgba(15, 23, 42, 0.10);
  transition:
    background-position 0.45s var(--ease, ease),
    box-shadow 0.25s var(--ease, ease),
    transform 0.2s var(--ease, ease);
}
.btn-primary:hover {
  background-image: linear-gradient(120deg, #1d4ed8 0%, #2563eb 35%, #0ea5e9 75%, #14b8a6 100%);
  background-position: 100% 50%;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 0 0 1px rgba(37, 99, 235, 0.45),
    0 14px 28px -8px rgba(37, 99, 235, 0.55),
    0 4px 10px rgba(15, 23, 42, 0.12);
}
/* Sheen sweep */
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 40%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.18) 60%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.btn-primary:hover::after { left: 130%; }

/* Secondary button — refined glass + crisper ring */
.btn-secondary {
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 6px 14px -8px rgba(15, 23, 42, 0.18);
  transition: box-shadow 0.25s var(--ease, ease), transform 0.2s var(--ease, ease), border-color 0.25s var(--ease, ease);
}
.btn-secondary:hover {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 0 0 3px rgba(37, 99, 235, 0.08),
    0 10px 20px -10px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

/* WhatsApp CTA — keep brand green, add gentle depth */
.btn-whatsapp {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 8px 18px -8px rgba(37, 211, 102, 0.45);
}

/* ---------- 5. SECTION CHIPS + heading underline accent ----------------- */
.section-tag,
.eyebrow {
  position: relative;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(120deg, rgba(37,99,235,0.55), rgba(20,184,166,0.55) 50%, rgba(124,58,237,0.55)) border-box;
  border: 1px solid transparent;
  color: var(--primary, #2563eb);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 14px -10px rgba(37, 99, 235, 0.25);
}

/* Section H2 underline accent — small, premium */
.section-head h2 {
  position: relative;
  padding-bottom: 0.6rem;
}
.section-head h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  border-radius: 999px;
  background: var(--premium-grad);
  background-size: 200% 100%;
  opacity: 0.9;
}
@media (prefers-reduced-motion: no-preference) {
  .section-head h2::after { animation: premium-shift 6s ease-in-out infinite; }
}
@keyframes premium-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ---------- 6. FEATURE 3D CARDS — animated conic border on hover -------- */
.feature3d-inner {
  position: relative;
  isolation: isolate;
  transition:
    box-shadow 0.35s var(--ease, ease),
    border-color 0.35s var(--ease, ease),
    transform 0.35s var(--ease, ease);
}
.feature3d-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--feat-angle, 0deg),
    rgba(37, 99, 235, 0.7),
    rgba(14, 165, 233, 0.0) 20%,
    rgba(20, 184, 166, 0.7) 40%,
    rgba(20, 184, 166, 0.0) 60%,
    rgba(124, 58, 237, 0.7) 80%,
    rgba(37, 99, 235, 0.0) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease, ease);
  pointer-events: none;
  z-index: 0;
}
.feature3d:hover .feature3d-inner {
  box-shadow:
    0 20px 40px -16px rgba(37, 99, 235, 0.22),
    0 8px 16px -8px rgba(15, 23, 42, 0.10);
}
.feature3d:hover .feature3d-inner::before { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .feature3d:hover .feature3d-inner::before { animation: premium-spin 9s linear infinite; }
}

/* Feature badge — gentle lift in 3D space */
.feature3d-badge {
  box-shadow:
    inset 0 0 0 1px rgba(37, 99, 235, 0.12),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Premium bullet — gradient instead of flat blue */
.feature3d ul li::before {
  background: var(--premium-grad);
  background-size: 200% 100%;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* ---------- 7. OFFER CARD — animated rainbow border + radial glow ------- */
.offer-card {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(37, 99, 235, 0.05), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(20, 184, 166, 0.05), transparent 55%),
    var(--surface, #fff);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 30px 60px -25px rgba(15, 23, 42, 0.22),
    0 12px 24px -10px rgba(37, 99, 235, 0.10);
}
.offer-card::before {
  /* Override the original 4px top stripe with a full gradient border */
  content: "";
  position: absolute;
  inset: 0;
  height: auto;        /* unset the original `height: 4px` */
  bottom: 0;
  background: var(--premium-grad);
  background-size: 300% 300%;
  border-radius: inherit;
  padding: 1.5px;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  z-index: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .offer-card::before { animation: premium-shift 8s ease-in-out infinite; }
}

/* Re-introduce the top accent bar as a subtle inner glow */
.offer-card .offer-content { position: relative; z-index: 1; }

/* Premium check — gradient instead of flat blue */
.offer-check {
  background: var(--premium-grad);
  background-size: 200% 100%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 4px 10px -4px rgba(37, 99, 235, 0.45);
}

/* ---------- 8. WORKFLOW step numbers — gradient ring + lift ------------- */
.wf-step {
  position: relative;
  transition:
    transform 0.3s var(--ease, ease),
    box-shadow 0.3s var(--ease, ease);
}
.wf-step:hover { transform: translateY(-4px); }

.wf-step .wf-num {
  position: relative;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--premium-grad) border-box;
  border: 2px solid transparent;
  color: var(--primary, #2563eb);
  box-shadow:
    0 4px 12px -4px rgba(37, 99, 235, 0.35),
    0 1px 2px rgba(15, 23, 42, 0.05);
}

/* ---------- 9. MARQUEE — premium edge fade masks ------------------------ */
.marquee {
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 8%,
    #000 92%,
    transparent 100%
  );
          mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 8%,
    #000 92%,
    transparent 100%
  );
}

/* ---------- 10. PREMIUM SCROLLBAR + selection --------------------------- */
@media (pointer: fine) {
  *::-webkit-scrollbar { width: 12px; height: 12px; }
  *::-webkit-scrollbar-track {
    background: transparent;
  }
  *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2563eb, #14b8a6);
    border: 3px solid var(--bg);
    border-radius: 999px;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #1d4ed8, #0ea5e9);
  }
  html {
    scrollbar-width: thin;
    scrollbar-color: #2563eb transparent;
  }
}

/* ---------- 11. FOOTER brand wordmark — subtle gradient ----------------- */
.brand-name {
  background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 60%, #0f766e 100%);
  -webkit-background-clip: text;
          background-clip: text;
  /* Solid fallback for browsers without background-clip:text */
  color: #0f172a;
  letter-spacing: -0.018em;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name {
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* ---------- 12. Card micro-polish: roles, automation, trust, highlights -- */
.card.mini {
  transition:
    transform 0.3s var(--ease, ease),
    box-shadow 0.3s var(--ease, ease),
    border-color 0.3s var(--ease, ease);
}
.card.mini:hover {
  transform: translateY(-3px);
  box-shadow:
    0 18px 30px -16px rgba(37, 99, 235, 0.20),
    0 6px 14px -8px rgba(15, 23, 42, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

/* Trust cards — slightly more presence */
.trust-card {
  background:
    linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 24px -16px rgba(15, 23, 42, 0.18);
}
.trust-card .trust-icon {
  background: var(--premium-grad-soft);
}

/* FAQ — premium accordion frame */
.faq-list details {
  transition:
    box-shadow 0.25s var(--ease, ease),
    border-color 0.25s var(--ease, ease),
    transform 0.25s var(--ease, ease);
}
.faq-list details[open] {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 24px -16px rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.30);
}

/* Lead form — premium glass surface */
.lead-form {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.86) 100%);
  backdrop-filter: blur(12px) saturate(1.05);
  -webkit-backdrop-filter: blur(12px) saturate(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 30px 60px -25px rgba(15, 23, 42, 0.20),
    0 12px 24px -12px rgba(37, 99, 235, 0.10);
}
.lead-form input:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.12),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

/* WhatsApp floating button — premium pulse ring */
.whatsapp-float {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 14px 28px -10px rgba(37, 211, 102, 0.55),
    0 4px 10px rgba(15, 23, 42, 0.12);
}
.whatsapp-float::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.45);
}
@media (prefers-reduced-motion: no-preference) {
  .whatsapp-float::after { animation: premium-wa-pulse 2.4s ease-out infinite; }
}
@keyframes premium-wa-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(37, 211, 102, 0.45); }
  70%  { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0   rgba(37, 211, 102, 0); }
}

/* ---------- Reduced motion safety --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-grid .panel::before,
  .section-head h2::after,
  .feature3d:hover .feature3d-inner::before,
  .offer-card::before,
  .whatsapp-float::after {
    animation: none !important;
  }
}

/* ---------- Mobile guards ----------------------------------------------- */
@media (max-width: 720px) {
  .hero::after { display: none; } /* keep mobile hero crisp & light */
  .hero {
    /* drop the dot grid on small screens to keep things calm */
    background:
      radial-gradient(60% 50% at 0% 0%, rgba(124, 58, 237, 0.10), transparent 60%),
      radial-gradient(60% 50% at 100% 0%, rgba(14, 165, 233, 0.14), transparent 60%),
      linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  }
  .hero-grid .panel::before { opacity: 0.35; }
}
