/* 
 * Niyati Financial Solutions — Premium Design System
 * Version 3.0 (Hardened)
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Colors */
    --navy:       #001f3f;
    --navy-deep:  #001226;
    --navy-light: #003366;
    --gold:       #D4AF37;
    --gold-light: #e8c84a;
    --gold-dark:  #b8952e;
    --accent-blue: #3b82f6;
    
    /* Semantic Colors */
    --bg:         #f8fafc;
    --bg-alt:     #ffffff;
    --text:       #1e293b;
    --text-muted: #64748b;
    --border:     #e2e8f0;
    --border-light: rgba(226, 232, 240, 0.5);
    
    /* Status */
    --success:    #10b981;
    --warning:    #f59e0b;
    --danger:     #ef4444;
    --info:       #0ea5e9;

    /* Spacing & Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 30px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.1);
    --shadow-premium: 0 25px 80px rgba(0,31,63,0.15);

    /* Transitions */
    --transition-premium: 0.6s cubic-bezier(0.165, 0.84, 0.44, 1.0);
    --transition-fast: 0.2s ease;
}

/* ── Global Resets ── */
body {
    font-family: 'Montserrat', 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1 0 auto;
}

section {
    padding: 100px 0;
    position: relative;
}

@media (max-width: 768px) {
    section { padding: 60px 0; }
}

h1, h2, h3, h4, .font-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
}

/* Active Nav Link Indicator */
.niyati-navbar .nav-link.active,
.niyati-navbar .nav-link.section-active {
    color: var(--gold) !important;
    position: relative;
    font-weight: 700;
}
.niyati-navbar .nav-link.active::after,
.niyati-navbar .nav-link.section-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Hero Button Standardization */
.btn {
    min-width: 220px;
    padding: 12px 28px;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

@media (max-width: 576px) {
    .btn { 
        min-width: 100%; 
        margin-bottom: 12px;
    }
}

.hero-btn-group .btn {
    min-width: 220px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.btn-gold {
    background-color: var(--gold);
    color: var(--navy) !important;
}
.btn-gold:hover {
    background-color: var(--gold-dark);
    color: white !important;
}

/* ── Typography Utilities ── */
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.ls-2 { letter-spacing: 2px; }
.ls-1 { letter-spacing: 1px; }

/* ── Premium Components ── */

/* Glassmorphism */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(0, 31, 63, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cards */
.niyati-card {
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition-premium);
}

.niyati-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.bg-navy-light { background: #1a2233 !important; }
.text-gold { color: #D4AF37 !important; }
.x-small { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 1px; }

/* Institutional Navbar Refinement */
.niyati-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--gold);
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 0;
    transition: var(--transition-premium);
}
.niyati-navbar.scrolled {
    padding: 0.4rem 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}
.niyati-navbar .brand-name { color: var(--navy) !important; transition: font-size 0.3s; }
.niyati-navbar.scrolled .brand-name { font-size: 0.85rem; }

/* ── Skeleton Loader (Institutional Grade) ── */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #f8fafc 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
    display: inline-block;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-circle { border-radius: 50%; }
.skeleton-text { height: 1.2rem; margin-bottom: 0.5rem; width: 100%; }
.skeleton-title { height: 2rem; margin-bottom: 1rem; width: 80%; }
.skeleton-btn { height: 40px; border-radius: var(--radius-md); width: 120px; }

.niyati-navbar-premium {
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-premium.gold {
    background: var(--gold);
    color: var(--navy);
}

.btn-premium.gold:hover {
    background: var(--gold-dark);
    color: white;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.btn-premium.navy {
    background: var(--navy);
    color: white;
}

.btn-premium.navy:hover {
    background: #FFD700;
    color: var(--navy);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.25);
}

/* Institutional Services Overhaul */
.services-grid-overhaul .service-card {
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .services-grid-overhaul > div {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-top: 20px;
        padding-bottom: 20px;
        text-align: center;
    }
    .services-grid-overhaul {
        padding-top: 20px;
        padding-bottom: 20px;
    }
    /* Increased vertical and side padding for cards */
    .services-grid-overhaul .col-md-4 {
        margin-bottom: 40px;
        padding-left: 25px !important;
        padding-right: 25px !important;
    }
    .service-card {
        padding: 35px 25px !important;
    }
}

/* ── Admin Dashboard Optimization ── */
.admin-container {
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1200px) {
    .admin-main {
        padding: 40px 60px !important;
    }
}

/* Form Styling */
.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-control, .form-select {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15);
}

/* Global Hover Standardization */
.btn-gold:hover, .btn-navy:hover, .nav-link:hover {
    transition: all 0.3s ease !important;
}
.btn-gold:hover {
    background: #FFD700 !important;
    color: var(--navy) !important;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* ── Section Specific ── */
.premium-hero {
    position: relative;
    padding: 140px 0 100px;
    background-color: var(--navy);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(0, 51, 102, 0.4), transparent 50%);
    pointer-events: none;
}

.service-icon-box {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

.niyati-card:hover .service-icon-box {
    transform: scale(1.1) rotate(5deg);
}

/* Sidebar Styling for Dashboards */
.premium-sidebar {
    background: var(--navy-deep);
    color: white;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item-premium {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.nav-item-premium:hover, .nav-item-premium.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.05);
    border-left-color: var(--gold);
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Hero ── */
.hero-section {
    background: linear-gradient(160deg, rgba(0,31,63,0.92), rgba(0,31,63,0.85)), url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?q=80&w=2070&auto=format&fit=crop");
    background-size: cover; background-position: center;
    padding: 120px 0 100px; color: #fff; position: relative; overflow: hidden;
}
.hero-section::after {
    content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 80px;
    background: linear-gradient(to top, var(--bg), transparent);
}
.hero-section h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.15; }
@media (max-width: 768px) {
    .hero-section h1 { font-size: 2rem !important; }
}
.hero-section h1 .highlight { color: #D4AF37; }

/* ── Services ── */
.service-card { border: none; border-radius: 16px; padding: 45px 30px; text-align: center; transition: 0.4s; border-bottom: 4px solid transparent; }
.service-card:hover { transform: translateY(-8px); border-bottom-color: #D4AF37; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.service-icon { width: 70px; height: 70px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; margin-bottom: 20px; }

/* ── Eligibility Form Refined ── */
.eligibility-section { background: linear-gradient(135deg, #021124 0%, #0a2540 100%); padding: 80px 0; position: relative; }
.eligibility-card { background: rgba(255,255,255,0.02); backdrop-filter: blur(15px); border: 1px solid rgba(212,175,55,0.15); border-radius: 12px; padding: 35px; box-shadow: 0 25px 50px rgba(0,0,0,0.3); }
.eligibility-card .form-control, .eligibility-card .form-select { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; border-radius: 6px; padding: 12px 16px; font-size: 0.95rem; transition: all 0.3s ease; }
.eligibility-card .form-control::placeholder { color: rgba(255,255,255,0.3); font-weight: 300; }
.eligibility-card .form-control:focus, .eligibility-card .form-select:focus { background: rgba(255,255,255,0.08); border-color: #D4AF37; box-shadow: 0 0 12px rgba(212,175,55,0.2); color: #fff; outline: none; }
.eligibility-card .form-select option { color: #333; background: #fff; }
.eligibility-card .form-label { color: rgba(255,255,255,0.85); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; margin-bottom: 6px; }
.form-section-title { color: #D4AF37; font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase; border-bottom: 1px solid rgba(212,175,55,0.2); padding-bottom: 8px; margin-top: 15px; margin-bottom: 20px; font-weight: 700; }

/* ── About ── */
.about-section img { border-radius: 16px; box-shadow: 20px 20px 0 var(--bg); max-width: 100%; }

/* ── Insights ── */
.insight-card { border: none; border-radius: 16px; overflow: hidden; transition: 0.4s; position: relative; }
.insight-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }
.insight-card-mask {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,31,63,0.95), transparent 60%);
    display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
}
.insight-card-title { color: #fff; font-size: 1rem; font-weight: 700; margin-top: 5px; }

/* ── Reveal ── */
.reveal { opacity: 0; transform: translateY(30px); transition: var(--transition-premium); will-change: transform, opacity; }
.reveal.active { opacity: 1; transform: translateY(0); }

@media (max-width: 768px) {
    .hero-section { padding: 40px 15px; }
    .service-card { margin-bottom: 40px; }
    .footer-logo { max-width: 150px; }
    .preloader-text { font-size: 2.2rem; letter-spacing: 6px; }
    .hero-section h1 { font-size: 2.2rem; }
    /* WA FAB mobile safety: slightly higher to avoid overlapping potential sticky elements */
    #floatingWhatsApp {
        bottom: 100px !important;
        right: 20px !important;
        width: 54px !important;
        height: 54px !important;
        z-index: 10000 !important;
        display: flex;
    }
    /* Hide floating WhatsApp on mobile if action bar is present */
    @media (max-width: 991px) {
        #floatingWhatsApp { display: none !important; }
    }
}

/* ── Page Loader (Migrated from header.php) ── */
.niyati-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 999999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.5s;
    will-change: opacity, visibility;
}
.niyati-loader.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.niyati-loader.hidden-instant { display: none !important; }
.loader-spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--navy-light); border-top-color: var(--gold);
    border-radius: 50%; animation: n-spin 0.8s linear infinite;
}
@keyframes n-spin { to { transform: rotate(360deg); } }

body.loaded { opacity: 1; }
body.skip-loader { opacity: 1 !important; transition: none; }

/* Flash messages */
.flash-msg {
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navbar Brand & Dropdown (Migrated from header.php) */
.niyati-navbar .navbar-brand img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease;
}
.niyati-navbar.scrolled .navbar-brand img {
    height: 38px;
}
.niyati-navbar .brand-text-wrap { display: flex; flex-direction: column; line-height: 1.2; }
.niyati-navbar .brand-name { font-weight: 800; color: var(--navy); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.niyati-navbar .brand-tagline { color: var(--gold); font-weight: 700; font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase; white-space: nowrap; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); cursor: pointer; }

@media (max-width: 991px) {
    .niyati-navbar .brand-name { font-size: 0.88rem; }
    .niyati-navbar .brand-tagline { font-size: 0.55rem; }
    .navbar-collapse { padding-top: 12px; }
    .navbar-toggler[aria-expanded="true"] .bi-list::before { content: "\f659"; } 
}
@media (max-width: 576px) {
    .niyati-navbar .navbar-brand { gap: 10px !important; }
    .niyati-navbar .brand-name { font-size: 0.8rem; white-space: normal; max-width: 180px; font-weight: 800; }
    .niyati-navbar .brand-tagline { font-size: 0.5rem; letter-spacing: 1px; }
}

/* ── Footer Responsive Adjustments (Migrated) ── */
@media (max-width: 768px) {
    footer .regulatory-box { padding: 8px 10px !important; }
    footer .regulatory-box .label { font-size: 0.6rem !important; }
    footer .regulatory-box .value { font-size: 0.78rem !important; }
    footer .disclosure-text { color: #cbd5e1 !important; font-size: 0.78rem !important; text-align: justify; line-height: 2 !important; }
}
@media (max-width: 480px) {
    .disclaimer-container { padding: 0 20px !important; width: 100% !important; max-width: 100vw !important; overflow-x: hidden; }
    .disclosure-text { font-size: 11px !important; line-height: 1.8 !important; white-space: normal !important; text-align: left !important; letter-spacing: 0.3px; }
    .disclosure-title { font-size: 0.75rem !important; }
}

/* ── Progress Bar & Toasts (Migrated) ── */
#nprogress-bar {
    position: fixed; top: 0; left: 0; width: 0%; height: 3px;
    background: var(--gold); z-index: 100000; transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(212,175,55,0.7);
}
#toast-container {
    position: fixed; bottom: 30px; left: 30px; z-index: 100000;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.n-toast {
    background: #fff; color: #001f3f; padding: 14px 22px; border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15); border-left: 5px solid var(--gold);
    font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 12px;
    transform: translateX(-120%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto; min-width: 280px;
}
.n-toast.show { transform: translateX(0); }
.n-toast.success { border-left-color: #059669; }
.n-toast.error { border-left-color: #e11d48; }
.n-toast i { font-size: 1.1rem; }

/* ── Mobile First Optimization (UX Engineer Hardening) ── */
@media (max-width: 991px) {
    /* Base font size for better readability on small screens */
    html { font-size: 16px; }
    body { font-size: 1rem; line-height: 1.7; }
    
    /* Beefier buttons for touch targets (min 44px height) */
    .btn { 
        padding: 14px 24px !important; 
        font-size: 1rem !important;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Form inputs - prevent iOS zoom and improve touch */
    .form-control, .form-select, .form-control:focus {
        font-size: 16px !important; /* Minimum 16px to prevent iOS auto-zoom */
        padding: 14px 18px !important;
        height: auto !important;
        border-radius: 12px !important;
    }
    
    .form-label {
        font-size: 0.82rem !important;
        margin-bottom: 8px !important;
        color: var(--text-muted);
    }
    
    /* Force single column for forms on mobile */
    .row.g-3 > [class*="col-"] {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Navigation Refinements */
    .navbar-collapse {
        background: #fff;
        padding: 24px !important;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0,31,63,0.15);
        margin-top: 15px;
        border: 1px solid var(--border);
    }
    
    .niyati-navbar .nav-link {
        padding: 14px 18px !important;
        border-radius: 10px;
        font-weight: 700 !important;
        font-size: 1.05rem !important;
        color: var(--navy) !important;
        margin-bottom: 5px;
        transition: all 0.2s ease;
    }
    
    .niyati-navbar .nav-link:active, .niyati-navbar .nav-link.active {
        background: rgba(212, 175, 55, 0.1);
        color: var(--gold) !important;
    }
    
    .niyati-navbar .nav-link.active::after {
        display: none; /* Hide desktop indicator on mobile */
    }
    
    /* Improved Hero Spacing */
    .hero-section {
        padding: 60px 0 60px !important;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.1rem !important;
        line-height: 1.25 !important;
        margin-bottom: 20px;
    }
    
    .hero-section .lead {
        font-size: 1.05rem !important;
        line-height: 1.6;
        margin-bottom: 30px !important;
    }
    
    .hero-btn-group {
        flex-direction: column;
        gap: 12px !important;
    }
    
    .hero-btn-group .btn {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    /* Eligibility Section Refinement */
    .eligibility-card {
        padding: 30px 20px !important;
        margin: 0 10px;
    }
    
    .form-section-title {
        font-size: 0.75rem !important;
        margin-bottom: 25px !important;
    }

    /* Section Spacing */
    section {
        padding: 60px 0 !important;
    }
    
    .services-grid-overhaul .service-card {
        padding: 30px 20px !important;
    }
}

/* Fix for horizontal scroll on some mobile devices */
body, html {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}
