/* ==========================================================================
   B2BServe Corporate Stylesheet - Modern Premium Corporate Design
   ========================================================================== */

/* 1. CASCADE LAYERS INITIALIZATION */
@layer reset, base, layout, components, utilities;

@layer reset {

    *,
    *::before,
    *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    html {
        -webkit-text-size-adjust: 100%;
        scroll-behavior: smooth;
    }

    body {
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
    }

    img,
    picture,
    svg,
    video {
        display: block;
        max-width: 100%;
        height: auto;
    }

    input,
    button,
    textarea,
    select {
        font: inherit;
    }

    button {
        background: none;
        border: none;
        cursor: pointer;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}

@layer base {
    :root {
        /* Color System (Corporate Palette based on Leaflet) */
        --color-primary: #0F294A;
        /* Deep Royal Navy */
        --color-primary-rgb: 15, 41, 74;
        --color-accent: #2563EB;
        /* Bright Accent Blue */
        --color-accent-hover: #1D4ED8;
        --color-accent-glow: rgba(37, 99, 235, 0.1);

        --color-security: #2563EB;
        --color-cleaners: #10B981;
        /* Emerald */
        --color-reception: #F59E0B;
        /* Amber */

        /* Light Theme Tokens */
        --bg-body: #FFFFFF;
        --bg-section-muted: #F8FAFC;
        /* Light Slate */
        --bg-card: #FFFFFF;
        --bg-navbar: rgba(255, 255, 255, 0.95);

        --text-main: #1E293B;
        /* Slate 800 */
        --text-muted: #64748B;
        /* Slate 500 */
        --text-inverse: #FFFFFF;

        --border-color: #E2E8F0;
        /* Slate 200 */
        --border-hover: #CBD5E1;
        /* Slate 300 */
        --border-focus: #2563EB;

        /* Typography */
        --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

        /* Depth / Shadows */
        --shadow-soft: 0 10px 30px -10px rgba(15, 41, 74, 0.08), 0 1px 3px rgba(15, 41, 74, 0.03);
        --shadow-hover: 0 20px 40px -15px rgba(15, 41, 74, 0.15), 0 2px 6px rgba(15, 41, 74, 0.05);

        /* Layout */
        --radius-sm: 6px;
        --radius-md: 12px;
        --radius-lg: 20px;

        --container-width: 1200px;
        --section-padding: clamp(4rem, 8vw, 8rem);
    }

    body {
        background-color: var(--bg-body);
        color: var(--text-main);
        font-family: var(--font-body);
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(15, 41, 74, 0.2) transparent;
    }

    ::selection {
        background-color: var(--color-accent);
        color: var(--text-inverse);
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        font-family: var(--font-heading);
        font-weight: 700;
        line-height: 1.2;
        color: var(--color-primary);
        text-wrap: balance;
    }

    p {
        text-wrap: pretty;
        color: var(--text-muted);
    }
}

@layer layout {
    .container {
        width: 100%;
        max-width: var(--container-width);
        margin-inline: auto;
        padding-inline: clamp(1.5rem, 5vw, 2.5rem);
    }

    .section {
        padding-block: var(--section-padding);
        position: relative;
    }

    .section-muted {
        background-color: var(--bg-section-muted);
    }

    /* Sticky Navigation */
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        background-color: var(--bg-navbar);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-color);
        transition: padding 0.3s ease, box-shadow 0.3s ease;
    }

    .navbar-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 90px;
        transition: height 0.3s ease;
    }

    .logo {
        font-family: var(--font-heading);
        font-size: 1.6rem;
        font-weight: 800;
        color: var(--color-primary);
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }

    .logo span {
        color: var(--color-accent);
    }

    .nav-links {
        display: none;
        /* Hidden on mobile */
    }

    .nav-cta {
        display: none;
    }

    /* Mobile Drawer */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 18px;
        z-index: 1001;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 2.5px;
        background-color: var(--color-primary);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* Open States */
    .menu-toggle.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .mobile-drawer {
        position: fixed;
        inset: 0 0 0 auto;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background-color: #ffffff;
        border-left: 1px solid var(--border-color);
        padding: 100px 2rem 2rem;
        z-index: 999;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    }

    .mobile-drawer.open {
        transform: translateX(0);
    }

    .mobile-nav-link {
        font-family: var(--font-heading);
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--text-main);
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
        transition: color 0.3s ease;
    }

    .mobile-nav-link:hover,
    .mobile-nav-link.active {
        color: var(--color-accent);
    }

    /* Overlay background */
    .drawer-overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(15, 41, 74, 0.4);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
        backdrop-filter: blur(4px);
    }

    .drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Footer Layout */
    .footer {
        background-color: var(--color-primary);
        color: rgba(255, 255, 255, 0.8);
        padding-block: 5rem 2.5rem;
    }

    .footer h3 {
        color: #ffffff;
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
        position: relative;
    }

    .footer h3::after {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 0;
        width: 24px;
        height: 2.5px;
        background-color: var(--color-accent);
    }

    .footer-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 3rem;
        margin-bottom: 4rem;
    }

    .footer-col p {
        color: rgba(255, 255, 255, 0.7);
        margin-top: 1rem;
        font-size: 0.95rem;
    }

    .footer-links {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }

    .footer-links a {
        color: rgba(255, 255, 255, 0.75);
        transition: color 0.3s ease, padding-left 0.3s ease;
        font-size: 0.95rem;
    }

    .footer-links a:hover {
        color: #ffffff;
        padding-left: 6px;
    }

    .footer-bottom {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        text-align: center;
        font-size: 0.9rem;
    }

    /* Responsive Navigation & Grid layouts */
    @media (min-width: 768px) {
        .footer-grid {
            grid-template-columns: 2fr 1.2fr 1.2fr;
        }

        .footer-bottom {
            flex-direction: row;
            justify-content: space-between;
            text-align: left;
        }
    }

    @media (min-width: 992px) {
        .nav-links {
            display: flex;
            align-items: center;
            gap: 2.5rem;
            list-style: none;
        }

        .nav-link {
            font-family: var(--font-heading);
            font-size: 1rem;
            font-weight: 600;
            color: var(--color-primary);
            opacity: 0.85;
            transition: opacity 0.3s ease, color 0.3s ease;
            position: relative;
        }

        .nav-link:hover,
        .nav-link.active {
            opacity: 1;
            color: var(--color-accent);
        }

        .nav-link.active::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--color-accent);
        }

        .nav-cta {
            display: block;
        }

        .menu-toggle,
        .mobile-drawer {
            display: none;
        }
    }
}

@layer components {

    /* Buttons */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.85rem 2rem;
        border-radius: var(--radius-sm);
        font-family: var(--font-heading);
        font-weight: 700;
        transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
        text-align: center;
        min-block-size: 48px;
    }

    .btn-primary {
        background-color: var(--color-accent);
        color: #ffffff;
    }

    .btn-primary:hover:not(:disabled) {
        background-color: var(--color-accent-hover);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    }

    .btn-secondary {
        background-color: transparent;
        color: var(--color-primary);
        border: 2px solid var(--color-primary);
    }

    .btn-secondary:hover:not(:disabled) {
        background-color: rgba(15, 41, 74, 0.05);
        transform: translateY(-2px);
    }

    .btn-white {
        background-color: #ffffff;
        color: var(--color-primary);
    }

    .btn-white:hover {
        background-color: #f1f5f9;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* Cards */
    .card {
        background-color: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 1.5rem;
        box-shadow: var(--shadow-soft);
        transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    }

    @media (min-width: 576px) {
        .card {
            padding: 2.5rem;
        }
    }

    .card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-hover);
        border-color: var(--border-hover);
    }

    /* Service Card redesign */
    .service-card {
        background-color: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        overflow: hidden;
        box-shadow: var(--shadow-soft);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .service-card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-hover);
    }

    .service-card-img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-bottom: 1px solid var(--border-color);
    }

    .service-card-content {
        padding: 2rem;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    .service-card h3 {
        margin-bottom: 0.8rem;
        font-size: 1.35rem;
    }

    .service-card p {
        margin-bottom: 1.5rem;
        flex-grow: 1;
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Stats display */
    .stat-badge {
        font-family: var(--font-heading);
        font-size: clamp(2.5rem, 2.5rem + 1.5vw, 3.8rem);
        font-weight: 800;
        line-height: 1;
        color: var(--color-accent);
        margin-bottom: 0.5rem;
        display: block;
    }

    /* Testimonial slider / grid cards */
    .testimonial-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    @media (min-width: 768px) {
        .testimonial-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (min-width: 992px) {
        .testimonial-grid {
            grid-template-columns: repeat(3, 1fr);
        }
    }

    .testimonial-card {
        background-color: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 2.2rem;
        box-shadow: var(--shadow-soft);
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;
    }

    .testimonial-text {
        font-style: italic;
        color: var(--text-main);
        font-size: 0.98rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
    }

    .testimonial-stars {
        color: #F59E0B;
        margin-bottom: 1rem;
        display: flex;
        gap: 0.2rem;
    }

    .testimonial-author {
        display: flex;
        align-items: center;
        gap: 1rem;
        border-top: 1px solid var(--border-color);
        padding-top: 1.2rem;
    }

    .testimonial-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background-color: var(--color-accent-glow);
        color: var(--color-accent);
        font-weight: 800;
        font-family: var(--font-heading);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        font-size: 1.1rem;
    }

    .testimonial-info h4 {
        font-size: 0.95rem;
        margin: 0;
        color: var(--color-primary);
    }

    .testimonial-info p {
        font-size: 0.8rem;
        margin: 0;
        color: var(--text-muted);
    }

    /* Timelines */
    .timeline {
        position: relative;
        padding-left: 2rem;
        margin-top: 3rem;
    }

    .timeline::before {
        content: '';
        position: absolute;
        left: 6px;
        top: 0;
        bottom: 0;
        width: 2.5px;
        background-color: var(--border-color);
    }

    .timeline-item {
        position: relative;
        margin-bottom: 3.5rem;
    }

    .timeline-item:last-child {
        margin-bottom: 0;
    }

    .timeline-marker {
        position: absolute;
        left: calc(-2rem - 7px);
        top: 6px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background-color: var(--color-accent);
        border: 4px solid #ffffff;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

    .timeline-step {
        font-family: var(--font-heading);
        font-size: 0.8rem;
        font-weight: 800;
        text-transform: uppercase;
        color: var(--color-accent);
        letter-spacing: 0.06em;
        margin-bottom: 0.3rem;
        display: block;
    }

    .timeline-title {
        font-size: 1.3rem;
        margin-bottom: 0.6rem;
    }

    /* Forms */
    .form-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .form-label {
        font-family: var(--font-heading);
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--color-primary);
    }

    .form-control {
        background-color: #ffffff;
        border: 1.5px solid var(--border-color);
        border-radius: var(--radius-sm);
        padding: 0.8rem 1rem;
        color: var(--text-main);
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        min-block-size: 48px;
    }

    .form-control:focus {
        border-color: var(--border-focus);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    }

    .form-control:user-invalid {
        border-color: #EF4444;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
    }

    .form-control:user-valid {
        border-color: #10B981;
    }

    .form-error {
        font-size: 0.8rem;
        color: #EF4444;
        display: none;
        margin-top: 0.25rem;
    }

    .form-control:user-invalid+.form-error {
        display: block;
    }
}

@layer utilities {
    .text-center {
        text-align: center;
    }

    .text-accent {
        color: var(--color-accent);
    }

    .grid-2 {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .grid-3 {
        display: grid;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .mt-1 {
        margin-top: 1rem;
    }

    .mt-2 {
        margin-top: 2rem;
    }

    .mt-3 {
        margin-top: 3rem;
    }

    .mb-1 {
        margin-bottom: 1rem;
    }

    .mb-2 {
        margin-bottom: 2rem;
    }

    .mb-3 {
        margin-bottom: 3rem;
    }

    @media (min-width: 576px) {
        .grid-2 {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (min-width: 768px) {
        .grid-3 {
            grid-template-columns: repeat(3, 1fr);
        }

        .timeline {
            padding-left: 0;
        }

        .timeline::before {
            left: 50%;
            transform: translateX(-50%);
        }

        .timeline-item {
            width: 50%;
            padding-inline: 3rem;
            margin-bottom: 5rem;
        }

        .timeline-item:nth-child(odd) {
            margin-left: 0;
            text-align: right;
        }

        .timeline-item:nth-child(even) {
            margin-left: 50%;
            text-align: left;
        }

        .timeline-marker {
            left: auto;
            top: 6px;
        }

        .timeline-item:nth-child(odd) .timeline-marker {
            right: -10px;
        }

        .timeline-item:nth-child(even) .timeline-marker {
            left: -10px;
        }
    }
}

/* ==========================================================================
   Admin Dashboard & Portal Layout
   ========================================================================== */
.admin-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-section-muted);
    padding: 2rem;
}

.admin-login-card {
    width: 100%;
    max-width: 440px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-hover);
}

.admin-body {
    background-color: #F1F5F9;
    /* Light grey slate background */
}

.admin-header {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.admin-header-logo {
    color: #ffffff;
    font-weight: 800;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-header-nav a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.admin-header-nav a:hover {
    color: #ffffff;
}

.admin-wrapper {
    max-width: 1300px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 992px) {
    .admin-grid {
        grid-template-columns: 1.8fr 1.2fr;
    }
}

.admin-panel {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2.5rem;
}

.admin-panel-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: var(--bg-section-muted);
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
}

.admin-table tr:hover {
    background-color: #f8fafc;
}

.admin-table td.actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    background-color: #EF4444;
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    min-block-size: auto;
}

.btn-danger-sm:hover {
    background-color: #DC2626;
}

.admin-alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.admin-alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.admin-alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.inquiry-details-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.inquiry-details-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--color-primary);
}

/* ==========================================================================
   Responsive Services Page Classes
   ========================================================================== */
.services-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3.5rem;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5rem;
}

.services-row:last-child {
    border-bottom: none;
    padding-bottom: 2rem;
}

.services-row .services-text {
    order: 1;
}

.services-row .services-graphic {
    order: 2;
}

@media (min-width: 992px) {
    .services-row {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .services-row.alt {
        grid-template-columns: 0.9fr 1.1fr;
    }

    .services-row.alt .services-text {
        order: 2;
    }

    .services-row.alt .services-graphic {
        order: 1;
    }
}