html, body {
    overflow-x: clip;
    max-width: 100vw;
}

/* ======================================================== */
/* TPMB ISMIASIH - CORE & SOFT 3D PREMIUM STYLESHEET        */
/* ======================================================== */

/* Prevent aggressive auto-zoom / text inflation on Android browsers */
html, body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Modal Overlay Utilities to Guarantee Solid Open/Close behavior */
.modal-overlay.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.modal-overlay.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Smooth touch scrolling inside mobile modals */
.modal-scrollable-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
}

@layer utilities {
    .backdrop-blur-md {
        backdrop-filter: blur(12px);
    }
}

/* Smooth Scrolling & Anchor Offset for Sticky Header */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Subtle animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* ======================================================== */
/* SOFT 3D PREMIUM DESIGN SYSTEM TOKENS                     */
/* ======================================================== */
:root {
    /* Timing & Tactile Physics */
    --ease-soft-3d: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-soft-3d: 200ms;
    
    /* 1. Primary Teal 3D Shadow Layers */
    --shadow-3d-primary: 
        0 1px 2px rgba(225, 29, 72, 0.20),
        0 4px 12px -1px rgba(225, 29, 72, 0.36),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-3d-primary-hover: 
        0 2px 4px rgba(225, 29, 72, 0.22),
        0 8px 22px -2px rgba(225, 29, 72, 0.44),
        0 3px 8px -2px rgba(0, 0, 0, 0.08);
    --shadow-3d-primary-active: 
        0 1px 3px rgba(225, 29, 72, 0.25),
        inset 0 1px 3px rgba(0, 0, 0, 0.22);

    /* 2. Secondary White/Slate 3D Shadow Layers */
    --shadow-3d-secondary: 
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 3px 10px -1px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-3d-secondary-hover: 
        0 2px 5px rgba(0, 0, 0, 0.06),
        0 7px 18px -2px rgba(0, 0, 0, 0.11),
        0 2px 5px rgba(0, 0, 0, 0.04);
    --shadow-3d-secondary-active: 
        0 1px 2px rgba(0, 0, 0, 0.04),
        inset 0 1px 3px rgba(0, 0, 0, 0.09);

    /* 3. Emerald WhatsApp 3D Shadow Layers */
    --shadow-3d-emerald: 
        0 1px 2px rgba(16, 185, 129, 0.20),
        0 4px 14px -1px rgba(16, 185, 129, 0.38),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-3d-emerald-hover: 
        0 2px 5px rgba(16, 185, 129, 0.24),
        0 8px 22px -2px rgba(16, 185, 129, 0.45),
        0 4px 8px -2px rgba(0, 0, 0, 0.08);
    --shadow-3d-emerald-active: 
        0 1px 3px rgba(16, 185, 129, 0.25),
        inset 0 1px 3px rgba(0, 0, 0, 0.22);
}

/* Base Soft 3D Element */
.btn-soft-3d {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: transform var(--duration-soft-3d) var(--ease-soft-3d),
                box-shadow var(--duration-soft-3d) var(--ease-soft-3d),
                background var(--duration-soft-3d) var(--ease-soft-3d),
                border-color var(--duration-soft-3d) var(--ease-soft-3d),
                color var(--duration-soft-3d) var(--ease-soft-3d);
    -webkit-tap-highlight-color: transparent;
}

.btn-soft-3d:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.45), var(--shadow-3d-primary) !important;
}

/* 1. Primary Soft 3D Button (Brand Teal) */
.btn-soft-3d-primary {
    background: linear-gradient(180deg, #f43f5e 0%, #be185d 100%);
    color: #ffffff !important;
    border: 1px solid #be185d;
    border-bottom: 2.5px solid #9f1239;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 
                inset 0 -1px 0 rgba(0, 0, 0, 0.15),
                var(--shadow-3d-primary);
}

.btn-soft-3d-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #fb7185 0%, #be185d 100%);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 
                inset 0 -1px 0 rgba(0, 0, 0, 0.18),
                var(--shadow-3d-primary-hover);
}

.btn-soft-3d-primary:active:not(:disabled) {
    transform: translateY(1.5px);
    border-bottom-width: 1px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25),
                var(--shadow-3d-primary-active);
}

/* 2. Secondary Soft 3D Button (Warm White / Slate) */
.btn-soft-3d-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
    box-shadow: inset 0 1px 0 #ffffff, 
                inset 0 -1px 0 rgba(0, 0, 0, 0.04),
                var(--shadow-3d-secondary);
}

.btn-soft-3d-secondary:hover:not(:disabled) {
    background: #ffffff;
    color: #0d9488;
    border-color: #cbd5e1;
    border-bottom-color: #94a3b8;
    transform: translateY(-1.5px);
    box-shadow: inset 0 1px 0 #ffffff,
                var(--shadow-3d-secondary-hover);
}

.btn-soft-3d-secondary:active:not(:disabled) {
    transform: translateY(1px);
    border-bottom-width: 1px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.10),
                var(--shadow-3d-secondary-active);
}

/* 3. Emerald Soft 3D Button (WhatsApp Direct) */
.btn-soft-3d-emerald {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    border: 1px solid #047857;
    border-bottom: 2.5px solid #065f46;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 
                inset 0 -1px 0 rgba(0, 0, 0, 0.15),
                var(--shadow-3d-emerald);
}

.btn-soft-3d-emerald:hover:not(:disabled) {
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48), 
                var(--shadow-3d-emerald-hover);
}

.btn-soft-3d-emerald:active:not(:disabled) {
    transform: translateY(1.5px);
    border-bottom-width: 1px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25),
                var(--shadow-3d-emerald-active);
}

/* 4. Subtle Micro 3D Button (Copy Buttons, Badges) */
.btn-soft-3d-subtle {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    color: #334155;
    border: 1px solid #cbd5e1;
    border-bottom: 1.5px solid #94a3b8;
    border-radius: 0.5rem;
    box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-soft-3d-subtle:hover {
    background: #ffffff;
    color: #0d9488;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 #ffffff, 0 3px 6px -1px rgba(0, 0, 0, 0.08);
}

.btn-soft-3d-subtle:active {
    transform: translateY(0.5px);
    border-bottom-width: 1px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* 5. Desktop Navbar Menu Items Soft 3D */
.nav-link-soft {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.625rem;
    border-radius: 0.625rem;
    color: #475569;
    font-weight: 600;
    font-size: 0.8125rem;
    white-space: nowrap;
    transition: all var(--duration-soft-3d) var(--ease-soft-3d);
    border: 1px solid transparent;
    user-select: none;
}

.nav-link-soft:hover {
    color: #e11d48;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-color: #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
    box-shadow: inset 0 1px 0 #ffffff, 0 3px 8px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1.5px);
}

.nav-link-soft:active {
    transform: translateY(0.5px);
    border-bottom-width: 1px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Active Highlight State for Desktop Navbar (Soft 3D Teal) */
.nav-link-soft.active {
    color: #be185d !important;
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
    border: 1px solid #fecdd3 !important;
    border-bottom: 2.5px solid #f43f5e !important;
    box-shadow: inset 0 1px 0 #ffffff, 0 3px 8px -1px rgba(225, 29, 72, 0.22) !important;
    font-weight: 700 !important;
}

.nav-link-soft.active:hover {
    transform: translateY(-1.5px);
    box-shadow: inset 0 1px 0 #ffffff, 0 5px 12px -1px rgba(225, 29, 72, 0.30) !important;
}

.nav-link-soft:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.4);
}

/* Mobile Nav Links */
.mobile-nav-link-soft {
    transition: all var(--duration-soft-3d) var(--ease-soft-3d);
    border: 1px solid transparent;
}

.mobile-nav-link-soft:active {
    transform: scale(0.98);
}

/* Active Highlight State for Mobile Drawer Links */
.mobile-nav-link-soft.active {
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
    color: #be185d !important;
    border: 1px solid #fecdd3 !important;
    border-left: 4px solid #e11d48 !important;
    font-weight: 700 !important;
    box-shadow: inset 0 1px 0 #ffffff, 0 2px 6px rgba(225, 29, 72, 0.12) !important;
}

.mobile-nav-link-soft.active i {
    color: #e11d48 !important;
}

/* 6. Service Catalog Tab Soft 3D */
.service-tab-btn {
    transition: all var(--duration-soft-3d) var(--ease-soft-3d);
}

.service-tab-btn:not(.active) {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-bottom: 2px solid #cbd5e1;
    box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgba(0, 0, 0, 0.04);
}

.service-tab-btn:not(.active):hover {
    border-color: #fecdd3;
    color: #be185d;
    transform: translateY(-1.5px);
    box-shadow: inset 0 1px 0 #ffffff, 0 4px 12px -1px rgba(0, 0, 0, 0.08);
}

.service-tab-btn:not(.active):active {
    transform: translateY(0.5px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.service-tab-btn.active {
    background: linear-gradient(180deg, #f43f5e 0%, #be185d 100%) !important;
    color: #ffffff !important;
    border: 1px solid #be185d !important;
    border-bottom: 2.5px solid #9f1239 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), var(--shadow-3d-primary) !important;
}

/* 7. FAQ Accordion Item Soft 3D */
.faq-soft-btn {
    transition: all var(--duration-soft-3d) var(--ease-soft-3d);
    border: 1px solid #e2e8f0;
    border-bottom: 1.5px solid #cbd5e1;
    box-shadow: inset 0 1px 0 #ffffff;
}

.faq-soft-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: inset 0 1px 0 #ffffff, 0 3px 10px -1px rgba(0, 0, 0, 0.05);
}

.faq-soft-btn:active {
    transform: translateY(0.5px);
}

/* Print Request Summary Styling */
@media print {
    body * {
        visibility: hidden;
    }
    #invoiceModal, #invoiceModal * {
        visibility: visible;
    }
    #invoiceModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: white !important;
        padding: 0;
        margin: 0;
    }
    #invoiceModal button, 
    #invoiceModal a,
    #invoiceModal .bg-gradient-to-r {
        box-shadow: none !important;
    }
    #invoiceModal button[onclick="closeInvoiceModal()"],
    #btnSendWA {
        display: none !important;
    }
}

/* Mobile Sticky Bottom Bar Animation */
#mobileStickyBar {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 9. Visitor Counter Card Soft 3D (Teal, Mint, White) */
.visitor-counter-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff1f2 60%, #ffe4e6 100%);
    border: 1px solid #fecdd3;
    border-bottom: 3.5px solid #be185d;
    border-radius: 1.25rem;
    box-shadow: inset 0 1.5px 0 #ffffff,
                0 4px 16px -2px rgba(225, 29, 72, 0.12),
                0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all var(--duration-soft-3d) var(--ease-soft-3d);
}

.visitor-counter-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1.5px 0 #ffffff,
                0 8px 24px -3px rgba(225, 29, 72, 0.18),
                0 2px 5px rgba(0, 0, 0, 0.06);
}

/* 10. Client Preview Mode Protections (Watermark & Banner) */
.preview-watermark-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background-repeat: repeat;
    background-size: 420px 260px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='260' viewBox='0 0 420 260'%3E%3Cg fill='%230f172a' fill-opacity='0.085' font-family='sans-serif' font-weight='800' font-size='13'%3E%3Ctext transform='rotate(-25 210 130)' text-anchor='middle' x='210' y='130'%3EDEMO PRATINJAU • KELB%27S • BELUM LUNAS%3C/text%3E%3C/g%3E%3C/svg%3E");
}

.preview-top-banner {
    background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-bottom: 2px solid #f59e0b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 50;
}

/* 8. Accessibility: Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .btn-soft-3d,
    .btn-soft-3d-primary,
    .btn-soft-3d-secondary,
    .btn-soft-3d-emerald,
    .btn-soft-3d-subtle,
    .nav-link-soft,
    .mobile-nav-link-soft,
    .service-tab-btn,
    .faq-soft-btn,
    .visitor-counter-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff1f2 60%, #ffe4e6 100%);
    border: 1px solid #fecdd3;
    border-bottom: 3.5px solid #be185d;
    border-radius: 1.25rem;
    box-shadow: inset 0 1.5px 0 #ffffff,
                0 4px 16px -2px rgba(225, 29, 72, 0.12),
                0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all var(--duration-soft-3d) var(--ease-soft-3d);
}
}

/* Sticky Header Pinned at Top with Zero Disappearing */
#mainHeader {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
}
