/* ==========================================================================
   INFOPATH V3 — PREMIUM LIQUID GLASS × WATER REFRACTION DESIGN SYSTEM
   Multi-layered optical glass surfaces, refractive prism rims, water droplets,
   cursor-tracking specular highlights, water caustics, and click ripples.
   ========================================================================== */
:root {
    /* Official InfoPath V3 Liquid Glass Palette */
    --lg-deep-ocean: #071C2C;
    --lg-midnight: #0B2940;
    --lg-ocean: #125675;
    --lg-teal: #149B9F;
    --lg-cyan: #48DCE9;
    --lg-aqua: #A5F3FC;
    --lg-frosted-white: #E7F8FF;
    --lg-text-primary: #F1FAFF;
    --lg-text-dark: #102F43;
    --lg-text-secondary: #A8C8D9;

    /* Optical Liquid Glass Variables (Refined — Balanced Refraction, Zero Glare) */
    --lg-blur: blur(20px) saturate(155%) brightness(1.02);
    --lg-blur-heavy: blur(24px) saturate(165%) brightness(1.03);
    --lg-rim-gradient: linear-gradient(
        135deg,
        rgba(231, 248, 255, 0.44) 0%,
        rgba(165, 243, 252, 0.28) 24%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(72, 220, 233, 0.24) 78%,
        rgba(231, 248, 255, 0.36) 100%
    );
    --lg-rim-soft: linear-gradient(
        135deg,
        rgba(231, 248, 255, 0.34) 0%,
        rgba(165, 243, 252, 0.20) 28%,
        rgba(255, 255, 255, 0.04) 56%,
        rgba(72, 220, 233, 0.18) 84%,
        rgba(231, 248, 255, 0.28) 100%
    );
    --lg-shadow-depth:
        0 18px 44px rgba(3, 14, 24, 0.34),
        0 4px 14px rgba(7, 28, 44, 0.22),
        inset 0 1px 0 rgba(231, 248, 255, 0.30),
        inset 0 -8px 18px rgba(72, 220, 233, 0.08);
    --lg-shadow-hover:
        0 22px 50px rgba(3, 14, 24, 0.40),
        0 0 20px rgba(72, 220, 233, 0.12),
        inset 0 1.5px 1px rgba(231, 248, 255, 0.42),
        inset 0 -10px 20px rgba(72, 220, 233, 0.12);
    --lg-ease: cubic-bezier(0.22, 0.68, 0.28, 1);
}

/* Hidden SVG Water Refraction Filter Container */
.ip-svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ==========================================================================
   DECORATIVE WATER CAUSTICS LAYER (ON AURORA BACKGROUND ONLY — NEVER ON TEXT)
   ========================================================================== */
.ip-aurora-caustics {
    position: fixed;
    z-index: 0;
    inset: -8%;
    pointer-events: none;
    opacity: 0.24;
    background:
        radial-gradient(28% 24% at 18% 18%, rgba(165, 243, 252, 0.42) 0%, transparent 64%),
        radial-gradient(32% 28% at 78% 72%, rgba(72, 220, 233, 0.36) 0%, transparent 66%),
        radial-gradient(24% 22% at 52% 38%, rgba(20, 155, 159, 0.30) 0%, transparent 65%);
    filter: url(#ip-water-caustic);
    animation: ip-caustics-flow 26s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes ip-caustics-flow {
    0% {
        transform: translate3d(-1.2%, -0.8%, 0) scale(1);
    }

    100% {
        transform: translate3d(1.6%, 1.2%, 0) scale(1.05);
    }
}

/* ==========================================================================
   REUSABLE LIQUID GLASS SURFACE MIXIN (TRUE TRANSPARENT REFRACTIVE LENS)
   ========================================================================== */
.lg-surface {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(165, 243, 252, 0.22);
    background:
        linear-gradient(
            152deg,
            rgba(231, 248, 255, 0.17) 0%,
            rgba(165, 243, 252, 0.07) 36%,
            rgba(18, 86, 117, 0.22) 72%,
            rgba(7, 28, 44, 0.36) 100%
        );
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    box-shadow: var(--lg-shadow-depth);
    color: var(--lg-text-primary);
}

/* Diagonal Refractive Prism Edge (Always Visible Without Hover) */
.lg-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    padding: 1.4px;
    border-radius: inherit;
    background: var(--lg-rim-gradient);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.64;
    transition: opacity 240ms var(--lg-ease);
}

/* Soft Water-Surface Specular Arc + Subtle Pointer Light (Never Washes Out Text) */
.lg-surface::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background:
        radial-gradient(100% 38% at 50% -14%, rgba(231, 248, 255, 0.13) 0%, rgba(165, 243, 252, 0.04) 44%, transparent 72%),
        radial-gradient(240px circle at var(--lg-x, 18%) var(--lg-y, 12%), rgba(165, 243, 252, 0.12) 0%, rgba(72, 220, 233, 0.04) 44%, transparent 72%);
    pointer-events: none;
    transition: opacity 240ms var(--lg-ease);
}

.lg-surface > * {
    position: relative;
    z-index: 3;
}

.lg-surface:hover::before {
    opacity: 0.82;
}

/* ==========================================================================
   3D GLASS WATER DROPLET ORB (FOR KPI ICONS & FEATURE BADGES)
   ========================================================================== */
.lg-droplet {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.56);
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.86) 0%, rgba(165, 243, 252, 0.36) 24%, rgba(20, 155, 159, 0.30) 64%, rgba(7, 28, 44, 0.44) 100%);
    box-shadow:
        0 8px 18px rgba(4, 18, 30, 0.28),
        inset 0 2px 3px rgba(255, 255, 255, 0.72),
        inset 0 -5px 10px rgba(72, 220, 233, 0.42);
    color: #FFFFFF;
    overflow: hidden;
}

.lg-droplet::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 7px;
    width: 34%;
    height: 22%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.84);
    transform: rotate(-28deg);
    filter: blur(0.6px);
    pointer-events: none;
}

.lg-droplet::after {
    content: "";
    position: absolute;
    bottom: 3px;
    right: 6px;
    width: 38%;
    height: 16%;
    border-radius: 50%;
    background: rgba(165, 243, 252, 0.52);
    filter: blur(1.5px);
    pointer-events: none;
}

/* ==========================================================================
   LIQUID WATER RIPPLE ON CLICK (SPAWNED BY liquid-glass.js)
   ========================================================================== */
.lg-ripple-host {
    position: relative;
    overflow: hidden;
}

.lg-ripple-wave {
    position: absolute;
    z-index: 6;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    border: 1.5px solid rgba(165, 243, 252, 0.78);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.46) 0%, rgba(72, 220, 233, 0.22) 48%, transparent 74%);
    animation: lg-water-ripple 560ms cubic-bezier(0.18, 0.72, 0.24, 1) forwards;
    will-change: transform, opacity;
}

@keyframes lg-water-ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 0.9;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.85);
        opacity: 0;
    }
}

/* ==========================================================================
   ACCESSIBILITY & LOW-END / REDUCED MOTION SAFEGUARDS
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .ip-aurora-caustics {
        animation: none;
        filter: none;
    }

    .lg-ripple-wave {
        display: none;
    }
}

@media (max-width: 767px) {
    /* Reduce expensive SVG filter on mobile GPUs while keeping crisp glass look */
    .ip-aurora-caustics {
        filter: none;
        opacity: 0.20;
    }
}
