/*
 * ZiacPay – CRITICAL CSS  (beforelogin-critical.css)
 * ─────────────────────────────────────────────────────────────
 * Inlined in <head> via <style> tag (or highest-priority preload).
 * Contains ONLY what is needed to render the above-the-fold
 * viewport without flash-of-unstyled-content (FOUC):
 *   • CSS variables (referenced by everything below)
 *   • Preloader  (covers the page during load — must render first)
 *   • Base / reset  (body, html, headings, links, img)
 *   • Navbar  (fixed, always visible)
 *   • Hero section  (first visible content after nav)
 *   • Critical mobile nav breakpoint for nav only (≤ 768px)
 *
 * Everything else (sections below the fold, animations,
 * hover states, FAQ, compare table, footer, etc.) lives in
 * beforelogin-deferred.css which is loaded with <link rel="preload">.
 * ─────────────────────────────────────────────────────────────
 */

/* ============================================================
   CSS VARIABLES — shared by both files, must be here
   ============================================================ */
:root {
    /* Core palette */
    --zp-primary:        #4361ee;
    --zp-secondary:      #3f37c9;
    --zp-accent:         #4cc9f0;
    --zp-dark:           #2b2d42;
    --zp-light:          #f8f9fa;
    --zp-gray:           #6c757d;
    --zp-success:        #28a745;
    --zp-warning:        #ffc107;
    --zp-danger:         #dc3545;

    /* Typography */
    --zp-body-font:      'Inter', sans-serif;
    --zp-heading-font:   'Poppins', sans-serif;

    /* Shadows / transitions */
    --zp-shadow:         0 10px 30px rgba(67, 97, 238, 0.1);
    --zp-transition:     all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* New-section tokens — needed by deferred, declared here
       so custom properties cascade correctly from :root */
    --zpn-primary:       #4361ee;
    --zpn-secondary:     #3f37c9;
    --zpn-accent:        #4cc9f0;
    --zpn-dark:          #2b2d42;
    --zpn-gray:          #6c757d;
    --zpn-blue-lt:       #eef1fd;
    --zpn-blue-mid:      #c3cef9;
    --zpn-coral:         #dc3545;
    --zpn-coral-lt:      #fff0ee;
    --zpn-coral-mid:     #f5b8be;
    --zpn-teal:          #0d9e7e;
    --zpn-teal-lt:       #e6f7f3;
    --zpn-amber:         #b07800;
    --zpn-amber-lt:      #fff8e6;
    --zpn-gray-bg:       #f8f9ff;
    --zpn-border:        rgba(67, 97, 238, 0.12);
    --zpn-shadow:        0 10px 30px rgba(67, 97, 238, 0.10);
    --zpn-shadow-h:      0 20px 40px rgba(67, 97, 238, 0.15);
    --zpn-transition:    all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --zpn-radius:        20px;
    --zpn-radius-sm:     12px;
}

/* ============================================================
   PRELOADER — must be critical: it covers the entire viewport
   immediately on page load and hides FOUC for everything else
   ============================================================ */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-spinner {
    width: 56px;
    height: 56px;
    border: 5px solid var(--zpn-blue-lt);
    border-top-color: var(--zp-primary);
    border-radius: 50%;
    animation: preloaderSpin 0.9s linear infinite;
}

@keyframes preloaderSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   BASE / RESET — affects layout of every element
   ============================================================ */
html { scroll-behavior: smooth; overflow-x: hidden; }

body,
.zp-body {
    font-family: var(--zp-body-font);
    color: var(--zp-dark);
    line-height: 1.6;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--zp-heading-font);
    font-weight: 600;
    margin-bottom: 1rem;
}

a {
    color: var(--zp-primary);
    text-decoration: none;
    transition: var(--zp-transition);
}

a:hover { color: var(--zp-secondary); }

img { max-width: 100%; }

/* ============================================================
   NAVBAR — fixed-top, always visible in viewport
   ============================================================ */
.zp-header {
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.zp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 74px;
    max-width: 1200px;
    margin: 0 auto;
}

.zp-brand img { height: 55px; display: block; }

.zp-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.zp-links a,
.zp-links .nav-link {
    display: block;
    padding: 8px 16px !important;
    font-size: 14.5px !important;
    font-weight: 600 !important;
    color: #2b2d42 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
    text-decoration: none;
}

.zp-links a:hover,
.zp-links .nav-link:hover {
    color: #4361ee !important;
    background: rgba(67, 97, 238, 0.08) !important;
}

.zp-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Navbar buttons */
.zp-btn {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500 !important;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
    transition: all 0.18s;
    text-transform: uppercase !important;
    font-family: 'Inter', sans-serif !important;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.zp-btn-outline {
    border: 1.5px solid #4361ee;
    color: #4361ee;
    background: transparent;
}

.zp-btn-outline:hover { background: #4361ee; color: #fff; }

.zp-btn-filled {
    background: #4361ee;
    color: #fff;
    border: 1.5px solid #4361ee;
}

.zp-btn-filled:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
}

/* Hamburger — hidden on desktop, shown on mobile */
.zp-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px;
    border-radius: 6px;
}

.zp-menu-btn span {
    display: block;
    width: 26px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.35s ease;
    transform-origin: center;
}

/* X animation states (triggered by JS) */
.zp-menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.zp-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.zp-menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile nav drawer — hidden until toggled */
.zp-mobile-nav {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.07);
    padding: 12px 16px 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 999;
}

.zp-mobile-nav.open { display: block; }

.zp-mobile-nav .zp-links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-bottom: 12px;
}

.zp-mobile-nav .zp-links a { font-size: 16px; padding: 10px 12px !important; }

.zp-mobile-btns { display: flex; gap: 8px; }
.zp-mobile-btns .zp-btn { flex: 1; text-align: center; }

/* ============================================================
   GLOBAL UTILITY
   ============================================================ */
.zp-heading { font-family: var(--zp-heading-font); font-weight: 600; }

/* ============================================================
   HERO — first visible section, above the fold
   ============================================================ */
.hero {
    margin-top: 74px;
    padding: 8rem 5% 6rem;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #b3c9e9 100%);
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.5rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.primary-btn {
    background: #1a1a1a;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: inline-block;
}

.primary-btn:hover {
    background: #6366f1;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

/* ============================================================
   CRITICAL RESPONSIVE — nav + hero only
   Full responsive for below-fold sections is in deferred file
   ============================================================ */
@media (max-width: 768px) {
    .zp-desktop-links,
    .zp-actions { display: none !important; }
    .zp-menu-btn { display: flex; }

    .hero { margin-top: 60px; padding: 5rem 20px 4rem; }
    .hero h1 { font-size: 2.2rem; line-height: 1.25; margin-bottom: 1rem; }
    .hero p { font-size: 1rem; margin-bottom: 2rem; padding: 0 10px; }
    .hero-buttons { flex-direction: column; align-items: center; gap: 12px; }
    .primary-btn { width: 100%; max-width: 250px; padding: 12px 20px; font-size: 0.95rem; }
}

@media (max-width: 575.98px) {
    .hero h1 { font-size: 1.8rem; }
}
