/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   CSS Custom Properties (from index.css / Tailwind theme)
   ============================================================ */
:root {
    /* 5Lobes Brand Colors */
    --primary: #007bff;
    --primary-foreground: #ffffff;
    --secondary: #0a192f;
    --secondary-foreground: #ffffff;
    --accent: #f0f7ff;
    --accent-foreground: #0a192f;
    --background: #ffffff;
    --foreground: #2d3436;
    --muted: #fcfcfc;
    --muted-foreground: #636e72;
    --card: #ffffff;
    --card-foreground: #2d3436;
    --border: #eeeeee;
    --input: #dddddd;
    --ring: #007bff;
    --destructive: #ef4444;
    --success: #16a34a;
    --radius: 0.5rem;

    /* Shadows */
    --shadow-nav: 0 2px 15px rgba(0,0,0,0.05);
    --shadow-card: 0 8px 25px rgba(0,0,0,0.05);
    --shadow-form: 0 10px 30px rgba(0,0,0,0.08);

    /* Transitions */
    --transition-smooth: 0.3s ease;
}

/* ============================================================
   Base Reset & Body
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    border-color: var(--border);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--background);
    color: var(--foreground);
}

/* ============================================================
   Custom Component Classes (from @layer components)
   ============================================================ */
.section-padding {
    padding-top: 5rem;
    padding-bottom: 5rem;
    padding-left: 8%;
    padding-right: 8%;
}

.about-card {
    padding: 2rem;
    background-color: var(--accent);
    border-radius: 0.75rem;
    height: 100%;
}

.about-card-title {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin-top: 0;
}

.why-item {
    display: flex;
    gap: 1rem;
}

.mantra-item {
    background: rgba(255,255,255,0.10);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border-top: 4px solid var(--primary);
    transition: all 0.3s ease;
}
.mantra-item:hover {
    background: rgba(255,255,255,0.17);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ============================================================
   Custom Utility Classes (from @layer utilities)
   ============================================================ */
.shadow-nav { box-shadow: var(--shadow-nav); }
.shadow-card { box-shadow: var(--shadow-card); }
.shadow-form { box-shadow: var(--shadow-form); }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Service card hover */
.service-card-hover {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.service-card-hover:hover {
    border-color: rgba(0,123,255,0.6);
    box-shadow: 0 12px 40px -8px rgba(0,123,255,0.18), 0 4px 16px -4px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}
.service-icon-glow {
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.service-card-hover:hover .service-icon-glow {
    background-color: rgba(0,123,255,0.15);
    box-shadow: 0 0 20px 4px rgba(0,123,255,0.2);
}

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

.animate-fade-in { animation: fadeIn 0.4s ease both; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease both; }

/* ============================================================
   Navigation
   ============================================================ */
nav#main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding-left: 8%;
    padding-right: 8%;
    background-color: var(--background);
    box-shadow: var(--shadow-nav);
    position: sticky;
    top: 0;
    z-index: 50;
}

nav#main-nav .nav-desktop {
    display: none;
    list-style: none;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
}

@media (min-width: 768px) {
    nav#main-nav .nav-desktop { display: flex; }
    nav#main-nav .mobile-menu-btn { display: none !important; }
}

.nav-link {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1;
}
.nav-link:hover { color: var(--primary); }

/* Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    z-index: 50;
    animation: fadeIn 0.2s ease;
}
.dropdown-menu.services-menu { width: 18rem; }
.dropdown-menu.partners-menu { width: 13rem; }
.dropdown-menu.open { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.dropdown-item:hover {
    background-color: var(--accent);
    color: var(--primary);
}

.chevron-icon {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.chevron-icon.rotated { transform: rotate(180deg); }

/* Mobile Menu */
#mobile-menu {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--background);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    z-index: 40;
    animation: fadeIn 0.2s ease;
}
#mobile-menu.open { display: block; }
#mobile-menu ul { list-style: none; padding: 1rem 0; margin: 0; }
#mobile-menu ul li { padding: 0.75rem 8%; }
.mobile-submenu {
    display: none;
    margin-top: 0.5rem;
    margin-left: 1rem;
    border-left: 2px solid rgba(0,123,255,0.2);
    padding-left: 1rem;
}
.mobile-submenu.open { display: block; }
.mobile-submenu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}
.mobile-submenu a:hover { color: var(--primary); }
.mobile-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: var(--secondary);
    transition: background-color 0.2s;
}
.mobile-menu-btn:hover { background-color: var(--accent); }

/* ============================================================
   Hero Carousel
   ============================================================ */
#home.hero-section {
    position: relative;
    width: 100%;
    height: 55vh;
    overflow: hidden;
}
@media (min-width: 768px) { #home.hero-section { height: 65vh; } }
@media (min-width: 1024px) { #home.hero-section { height: 75vh; } }

.slides-container {
    display: flex;
    height: 100%;
    transition: transform 0.7s ease-in-out;
}
.slide {
    position: relative;
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
}
.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.70), rgba(0,0,0,0.40), transparent);
}
.slide-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 8%;
    padding-right: 8%;
}
.slide-content .inner {
    max-width: 48rem;
    text-align: center;
    color: white;
}
.slide-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    margin-top: 0;
}
@media (min-width: 768px) { .slide-content h1 { font-size: 2.25rem; margin-bottom: 1.5rem; } }
@media (min-width: 1024px) { .slide-content h1 { font-size: 3rem; } }
@media (min-width: 1280px) { .slide-content h1 { font-size: 3.75rem; } }

.slide-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.75rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}
@media (min-width: 768px) { .slide-content p { font-size: 1.125rem; margin-bottom: 1rem; } }
@media (min-width: 1024px) { .slide-content p { font-size: 1.25rem; } }

.hero-tagline {
    position: absolute;
    top: 0.75rem;
    left: 8%;
    z-index: 20;
    font-style: italic;
    color: white;
    font-size: 1rem;
    text-shadow: 0px 2px 6px rgba(0,0,0,0.6);
}
@media (min-width: 768px) { .hero-tagline { top: 1.25rem; font-size: 1.125rem; } }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.20);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s;
}
.carousel-btn:hover { background: rgba(255,255,255,0.30); }
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }
@media (min-width: 768px) {
    .carousel-btn { width: 3rem; height: 3rem; }
    .carousel-btn.prev { left: 2rem; }
    .carousel-btn.next { right: 2rem; }
}

.carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
@media (min-width: 768px) { .carousel-dots { bottom: 2rem; } }

.dot {
    height: 0.625rem;
    width: 0.625rem;
    border-radius: 9999px;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}
.dot.active { background: white; width: 1.5rem; }
.dot:hover { background: rgba(255,255,255,0.7); }
@media (min-width: 768px) {
    .dot { height: 0.75rem; width: 0.75rem; }
    .dot.active { width: 2rem; }
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.625rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}
.hero-btn:hover {
    background: rgba(0,123,255,0.9);
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0,123,255,0.3);
}
@media (min-width: 768px) {
    .hero-btn { padding: 0.75rem 2rem; font-size: 1rem; }
}

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--background);
    border-radius: 0.75rem;
    overflow: hidden;
    max-height: 90vh;
    width: 90vw;
    max-width: 72rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

#service-modal-body {
    overflow-y: auto;
    flex: 1;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    background: var(--secondary);
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: white;
    transition: background 0.2s, opacity 0.2s;
}
.modal-close:hover { opacity: 0.8; }

/* Split modal layout */
.modal-split {
    display: grid;
    grid-template-columns: 1fr;
    overflow-y: auto;
    max-height: 90vh;
    min-height: 420px;
}
@media (min-width: 1024px) {
    .modal-split { grid-template-columns: 1fr 1fr; }
}

.modal-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 1.5rem;
    order: 2;
}
@media (min-width: 1024px) {
    .modal-left { padding: 2rem; order: 1; }
}

.modal-right {
    position: relative;
    min-height: 200px;
    order: 1;
}
@media (min-width: 1024px) { .modal-right { order: 2; } }

.modal-right img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem 0.75rem 0 0;
}
@media (min-width: 1024px) {
    .modal-right img {
        border-radius: 0 0.75rem 0.75rem 0;
    }
}
.modal-right.white-bg {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-right.white-bg img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Full content modal (scrollable) */
.modal-full .modal-box {
    max-width: 72rem;
}
.modal-full-scroll {
    overflow-y: auto;
    max-height: 90vh;
}

.modal-hero-banner {
    position: relative;
    height: 12rem;
    overflow: hidden;
    flex-shrink: 0;
}
@media (min-width: 768px) { .modal-hero-banner { height: 14rem; } }

.modal-hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4), transparent);
}
.modal-hero-text {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 1.5rem 2rem;
}
.modal-hero-text h2 { color: white; margin: 0.25rem 0; font-size: 1.5rem; }
@media (min-width: 768px) { .modal-hero-text h2 { font-size: 1.875rem; } }
.modal-hero-text .subtitle { color: rgba(255,255,255,0.8); font-size: 0.875rem; margin-top: 0.25rem; }
.modal-hero-text .tag { color: rgba(255,255,255,0.8); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }

/* Accordion phases */
.phase-item {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.phase-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.phase-btn:hover { background: rgba(240,247,255,0.5); }
.phase-btn .phase-num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: rgba(0,123,255,0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.phase-content {
    display: none;
    padding: 0.5rem 1rem 1rem 1rem;
}
.phase-content.open { display: block; }

/* Sub-modal (products/industries) */
.submodal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.submodal-overlay.open { display: flex; }
.submodal-box {
    background: var(--background);
    border-radius: 0.75rem;
    padding: 2rem;
    max-width: 32rem;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

/* Testing type sub-modal */
.testing-submodal-box {
    background: var(--background);
    border-radius: 0.75rem;
    overflow: hidden;
    max-width: 48rem;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.testing-submodal-grid {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 300px;
}
@media (min-width: 768px) { .testing-submodal-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   Form Styles
   ============================================================ */
.form-input {
    display: block;
    width: 100%;
    height: 2.75rem;
    padding: 0 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--foreground);
    background: var(--background);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}
.form-textarea {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--foreground);
    background: var(--background);
    resize: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-family: inherit;
}
.btn-primary:hover { background: rgba(0,123,255,0.9); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* Toast notification */
#toast-msg {
    display: none;
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    animation: fadeInUp 0.3s ease;
    white-space: nowrap;
}
#toast-msg.success { background: #16a34a; color: white; display: block; }
#toast-msg.error { background: #ef4444; color: white; display: block; }

/* ============================================================
   Scroll-to-top & WhatsApp
   ============================================================ */
#scroll-top-btn {
    position: fixed;
    bottom: 6rem;
    right: 1.5rem;
    z-index: 50;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: #0a192f;
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: all 0.3s;
    opacity: 0;
    transform: translateY(1rem);
    pointer-events: none;
}
#scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#scroll-top-btn:hover {
    background: var(--primary);
    border-color: transparent;
    transform: scale(1.1);
}

/* ============================================================
   Responsive helpers
   ============================================================ */
@media (max-width: 767px) {
    .modal-split { grid-template-columns: 1fr; }
    .modal-right img {
        border-radius: 0.75rem 0.75rem 0 0;
    }
}
