@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-blue: #1F8ACB;
    --leaf-green: #6DBE45;
    --dark-green: #2E7D32;
    --accent-orange: #F7941D;
    --white: #FFFFFF;
    --light-grey: #F5F7FA;
    --dark-grey: #333333;
    --text-color: #333333;
    --font-family: 'Inter', sans-serif;
    --header-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.5rem;
    color: var(--primary-blue);
}

h3 {
    font-size: 1.75rem;
    color: var(--dark-green);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #156fa8;
}

.btn-secondary {
    background-color: var(--leaf-green);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--dark-green);
}

.btn-accent {
    background-color: var(--accent-orange);
    color: var(--white);
}

/* Header */
header {
    height: 90px;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 40px;
    position: relative;
}

/* Larger, distinct logo area */
.logo {
    z-index: 1001;
}

.logo img {
    height: 60px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Desktop Navigation */
nav {
    position: relative;
    z-index: 999;
}

nav ul {
    display: flex;
    gap: 32px;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    font-weight: 500;
    color: var(--dark-grey);
    font-size: 1rem;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

/* Modern Underline Animation */
nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-blue);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--primary-blue);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

nav a.active {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 8px;
    color: var(--dark-grey);
}

/* Footer */
footer {
    background-color: var(--dark-grey);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: var(--leaf-green);
    margin-bottom: 15px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover {
    color: var(--accent-orange);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
}

/* Main Content Padding for Fixed Header */
main {
    padding-top: 0;
    /* Let hero section handle the spacing */
    min-height: 80vh;
}

/* Section Styling */
section {
    padding: 60px 0;
    /* Reduced from 80px */
    position: relative;
    /* Ensure stacking context */
}

.bg-light {
    background-color: var(--light-grey);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f4ff 100%);
    /* Softer gradient */
    min-height: 100vh;
    /* Full viewport height */
    margin-top: -90px;
    /* Pull up behind fixed header */
    padding-top: 240px;
    /* Increased from 150px to ensure clearance */
    padding-bottom: 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 900px;
    z-index: 2;
    position: relative;
}

.hero-buttons {
    margin-top: 30px;
}

.hero-buttons .btn {
    margin: 0 10px;
}

/* Trust Strip */
.trust-strip {
    background-color: #f0f2f5;
    padding: 80px 0;
    /* MAXIMAL padding to solve 'gap too short' complaint */
    border-bottom: 2px solid #e1e4e8;
    margin-bottom: 60px;
    /* Large gap before the next section */
}

.trust-strip .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    text-align: center;
}

.trust-item strong {
    display: block;
    font-size: 1.2rem;
    color: var(--primary-blue);
}

/* Service Card */
.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Subtle border */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-blue);
}

/* Split Layout for Blue/White Collar */
.split-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Better responsiveness */
    gap: 40px;
    margin-top: 30px;
}

.split-col {
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.split-col.blue {
    background-color: #f0f8ff;
    border-top: 4px solid var(--primary-blue);
}

.split-col.white {
    background-color: #f9fbfd;
    border-top: 4px solid var(--dark-green);
}

.split-col ul li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

.split-col ul li::before {
    content: "•";
    color: var(--accent-orange);
    font-weight: bold;
    margin-right: 10px;
}

/* Industries Grid */
.industries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.industry-card {
    background-color: var(--white);
    border: 1px solid #e0e0e0;
    padding: 25px 15px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.industry-card:hover {
    border-color: var(--primary-blue);
    background-color: #fafffb;
}

/* CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, var(--dark-green) 0%, var(--leaf-green) 100%);
    color: var(--white);
    text-align: center;
    padding: 80px 0;
}

.cta-banner h2 {
    color: var(--white);
}

/* Mobile Optimizations */

/* Touch-friendly minimum sizes */
.btn,
button,
input[type="submit"],
a.apply-btn {
    min-height: 44px;
    min-width: 44px;
}

/* Ensure form inputs are touch-friendly */
input,
textarea,
select {
    font-size: 16px !important;
    /* Prevents zoom on iOS */
    min-height: 44px;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .container {
        padding: 0 16px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .hero {
        min-height: 80vh;
        padding-top: 180px;
        padding-bottom: 60px;
    }

    .service-card {
        padding: 25px;
    }

    .split-layout {
        gap: 30px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Header & Navigation */
    header {
        height: 70px;
    }

    header .container {
        padding: 0 16px;
    }

    .logo img {
        height: 50px;
    }

    .menu-toggle {
        display: block;
        font-size: 1.8rem;
        padding: 10px;
        cursor: pointer;
        color: var(--dark-grey);
        position: relative;
        z-index: 1002;
    }

    /* Sidebar Navigation */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--white);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        z-index: 1001;
        transition: right 0.3s ease;
        overflow-y: auto;
    }

    nav.show {
        right: 0;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        padding: 80px 0 20px 0;
        margin: 0;
        gap: 0;
        list-style: none;
    }

    nav ul li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: 18px 24px;
        font-size: 1.1rem;
        width: 100%;
        color: var(--dark-grey);
        transition: all 0.3s ease;
    }

    nav a:hover,
    nav a.active {
        background: var(--light-grey);
        color: var(--primary-blue);
        padding-left: 32px;
    }

    nav a::after {
        display: none;
    }

    /* Overlay backdrop */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
        pointer-events: none;
    }

    body.menu-open::before {
        opacity: 1;
        visibility: visible;
        pointer-events: all;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* Typography */
    h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.3rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    /* Hero Section */
    .hero {
        min-height: 70vh;
        margin-top: -70px;
        padding-top: 140px;
        padding-bottom: 40px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero h3 {
        font-size: 1rem;
        line-height: 1.5;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 25px;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 15px 20px;
        font-size: 1rem;
        box-sizing: border-box;
    }

    /* Trust Strip */
    .trust-strip {
        padding: 40px 0;
        margin-bottom: 40px;
    }

    .trust-strip .container {
        flex-direction: column;
        gap: 15px;
    }

    .trust-item {
        font-size: 0.95rem;
        padding: 10px;
    }

    /* Sections */
    section {
        padding: 40px 0;
    }

    /* Page Headers - Override inline styles */
    .page-header,
    section.page-header,
    section[class*="page-header"] {
        padding-top: 160px !important;
        padding-bottom: 60px !important;
        margin-top: -70px !important;
    }

    /* Pages with inline margin/padding styles */
    section[style*="margin-top: -90px"] {
        margin-top: -70px !important;
    }

    section[style*="padding-top: 240px"] {
        padding-top: 160px !important;
    }

    section[style*="padding-top: 180px"] {
        padding-top: 140px !important;
    }

    /* Service Cards */
    .service-card {
        padding: 20px;
    }

    .service-icon {
        font-size: 2rem;
        margin-bottom: 15px;
    }

    /* Split Layout */
    .split-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .split-col {
        padding: 25px;
    }

    /* Industries Grid */
    .industries-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .industry-card {
        padding: 20px 10px;
        min-height: 80px;
    }

    /* CTA Banner */
    .cta-banner {
        padding: 50px 0;
        position: relative;
        z-index: 1;
    }

    .cta-banner h2 {
        font-size: 1.5rem;
    }

    .cta-banner p {
        font-size: 1rem;
    }

    .cta-banner .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .cta-banner .btn {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 0;
        padding: 15px 20px;
        box-sizing: border-box;
    }

    .cta-banner .btn:first-of-type {
        margin-bottom: 0;
    }

    /* Footer - Professional Mobile Design */
    footer {
        padding: 50px 0 30px;
        position: relative;
        z-index: 1;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 40px;
    }

    .footer-col {
        text-align: left;
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 25px;
    }

    .footer-col:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .footer-col h4 {
        color: var(--leaf-green);
        font-size: 1.1rem;
        margin-bottom: 20px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .footer-col ul {
        margin: 0;
        padding: 0;
    }

    .footer-col ul li {
        margin-bottom: 12px;
    }

    .footer-col a {
        display: block;
        padding: 8px 0;
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.95rem;
        transition: all 0.3s ease;
        position: relative;
        padding-left: 15px;
    }

    .footer-col a::before {
        content: '›';
        position: absolute;
        left: 0;
        color: var(--accent-orange);
        font-weight: bold;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .footer-col a:hover,
    .footer-col a:active {
        color: var(--accent-orange);
        padding-left: 20px;
    }

    .footer-col a:hover::before,
    .footer-col a:active::before {
        opacity: 1;
    }

    .footer-col p {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .footer-bottom {
        text-align: center;
        padding-top: 25px;
        margin-top: 30px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.6);
    }

    /* Forms - Critical for Mobile */
    .form-section {
        padding: 25px 16px;
        margin: -30px 16px 40px;
        border-radius: 8px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-label {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    .form-control {
        padding: 14px 12px;
        font-size: 16px;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Mobile form grid adjustments */
    form>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    /* Job Cards */
    .job-card {
        padding: 18px;
    }

    .job-title {
        font-size: 1rem;
    }

    .job-location {
        font-size: 0.85rem;
    }

    .apply-btn {
        padding: 12px;
        font-size: 0.95rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Buttons - Fix overlapping */
    .btn,
    button,
    a.btn {
        padding: 14px 20px;
        font-size: 1rem;
        box-sizing: border-box;
        display: inline-block;
        text-align: center;
        max-width: 100%;
        word-wrap: break-word;
    }

    /* Buttons in flex containers */
    .hero-buttons .btn,
    .cta-banner .btn {
        flex-shrink: 0;
    }

    /* Primary buttons */
    .btn-primary,
    .btn-secondary {
        min-width: auto;
    }

    /* Container padding */
    .container {
        padding: 0 16px;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    main {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Tables */
    table {
        font-size: 0.9rem;
        width: 100%;
        overflow-x: auto;
        display: block;
    }

    /* Contact Cards */
    .service-card h3 {
        font-size: 1.1rem;
    }

    .service-card p {
        font-size: 0.9rem;
        word-wrap: break-word;
    }

    /* Fix any absolute positioned elements */
    section {
        position: relative;
        overflow: visible;
    }

    /* Payroll Page Specific Fixes */
    /* Fix grid columns on payroll service cards */
    section div[style*="grid-template-columns: repeat(auto-fit, minmax(350px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Fix exclusive features grid */
    section div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }

    /* Fix two-column "Why Choose" layout */
    section div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* Fix nested flex boxes with gap */
    div[style*="display: flex; gap: 15px"] {
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Ensure service cards don't overflow */
    .service-card ul {
        padding-left: 0;
        word-wrap: break-word;
    }

    /* Fix consultation box width */
    section div[style*="width: 100%"] {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Responsive padding for inner sections */
    section div[style*="padding: 40px"] {
        padding: 25px 20px !important;
    }

    section div[style*="padding: 20px"] {
        padding: 15px !important;
    }

    section div[style*="padding: 15px"] {
        padding: 12px !important;
    }

    /* Form Page Button Fixes */
    button[type="submit"],
    button[style*="width: 100%"],
    .btn[style*="width: 100%"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 15px 20px !important;
        margin: 0 !important;
    }

    /* Form section on mobile */
    .form-section {
        margin: -30px 16px 40px !important;
        padding: 25px 16px !important;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .hero h3 {
        font-size: 0.9rem;
    }

    .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .industries-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .form-control {
        padding: 12px 10px;
    }

    .job-card {
        padding: 15px;
    }

    .trust-strip {
        padding: 30px 0;
    }
}

/* Landscape mobile devices */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 120px;
    }

    section {
        padding: 30px 0;
    }
}