/* ===================================================
   4ZYLOS DESIGN SYSTEM (PROFESSIONAL MD3)
   Focus: Alignment, Contrast, Professionalism
   =================================================== */

:root {
    /* --- MD3 COLOR SYSTEM (Tonal Palette) --- */
    --md-sys-color-primary: #1d5fa6;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d4e3ff;
    --md-sys-color-on-primary-container: #001c39;

    --md-sys-color-secondary: #545f71;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #d8e3f8;
    --md-sys-color-on-secondary-container: #111c2b;

    --md-sys-color-tertiary: #6d5976;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #f6dbff;
    --md-sys-color-on-tertiary-container: #26172f;

    --md-sys-color-error: #ba1a1a;
    --md-sys-color-on-error: #ffffff;

    --md-sys-color-surface: #fefbff;
    --md-sys-color-on-surface: #1b1b1f;
    --md-sys-color-surface-variant: #e0e2ec;
    --md-sys-color-on-surface-variant: #44474e;
    
    --md-sys-color-outline: #74777f;
    --md-sys-color-outline-variant: #c4c6cf;

    /* --- NEW: SURFACE CONTAINERS (MD3) --- */
    --md-sys-color-surface-container-low: #f3f4f9;
    --md-sys-color-surface-container: #e8ebf2;
    --md-sys-color-surface-container-high: #dee2ed;
    --md-sys-color-surface-container-highest: #d3d9e6;

    /* --- SHADOWS (MD3 ELEVATION) --- */
    --md-sys-elevation-1: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-2: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --md-sys-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15), 0px 1px 3px rgba(0, 0, 0, 0.3);

    /* --- SPACING (8PX MODULAR GRID) --- */
    --sp-1: 8px;
    --sp-2: 16px;
    --sp-3: 24px;
    --sp-4: 32px;
    --sp-5: 40px;
    --sp-6: 48px;
    --sp-8: 64px;
    --sp-10: 80px;
    --sp-16: 128px;

    /* --- SHAPES --- */
    --shape-s: 4px;
    --shape-m: 8px;
    --shape-l: 16px;
    --shape-xl: 28px;
    --shape-full: 1000px;
}

/* --- BASE STYLES --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--md-sys-color-on-surface);
    background-color: var(--md-sys-color-surface);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-3);
}

/* --- CARDS (REFINED) --- */
.m3-card {
    background-color: var(--md-sys-color-surface);
    border-radius: 24px; /* More rounded, premium feel */
    padding: var(--sp-4);
    border: 1px solid var(--md-sys-color-outline-variant);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.m3-card--elevated {
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

.m3-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    border-color: var(--md-sys-color-primary-container);
}

.m3-icon-box {
    width: 56px;
    height: 56px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-1);
    transition: transform 0.3s ease;
}

.m3-card:hover .m3-icon-box {
    transform: scale(1.1) rotate(-5deg);
    background: var(--md-sys-color-primary);
    color: #fff;
}

.m3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--shape-full);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    vertical-align: middle;
}

.m3-btn--primary {
    /* Existing styles */

    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.m3-btn--primary:hover {
    background-color: #154e8c;
    box-shadow: var(--md-sys-elevation-1);
}

.m3-btn--tonal {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

/* --- TYPOGRAPHY --- */
.display-l { font-size: 3.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.headline-l { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.title-l { font-size: 1.375rem; font-weight: 600; line-height: 1.3; }
.body-l { font-size: 1.125rem; font-weight: 400; line-height: 1.6; color: var(--md-sys-color-on-surface-variant); }
.label-l { font-size: 0.875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--md-sys-color-primary); }

/* --- SECTION UTILITIES --- */
section { padding: var(--sp-10) 0; }
.section--variant { background-color: var(--md-sys-color-surface-variant); }
.section--container { background-color: var(--md-sys-color-surface-container-low); }
.section--secondary { background-color: var(--md-sys-color-secondary-container); }
.section--primary { background-color: var(--md-sys-color-primary-container); }
.section--dark { background-color: var(--md-sys-color-on-surface); color: var(--md-sys-color-surface); }
.section--dark .body-l { color: var(--md-sys-color-surface-variant); }
.section--dark .display-l, .section--dark .title-l { color: var(--md-sys-color-surface); }



/* --- HEADER & NAVIGATION (STRICT NOWPORTS LAYOUT + 4ZYLOS COLORS) --- */
:root {
    --header-bg: #1d5fa6;       /* 4Zylos Logo Blue */
    --cta-bg: #26f0ff;          /* Nowports Cyan */
    --cta-text: #000000;
}

.site-header {
    background-color: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px;
    display: flex;
    align-items: center;
    color: #ffffff;
    transition: all 0.3s ease;
}

.site-header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 50px; /* Increased by another 25% from 40px */
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
}

.main-nav__list {
    display: flex;
    list-style: none;
    gap: var(--sp-4);
    align-items: center;
    margin: 0;
    padding: 0;
}

.main-nav__link {
    text-decoration: none;
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    transition: opacity 0.2s;
}

.main-nav__link::after {
    content: '\e5cf'; /* Material icon "expand_more" */
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    font-weight: normal;
}

.main-nav__link.no-arrow::after {
    display: none;
}

.main-nav__link:hover {
    opacity: 0.8;
}

/* RIGHT ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.nav-access {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.nav-access:hover {
    opacity: 0.8;
}

.nav-cta {
    background-color: var(--cta-bg);
    color: var(--cta-text);
    padding: 8px 24px;
    border-radius: 8px; /* Pill/Rounded as per Nowports */
    font-weight: 600;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.nav-cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* --- ANIMATIONS (MD3 MOTION) --- */
.m3-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0, 0, 1), transform 0.8s cubic-bezier(0.2, 0, 0, 1);
    will-change: opacity, transform;
}

.m3-reveal--active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Children Support */
.m3-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.2, 0, 0, 1), transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.m3-stagger--active > * {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays (up to 6 items) */
.m3-stagger--active > *:nth-child(1) { transition-delay: 0.1s; }
.m3-stagger--active > *:nth-child(2) { transition-delay: 0.2s; }
.m3-stagger--active > *:nth-child(3) { transition-delay: 0.3s; }
.m3-stagger--active > *:nth-child(4) { transition-delay: 0.4s; }
.m3-stagger--active > *:nth-child(5) { transition-delay: 0.5s; }
.m3-stagger--active > *:nth-child(6) { transition-delay: 0.6s; }

/* Custom Scrollbar (Professional) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--md-sys-color-surface);
}
::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline-variant);
    border-radius: 10px;
    border: 3px solid var(--md-sys-color-surface);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-outline);
}

.lang-switcher {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.lang-switcher::after {
    content: '\e5cf';
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle .material-symbols-outlined {
    font-size: 32px;
}

@media (max-width: 1024px) {
    .menu-toggle { display: block; }
    .main-nav { 
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--header-bg);
        flex-direction: column;
        padding-top: 100px;
        transition: right 0.3s ease;
        box-shadow: -10px 0 30px rgba(0,0,0,0.3);
    }
    .main-nav.open { right: 0; }
    .main-nav__list { 
        flex-direction: column; 
        align-items: flex-start;
        padding: var(--sp-6);
    }
    .header-actions { display: none; } /* Hidden on mobile by default, usually inside menu */
}

/* --- MEGA MENU STYLES --- */
.main-nav__item--has-mega {
    position: static; 
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: var(--md-sys-elevation-3);
    border-top: 1px solid var(--md-sys-color-outline-variant);
    display: none;
    z-index: 1000;
    padding: var(--sp-10) 0;
    animation: m3-fade-in 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.main-nav__item--has-mega:hover .mega-menu {
    display: block;
}

.mega-menu__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-10);
}

.mega-menu__column h4 {
    color: var(--md-sys-color-primary);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: var(--sp-4);
    font-weight: 800;
    text-transform: uppercase;
}

.mega-menu__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.mega-menu__link {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    padding: 8px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.mega-menu__link:hover {
    background: var(--md-sys-color-surface-variant);
}

.mega-menu__link .material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
    padding: 8px;
    border-radius: 8px;
}

.mega-menu__link-text div:first-child {
    font-weight: 700;
    font-size: 0.95rem;
}

.mega-menu__link-text div:last-child {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 2px;
    line-height: 1.3;
}

@keyframes m3-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* --- PREMIUM SERVICE COMPONENTS --- */
.service-section {
    padding: var(--sp-16) 0;
    overflow: hidden;
}

.service-section--alt {
    background-color: var(--md-sys-color-surface-container-low);
}

.service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-10);
    align-items: center;
}

.service-grid--reverse {
    direction: rtl;
}

.service-grid--reverse > * {
    direction: ltr;
}

.service-image-container {
    position: relative;
    border-radius: var(--shape-xl);
    overflow: hidden;
    box-shadow: var(--md-sys-elevation-3);
}

.service-image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.service-image-container:hover img {
    transform: scale(1.05);
}

/* PROCESS STEPPER */
.process-stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-6);
    margin-top: var(--sp-10);
    position: relative;
}

.process-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.process-step__number {
    width: 48px;
    height: 48px;
    background: var(--md-sys-color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-bottom: var(--sp-3);
    z-index: 2;
    box-shadow: 0 0 0 8px var(--md-sys-color-primary-container);
}

.process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 24px;
    left: 48px;
    width: calc(100% + var(--sp-6) - 48px);
    height: 2px;
    background: var(--md-sys-color-outline-variant);
    z-index: 1;
}

/* STAT CARDS */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-4);
    margin-top: var(--sp-8);
}

.stat-card {
    background: #fff;
    padding: var(--sp-4);
    border-radius: var(--shape-l);
    border: 1px solid var(--md-sys-color-outline-variant);
    text-align: center;
}

.stat-card__value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--md-sys-color-primary);
    line-height: 1;
}

.stat-card__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 4px;
}

/* CTA BANNER */
.cta-banner {
    background: linear-gradient(135deg, var(--md-sys-color-on-primary-container) 0%, var(--md-sys-color-primary) 100%);
    color: #fff;
    padding: var(--sp-16) 0;
    border-radius: var(--shape-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .service-grid { grid-template-columns: 1fr; }
    .process-stepper { grid-template-columns: 1fr; }
    .process-step:not(:last-child)::after { display: none; }
}

/* ==================== MD3 FOOTER (PREMIUM DARK) ==================== */
.md3-footer {
    background: #001c39;
    color: #fff;
    padding: var(--sp-8) 0 var(--sp-6);
    position: relative;
}

.md3-footer .footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--sp-8);
}

.md3-footer .footer-brand img {
    margin-bottom: var(--sp-1);
    filter: brightness(0) invert(1);
    height: 76px;
}

.md3-footer .footer-brand p {
    opacity: 0.7;
    max-width: 340px;
    font-size: 1rem;
    line-height: 1.7;
}

.md3-footer .footer-section h4 {
    color: var(--md-sys-color-primary-container);
    margin-bottom: var(--sp-4);
    font-weight: 800;
    letter-spacing: 0.1em;
}

.md3-footer .footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.md3-footer .footer-section a, .md3-footer .contact-link {
    color: #fff;
    text-decoration: none;
    opacity: 0.6;
    font-size: 0.95rem;
    transition: opacity 0.3s;
}

.md3-footer .footer-section a:hover, .md3-footer .contact-link:hover {
    opacity: 1;
}

.md3-footer .contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.md3-footer .contact-link span.material-symbols-outlined {
    font-size: 20px;
    color: var(--md-sys-color-primary-container);
}

.md3-footer .footer-bottom {
    margin-top: var(--sp-12);
    padding-top: var(--sp-6);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-4);
}

/* Responsive Footer Rules */
@media (max-width: 1024px) {
    .md3-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-12) var(--sp-8);
    }
}

@media (max-width: 600px) {
    .md3-footer .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .md3-footer .footer-brand p {
        margin: 0 auto;
    }
    
    .md3-footer .contact-link {
        justify-content: center;
    }
    
    .md3-footer .footer-brand div {
        justify-content: center;
    }
    
    .md3-footer .footer-bottom {
        justify-content: center;
        text-align: center;
        flex-direction: column;
    }
}
