/* =========================================================================
   Needibi Serve — Premium Motion System
   Philosophy: smooth, minimal, intentional, fast, elegant.
   Communicates clarity, trust, professionalism and "smart systems".
   All motion respects prefers-reduced-motion and is GPU-friendly.
   ========================================================================= */

:root {
    /* Timing — modern SaaS feel: fast & precise */
    --na-fast: 0.18s;       /* micro UI interactions */
    --na-quick: 0.28s;      /* hover / card */
    --na-page: 0.45s;       /* page transitions */
    --na-reveal: 0.6s;      /* section reveal */
    /* Easing — soft, confident */
    --na-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --na-ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
    --na-spring: cubic-bezier(0.2, 0.9, 0.4, 1.08);
    /* Brand */
    --na-blue: #3551A1;
    --na-gold: #f5b042;
}

/* =========================================================================
   1. PAGE TRANSITION — content flows in, never abruptly appears
   ========================================================================= */
/* Auto-running so page visibility NEVER depends on JS loading successfully. */
html.na-js body:not(.na-splash-on) {
    animation: naPageIn var(--na-page) var(--na-ease-soft) both;
}
html.na-js body.na-splash-on {
    animation: none;
    opacity: 1;
    transform: none;
}
@keyframes naPageIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* Soft exit when navigating away (premium app-like feel) */
body.na-page-out {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity var(--na-fast) var(--na-ease), transform var(--na-fast) var(--na-ease);
}

/* =========================================================================
   2. SCROLL REVEAL — fade up, blur reveal, stagger
   Hidden state only applies when JS is active (no content lost if JS fails).
   ========================================================================= */
html.na-js [data-na-reveal] {
    opacity: 0;
    will-change: opacity, transform, filter;
    transition: opacity var(--na-reveal) var(--na-ease-soft),
                transform var(--na-reveal) var(--na-ease-soft),
                filter var(--na-reveal) var(--na-ease-soft);
}

/* Public website: never leave landing content invisible after splash */
#ns-main [data-na-reveal],
#ns-main .fade-up,
.na-page-content [data-na-reveal],
.na-page-content .fade-up,
body.na-landing-ready #ns-main .fade-up,
body.na-splash-resolved #ns-main .fade-up,
body.na-landing-ready #ns-main [data-na-reveal],
body.na-splash-resolved #ns-main [data-na-reveal],
body.na-landing-ready #ns-main section,
body.na-splash-resolved #ns-main section {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: none !important;
}
html.na-js [data-na-reveal="fade-up"]   { transform: translateY(26px); }
html.na-js [data-na-reveal="fade-down"] { transform: translateY(-26px); }
html.na-js [data-na-reveal="fade-left"] { transform: translateX(28px); }
html.na-js [data-na-reveal="fade-right"]{ transform: translateX(-28px); }
html.na-js [data-na-reveal="zoom"]      { transform: scale(0.96); }
html.na-js [data-na-reveal="blur"]      { filter: blur(10px); transform: translateY(14px); }

html.na-js [data-na-reveal].na-in {
    opacity: 1;
    transform: none;
    filter: none;
}

/* =========================================================================
   3. CARD HOVER — slight lift, soft shadow, subtle border glow
   ========================================================================= */
.na-card,
.need-card,
.offer-card,
.card-hover,
.need-card-landing {
    transition: transform var(--na-quick) var(--na-ease),
                box-shadow var(--na-quick) var(--na-ease),
                border-color var(--na-quick) var(--na-ease);
    will-change: transform;
}
.na-card:hover,
.need-card:hover,
.offer-card:hover,
.card-hover:hover,
.need-card-landing:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 22px 40px -18px rgba(32, 88, 230, 0.32),
                0 8px 18px -10px rgba(15, 23, 42, 0.18);
    border-color: rgba(32, 88, 230, 0.28);
}
/* Category cards are blue — glow gold on hover for contrast */
.category-card {
    transition: transform var(--na-quick) var(--na-ease),
                box-shadow var(--na-quick) var(--na-ease);
}
.category-item:hover .category-card {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 22px 38px -16px rgba(245, 176, 66, 0.45);
}

/* =========================================================================
   4. BUTTON MICRO-INTERACTIONS — responsive scale + soft ripple
   ========================================================================= */
.btn-primary,
.btn-gold,
.btn-outline-primary,
.na-btn {
    position: relative;
    overflow: hidden;
    transition: transform var(--na-fast) var(--na-spring),
                box-shadow var(--na-fast) var(--na-ease),
                background-color var(--na-fast) var(--na-ease),
                filter var(--na-fast) var(--na-ease);
}
.btn-primary:hover,
.btn-gold:hover,
.btn-outline-primary:hover,
.na-btn:hover {
    transform: translateY(-2px) scale(1.03);
    filter: brightness(1.03);
}
.btn-primary:active,
.btn-gold:active,
.btn-outline-primary:active,
.na-btn:active {
    transform: translateY(0) scale(0.98);
}
/* Soft ripple injected by JS */
.na-ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    animation: naRipple 0.6s var(--na-ease-soft);
}
@keyframes naRipple {
    to { transform: scale(2.6); opacity: 0; }
}

/* =========================================================================
   5. MICRO-INTERACTIONS — inputs glow softly, toggles slide
   ========================================================================= */
.na-input,
input.na-glow,
textarea.na-glow,
select.na-glow {
    transition: border-color var(--na-fast) var(--na-ease),
                box-shadow var(--na-fast) var(--na-ease);
}
.na-input:focus,
input.na-glow:focus,
textarea.na-glow:focus,
select.na-glow:focus {
    outline: none;
    border-color: var(--na-blue);
    box-shadow: 0 0 0 4px rgba(32, 88, 230, 0.12);
}

/* =========================================================================
   6. LIVE STATUS INDICATORS — soft pulsing dots (online / verified)
   ========================================================================= */
.na-pulse-dot {
    position: relative;
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
}
.na-pulse-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: naPulse 1.8s var(--na-ease) infinite;
}
.na-pulse-dot.is-blue  { background: var(--na-blue); }
.na-pulse-dot.is-gold  { background: var(--na-gold); }
.na-pulse-dot.is-amber { background: #f59e0b; }
@keyframes naPulse {
    0%   { transform: scale(1);   opacity: 0.6; }
    70%  { transform: scale(2.6); opacity: 0; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* =========================================================================
   7. SKELETON LOADING — shimmer placeholders (feels advanced)
   ========================================================================= */
.na-skeleton {
    position: relative;
    overflow: hidden;
    background: #eef2f9;
    border-radius: 10px;
}
.na-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.65) 50%,
        rgba(255, 255, 255, 0) 100%);
    animation: naShimmer 1.4s infinite;
}
@keyframes naShimmer {
    100% { transform: translateX(100%); }
}

/* =========================================================================
   8. MULTI-STEP PROGRESS — guided, intelligent request flow
   ========================================================================= */
.na-steps {
    display: flex;
    align-items: flex-start;
    gap: 0;
}
.na-step {
    flex: 1;
    text-align: center;
    position: relative;
}
.na-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e2e8f0;
    z-index: 0;
}
.na-step:not(:last-child) .na-step-line-fill {
    position: absolute;
    top: 18px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--na-blue);
    z-index: 1;
    transition: width 0.5s var(--na-ease-soft);
}
.na-step.is-done:not(:last-child) .na-step-line-fill { width: 100%; }
.na-step-dot {
    position: relative;
    z-index: 2;
    width: 38px;
    height: 38px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all var(--na-quick) var(--na-spring);
}
.na-step.is-active .na-step-dot {
    border-color: var(--na-blue);
    color: var(--na-blue);
    box-shadow: 0 0 0 5px rgba(32, 88, 230, 0.12);
    transform: scale(1.06);
}
.na-step.is-done .na-step-dot {
    background: var(--na-blue);
    border-color: var(--na-blue);
    color: #fff;
}
.na-step.is-done .na-step-dot .na-check {
    animation: naCheckPop var(--na-quick) var(--na-spring);
}
@keyframes naCheckPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
.na-step-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}
.na-step.is-active .na-step-label,
.na-step.is-done .na-step-label { color: #0f172a; }

/* =========================================================================
   9. PREMIUM SURFACES — glassmorphism (light use), soft shadows, mesh
   ========================================================================= */
.na-glass {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
}
.na-shadow-soft {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                0 8px 24px -8px rgba(15, 23, 42, 0.12);
}
.na-shadow-float {
    box-shadow: 0 18px 50px -20px rgba(32, 88, 230, 0.35);
}
/* Subtle gradient mesh — startup-grade premium background */
.na-mesh {
    position: relative;
    isolation: isolate;
}
.na-mesh::before {
    content: "";
    position: absolute;
    inset: -10%;
    z-index: -1;
    background:
        radial-gradient(40% 40% at 20% 25%, rgba(32, 88, 230, 0.16), transparent 60%),
        radial-gradient(35% 35% at 80% 20%, rgba(245, 176, 66, 0.14), transparent 60%),
        radial-gradient(45% 45% at 65% 80%, rgba(32, 88, 230, 0.10), transparent 60%);
    filter: blur(10px);
    animation: naMeshFloat 18s var(--na-ease) infinite alternate;
}
@keyframes naMeshFloat {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(2%, -2%, 0) scale(1.05); }
    100% { transform: translate3d(-2%, 2%, 0) scale(1.02); }
}
/* Floating gradient glow — for hero backgrounds */
.na-hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
    animation: naGlowFloat 14s var(--na-ease) infinite alternate;
}
@keyframes naGlowFloat {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(24px, -20px) scale(1.12); }
}

/* =========================================================================
   10. MODALS — background softly blurs, modal fades upward
   ========================================================================= */
.na-modal-backdrop {
    opacity: 0;
    backdrop-filter: blur(0px);
    transition: opacity var(--na-quick) var(--na-ease),
                backdrop-filter var(--na-quick) var(--na-ease);
}
.na-modal-backdrop.na-open {
    opacity: 1;
    backdrop-filter: blur(6px);
}
.na-modal {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity var(--na-quick) var(--na-ease-soft),
                transform var(--na-quick) var(--na-ease-soft);
}
.na-modal-backdrop.na-open .na-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* =========================================================================
   11. ROTATING / TYPING TEXT — clean word rotation
   ========================================================================= */
.na-rotate-word {
    color: var(--na-blue);
    font-weight: 800;
}
.na-rotate-word.na-swap {
    animation: naWordSwap 0.4s var(--na-ease-soft);
}
@keyframes naWordSwap {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}
.na-caret {
    display: inline-block;
    width: 2px;
    margin-left: 2px;
    background: var(--na-gold);
    animation: naCaret 1s steps(1) infinite;
}
@keyframes naCaret {
    50% { opacity: 0; }
}

/* =========================================================================
   12. TOAST / NOTIFICATION — slides in elegantly
   ========================================================================= */
.na-toast-enter {
    animation: naToastIn var(--na-quick) var(--na-ease-soft) both;
}
@keyframes naToastIn {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* =========================================================================
   13. SPLASH / PRELOADER — premium first-visit experience
   Centered logo inside a rotating conic-gradient ring with a soft
   progress bar. Brand-coloured, calm, fast (max ~1.4s on a normal load).
   ========================================================================= */
.na-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 28% 22%, rgba(32, 88, 230, 0.10), transparent 55%),
        radial-gradient(circle at 78% 80%, rgba(245, 176, 66, 0.10), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    opacity: 1;
    transition: opacity 0.55s var(--na-ease-soft),
                visibility 0.55s var(--na-ease-soft);
    will-change: opacity;
}
.na-splash.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
/* When user has visited this session already, the splash is removed
   instantly (page-transition fade still plays). */
html[data-na-splash="skip"] .na-splash {
    display: none !important;
}
/* Lock body scroll while splash visible. */
body.na-splash-on { overflow: hidden; }

.na-splash-stage {
    text-align: center;
    transform: translateY(-8px);
}
.na-splash-ring {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Soft outer glow that breathes */
.na-splash-glow {
    position: absolute;
    inset: -22px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(32, 88, 230, 0.22), transparent 60%),
        radial-gradient(circle at 70% 30%, rgba(245, 176, 66, 0.18), transparent 65%);
    filter: blur(18px);
    animation: naBreathe 2.6s var(--na-ease) infinite alternate;
    z-index: 0;
}
@keyframes naBreathe {
    0%   { opacity: 0.55; transform: scale(1); }
    100% { opacity: 1;    transform: scale(1.08); }
}

/* SVG ring — the main "circle loading" animation */
.na-splash-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    animation: naRingSpin 2.6s linear infinite;
    transform-origin: center center;
}
@keyframes naRingSpin {
    to { transform: rotate(360deg); }
}
/* The animated arc — uses stroke-dasharray "draw" effect for visible motion */
.na-splash-arc {
    stroke-dasharray: 220 380;        /* visible arc length / gap */
    stroke-dashoffset: 0;
    transform-origin: center center;
    animation: naArcDash 1.8s var(--na-ease) infinite;
    filter: drop-shadow(0 4px 10px rgba(32, 88, 230, 0.35));
}
@keyframes naArcDash {
    0%   { stroke-dasharray: 30 580;  stroke-dashoffset: 0; }
    50%  { stroke-dasharray: 360 250; stroke-dashoffset: -120; }
    100% { stroke-dasharray: 30 580;  stroke-dashoffset: -600; }
}
/* Pulsing accent dot at the top of the ring (animates opacity only —
   broadly supported across browsers; r animation via CSS is Safari-iffy). */
.na-splash-dot {
    filter: drop-shadow(0 0 6px rgba(245, 176, 66, 0.85));
    transform-origin: 110px 14px;
    animation: naDotPulse 1.4s var(--na-ease) infinite;
}
@keyframes naDotPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

/* Inner white disc that holds the logo (clearly inside the ring) */
.na-splash-disc {
    position: relative;
    z-index: 2;
    width: 152px;
    height: 152px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow:
        0 22px 46px -16px rgba(32, 88, 230, 0.35),
        inset 0 0 0 1px rgba(32, 88, 230, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: naLogoIn 0.7s var(--na-spring) both;
    overflow: hidden;
}
@keyframes naLogoIn {
    0%   { opacity: 0; transform: scale(0.82); }
    100% { opacity: 1; transform: scale(1); }
}
.na-splash-logo {
    max-width: 108px;
    max-height: 108px;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: naLogoPulse 2.4s var(--na-ease) infinite;
}
@keyframes naLogoPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* Three jumping dots beneath — universal "loading…" indicator */
.na-splash-dots {
    margin: 14px auto 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.na-splash-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--na-blue);
    opacity: 0.4;
    animation: naDotsBounce 1.2s var(--na-ease) infinite;
}
.na-splash-dots span:nth-child(2) {
    background: #6b86d4;
    animation-delay: 0.15s;
}
.na-splash-dots span:nth-child(3) {
    background: var(--na-gold);
    animation-delay: 0.3s;
}
@keyframes naDotsBounce {
    0%, 100% { transform: translateY(0);    opacity: 0.4; }
    50%      { transform: translateY(-6px); opacity: 1;   }
}

.na-splash-brand {
    margin-top: 22px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #0f172a;
    animation: naSplashFadeUp 0.6s var(--na-ease-soft) 0.15s both;
}
.na-splash-tag {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
    animation: naSplashFadeUp 0.6s var(--na-ease-soft) 0.28s both;
}
@keyframes naSplashFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.na-splash-bar {
    margin: 18px auto 0;
    width: 180px;
    height: 4px;
    background: rgba(32, 88, 230, 0.10);
    border-radius: 999px;
    overflow: hidden;
    animation: naSplashFadeUp 0.6s var(--na-ease-soft) 0.4s both;
}
.na-splash-bar > i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--na-blue), var(--na-gold));
    border-radius: 999px;
    transition: width 0.35s var(--na-ease-soft);
    box-shadow: 0 0 10px rgba(32, 88, 230, 0.45);
}

/* Reduced motion: keep splash, but kill spinning / pulsing. */
@media (prefers-reduced-motion: reduce) {
    .na-splash-svg,
    .na-splash-arc,
    .na-splash-dot,
    .na-splash-glow,
    .na-splash-logo,
    .na-splash-disc,
    .na-splash-brand,
    .na-splash-tag,
    .na-splash-bar,
    .na-splash-dots span { animation: none !important; }
    .na-splash-arc { stroke-dasharray: 480 200; }
}

/* =========================================================================
   14. MODERN POLISH — small refinements that lift the whole UI
   ========================================================================= */

/* Header gets a tiny "scrolled" shadow boost via JS class .na-scrolled */
header.fixed-header.na-scrolled {
    background-color: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 8px 30px -16px rgba(15, 23, 42, 0.18);
}

/* (Nav link hover styling now lives in headersite.php — .ns-nav-link pill hover;
   the old underline-grow effect was removed with the professional header redesign.) */

/* Smoother focus rings everywhere (modern SaaS feel) */
a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(32, 88, 230, 0.28);
    border-radius: 8px;
}

/* Refined image hover for slider/cards (very subtle Ken-Burns) */
.na-slow-zoom { transition: transform 6s var(--na-ease); }
.na-slow-zoom:hover { transform: scale(1.04); }

/* Make all anchor pointers feel snappier */
a, button { -webkit-tap-highlight-color: transparent; }

/* =========================================================================
   ACCESSIBILITY — respect reduced motion (kills all non-essential motion)
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    html.na-js body,
    html.na-js [data-na-reveal] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        animation: none !important;
        transition: none !important;
    }
    .na-pulse-dot::after,
    .na-mesh::before,
    .na-hero-glow,
    .na-skeleton::after {
        animation: none !important;
    }
    * {
        scroll-behavior: auto !important;
    }
}
