:root {
    /* Trust & Authority Palette */
    --primary-color: #0d47a1;
    /* Deep Trust Blue */
    --primary-hover: #08306b;
    --secondary-color: #dc3545;
    /* Urgent/Alert Red */
    --accent-color: #e3f2fd;
    /* Soft Blue Background */
    --text-dark: #1a202c;
    --text-muted: #4a5568;
    --success-color: #059669;
    --warning-color: #d97706;

    /* Spacing & Layout */
    --header-height: 64px;
    --bottom-nav-height: 60px;
    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    padding-bottom: var(--bottom-nav-height);
    /* Space for mobile nav */
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #111827;
}

/* Navbar Enhancements */
nav.navbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm) !important;
    padding: 0.75rem 0;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 800;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* Trust Badge Banner */
.trust-banner {
    background: #f0f9ff;
    border-bottom: 1px solid #bae6fd;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #0369a1;
    text-align: center;
}

.trust-banner i {
    margin-right: 0.5rem;
}

/* Breathing Text Animation */
@keyframes textBreathe {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.02); opacity: 1; text-shadow: 0 0 8px rgba(3, 105, 161, 0.3); }
    100% { transform: scale(1); opacity: 0.9; }
}

.animate-breathe {
    display: inline-block;
    animation: textBreathe 3.5s infinite ease-in-out;
}

/* Modern Card */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(13, 71, 161, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid #eee;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.mobile-nav-item.active {
    color: var(--primary-color);
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.input-group-text {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* Custom Animated Hamburger */
.custom-toggler {
    border: none;
    background: transparent;
    padding: 0;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1060;
}

.custom-toggler:focus {
    box-shadow: none;
    outline: none;
}

.hamburger-lines {
    display: block;
    height: 18px;
    width: 26px;
    position: relative;
    margin: auto;
}

.hamburger-lines .line {
    display: block;
    height: 3px;
    width: 100%;
    border-radius: 3px;
    background: var(--text-dark);
    position: absolute;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.2s, background 0.3s;
}

.hamburger-lines .line1 { top: 0; transform-origin: top left; }
.hamburger-lines .line2 { top: 50%; transform: translateY(-50%); }
.hamburger-lines .line3 { bottom: 0; transform-origin: bottom left; }

.custom-toggler[aria-expanded="true"] .line1 {
    transform: rotate(45deg);
    top: -3px;
    left: 4px;
    background: var(--primary-color);
}
.custom-toggler[aria-expanded="true"] .line2 {
    opacity: 0;
}
.custom-toggler[aria-expanded="true"] .line3 {
    transform: rotate(-45deg);
    bottom: -3px;
    left: 4px;
    background: var(--primary-color);
}

/* Mobile Responsive Tweaks */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Floating Absolute Menu */
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 1.25rem;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #f1f5f9;
        z-index: 1050;
    }
    
    .navbar-collapse .navbar-nav {
        gap: 0.85rem !important;
    }
    
    .navbar-collapse .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
    }
}

/* LANDING PAGE SPECIFIC */
.hero-section {
    color: white;
    padding: 80px 0 100px;
    text-align: center;
    position: relative;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    z-index: 1;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.9) 0%, rgba(8, 48, 107, 0.95) 100%),
        url('/public/hero-bg.jpg') center / cover no-repeat;
    animation: heroBgZoom 20s infinite alternate ease-in-out;
}

@keyframes heroBgZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #ffd700;
    /* Vibrant Gold for better visibility */
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #e0e7ff;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.search-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.search-nav .nav-link {
    color: #64748b !important;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.search-nav .nav-link.active {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: #eff6ff;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .search-container {
        padding: 1.5rem;
        margin-top: -40px;
    }

    .search-nav .nav-link {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Section Title with Underline */
.underline-title {
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.underline-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

/* ═══════════════════════════════════════════
   GLOBAL MICRO-INTERACTIONS
   ═══════════════════════════════════════════ */

/* ─── Button Enhanced States ────────────── */
.btn {
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.35);
}

.btn-primary:hover,
.btn-danger:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(13, 71, 161, 0.25);
}

.btn:active {
    transform: scale(0.97) !important;
    transition-duration: 0.1s;
}

/* Button Loading State */
.btn.btn-loading {
    pointer-events: none;
    opacity: 0.85;
    position: relative;
}

.btn.btn-loading .btn-label { visibility: hidden; }

.btn.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* Button Success State */
.btn.btn-success-state {
    background: #059669 !important;
    border-color: #059669 !important;
    animation: btnSuccessPop 0.3s ease;
}

@keyframes btnSuccessPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Button Error Shake */
.btn.btn-error-state,
.shake {
    animation: shakeX 0.5s ease;
}

@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ─── Form Validation UX ───────────────── */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23059669' viewBox='0 0 16 16'%3e%3cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.5rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23dc2626' viewBox='0 0 16 16'%3e%3cpath d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 2.5rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    animation: shakeX 0.4s ease;
}

.invalid-feedback {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
    animation: fadeSlideDown 0.25s ease;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Search field glow on focus */
.search-container .form-control:focus {
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.15), 0 0 20px rgba(13, 71, 161, 0.08);
    border-color: var(--primary-color);
}

/* ─── Navbar Shrink on Scroll ──────────── */
nav.navbar {
    transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: padding, background-color, box-shadow;
    backface-visibility: hidden;
}

nav.navbar.navbar-scrolled {
    padding: 0.35rem 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    background: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

nav.navbar.navbar-scrolled .navbar-brand {
    font-size: 1.3rem;
}

/* ─── Dropdown Smooth Open ─────────────── */
.dropdown-menu {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top center;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(.4,0,.2,1);
    display: block !important;
    pointer-events: none;
    border-radius: 10px;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ─── Modal Animation ──────────────────── */
.modal.fade .modal-dialog {
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.25s cubic-bezier(.4,0,.2,1), opacity 0.25s ease;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-backdrop.show {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ─── CSS Tooltip System ───────────────── */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    z-index: 1070;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease 0.3s, transform 0.2s ease 0.3s;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

[data-tooltip]::after {
    content: '';
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1e293b;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* ─── Section Dividers ─────────────────── */
.section-wave-divider {
    position: relative;
    margin-top: -1px;
}

.section-wave-divider::before {
    content: '';
    display: block;
    height: 40px;
    background: linear-gradient(135deg, transparent 33.33%, #f8fafc 33.33%, #f8fafc 66.66%, transparent 66.66%);
}

/* ─── Floating Action Button ───────────── */
.fab-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.fab-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    text-decoration: none;
    position: relative;
    overflow: visible;
    animation: fab-breathe 4s ease-in-out infinite;
}

@keyframes fab-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
    50% { transform: scale(1.08); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
}

.fab-btn:hover {
    animation-play-state: paused;
    transform: scale(1.15) !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

.fab-btn.fab-primary {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
}

.fab-btn.fab-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.fab-label {
    position: absolute;
    right: calc(100% + 10px);
    white-space: nowrap;
    background: #1e293b;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.fab-btn:hover .fab-label {
    opacity: 1;
    transform: translateX(0);
}

/* ─── Global Toast (all pages) ─────────── */
.global-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.global-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: gToastIn 0.35s ease, gToastOut 0.35s ease 3.65s forwards;
    max-width: 380px;
}

.global-toast.success { background: #059669; }
.global-toast.error   { background: #dc2626; }
.global-toast.warning { background: #d97706; }
.global-toast.info    { background: #2563eb; }

@keyframes gToastIn {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gToastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(10px); }
}

/* ─── Scroll Reveal Stagger (global) ───── */
.stagger-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.4,0,.2,1);
}

.stagger-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Accessibility: Reduced Motion ────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .testimonial-track {
        animation: none !important;
    }

    .reveal-on-scroll,
    .stagger-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ─── Mobile FAB adjustments ───────────── */
@media (max-width: 768px) {
    .fab-container {
        bottom: 70px;
        right: 12px;
    }

    .fab-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .fab-label {
        display: none;
    }

    .global-toast-container {
        left: 12px;
        right: 12px;
        bottom: 70px;
    }

    .global-toast {
        max-width: 100%;
    }
}