/* Custom animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Custom colors */
:root {
    --primary: #0a2540;
    --accent: #007bff;
    --light-bg: #f5f5f5;
    
    /* Figma-style variables */
    --brand: #007bff;
    --ink: #0a2540;
    --muted: #64748b;
    --bg: #f6f7fb;
    --line: #e5e7eb;
    --r: 16px;
    --shadow: 0 8px 30px rgba(2,18,46,.08);
}

.bg-primary { background-color: var(--primary); }
.bg-primary-dark { background-color: #071b2e; }
.bg-accent { background-color: var(--accent); }
.bg-light { background-color: var(--light-bg); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.border-accent { border-color: var(--accent); }

/* Header shadow on scroll */
.header-scrolled {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Mobile menu animation */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
    max-height: 300px;
}

/* Services Grid - Equal Heights */ 
#services-grid { 
    display: grid; 
    gap: 20px; 
    align-items: stretch; 
} 
@media (min-width:768px) { 
    #services-grid { 
        grid-template-columns: repeat(2,1fr); 
        gap: 24px; 
    } 
} 
@media (min-width:1024px) { 
    #services-grid { 
        grid-template-columns: repeat(3,1fr); 
        gap: 28px; 
    } 
} 

/* Compact container toggle */
#services-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.service-card { 
    position: relative; 
    background: #fff; 
    border-radius: var(--r); 
    border: 1px solid var(--line); 
    box-shadow: 0 1px 0 var(--line); 
    cursor: pointer; 
    transition: transform .25s, box-shadow .25s, border-color .25s, background-color .25s; 
    overflow: hidden; 
    height: fit-content; 
    min-height: 140px; 
}

/* Ensure inner content flexes to fill the card for uniform heights */
.service-card > .p-6 {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 20px;
}

/* Header layout inside the card */ 
.service-card .icon-badge { width: 44px; height: 44px; border-radius: 12px; } 
.service-card .title { font: 600 1.05rem/1.25 system-ui; } 
.service-card .tagline { font-size: .95rem; }

/* Compact card header as grid */
#services-grid.compact .service-card > .p-6 > .flex.items-center.justify-between.mb-4 {
    display: grid;
    grid-template-columns: 44px 1fr 18px;
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 4px;
    margin-bottom: 12px;
}

/* icon cell */
#services-grid.compact .service-card .icon-badge { 
    grid-column: 1; 
    grid-row: 1 / span 2; 
}

/* text stack */
#services-grid.compact .service-card .title { 
    grid-column: 2; 
    grid-row: 1; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

#services-grid.compact .service-card .tagline { 
    grid-column: 2; 
    grid-row: 2; 
    color: var(--brand); 
    opacity: .95;
    font-size: 0.9rem;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* chevron aligned to tagline baseline at right */
#services-grid.compact .service-card .chevron-icon { 
    grid-column: 3; 
    grid-row: 2; 
    justify-self: end; 
    align-self: center; 
    margin-left: 8px; 
}

#services-grid.compact .service-card .chevron-icon i { 
    width: 18px; 
    height: 18px; 
    opacity: .9; 
}

/* Icon block sizing */
#services-grid.compact .service-card .icon-badge {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: grid;
    place-items: center;
}

#services-grid.compact .service-card .icon-badge i {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
}

/* Title + subtitle stack */
#services-grid.compact .service-card .title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}
#services-grid.compact .service-card .tagline {
    margin: 2px 0 0;
    font-size: .9rem;
    color: #4b5563;
}

/* Chevron stays right */
#services-grid.compact .service-card .chevron-icon {
    justify-self: end;
}

/* Accordion spans full width under header row */
#services-grid.compact .service-card .accordion-content {
    margin-top: 10px;
    transition: max-height .35s ease;
}

/* gradient outline */ 
.service-card::before { 
    content: ""; 
    position: absolute; 
    inset: 0; 
    padding: 1px; 
    border-radius: calc(var(--r) + 0px); 
    background: linear-gradient(135deg, rgba(0,123,255,.35), rgba(139,92,246,.35)); 
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); 
    -webkit-mask-composite: xor; 
    mask-composite: exclude; 
    opacity: 0; 
    transition: opacity .25s; 
} 
.service-card:hover { 
    transform: translateY(-2px); 
    box-shadow: var(--shadow); 
} 
.service-card:hover::before { 
    opacity: 1; 
} 

/* left accent stripe */ 
.service-card::after { 
    content: ""; 
    position: absolute; 
    left: 0; 
    top: 0; 
    bottom: 0; 
    width: 4px; 
    background: #cbd5e1; 
    transition: background .25s, width .25s; 
} 
.service-card.expanded::after { 
    background: var(--brand); 
    width: 6px; 
}

/* Ensure uniform card heights within the services grid */
#services-grid {
    align-items: stretch;
    grid-auto-rows: auto;
}

/* header bits */ 
.icon-badge { 
    width: 42px; 
    height: 42px; 
    border-radius: 12px; 
    display: grid; 
    place-items: center; 
    background: color-mix(in srgb, var(--brand) 12%, white); 
    color: var(--brand); 
} 
.title { 
    font: 600 1rem/1.2 system-ui; 
    color: var(--ink); 
    margin: 0 0 2px; 
} 
.tagline { 
    color: var(--muted); 
    font-size: .9rem; 
    margin: 0; 
}
    margin: 0 0 2px;
}
.tagline {
    color: var(--muted);
    font-size: .9rem;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.4em * 2);
}

.chevron-icon { 
    color: var(--brand); 
    transition: transform .25s, color .25s; 
} 
.chevron-icon.rotated { 
    transform: rotate(180deg); 
}
/* Chevrons: smaller, right-aligned, always visible */ 
.chevron-icon i { width: 18px; height: 18px; opacity: .9; } 

/* accordion animation */ 
.accordion-content { 
    max-height: 0; 
    overflow: hidden; 
    border-top: 1px solid transparent; 
    transition: max-height .35s ease, border-color .25s, opacity .25s, transform .25s; 
    opacity: 0; 
    transform: translateY(-4px); 
} 
.accordion-content.expanded { 
    max-height: none; /* remove if you prefer fixed animation cap */
    border-top-color: #e2e8f0; 
    opacity: 1; 
    transform: translateY(0); 
}

/* Text clamping to keep collapsed rows tidy */ 
.title, .tagline { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; } 
.title { -webkit-line-clamp: 1; } 
.tagline { -webkit-line-clamp: 2; min-height: 2.4em; }

.content-inner { 
    padding-top: 16px; 
} 
.details { 
    color: #334155; 
    margin: 0 0 8px; 
} 
.benefits-head { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-weight: 600; 
    color: var(--ink); 
    margin: 12px 0; 
} 
.benefits { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
} 
.benefits li { 
    display: flex; 
    align-items: flex-start; 
    gap: 10px; 
    color: #475569; 
    margin: 6px 0; 
} 
.benefits .dot { 
    width: 6px; 
    height: 6px; 
    border-radius: 999px; 
    background: var(--brand); 
    margin-top: .45rem; 
    flex: 0 0 auto; 
}

/* check badge for benefits list */
.check-badge {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-top: 2px;
}
.check-badge i { width: 14px; height: 14px; }

.learn-more { 
    border: 0; 
    background: transparent; 
    color: var(--brand); 
    font-weight: 600; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    padding: 6px 0; 
    cursor: pointer; 
    transition: gap .2s, color .2s; 
} 
.learn-more:hover { 
    gap: 10px; 
    color: #0056b3; 
} 

/* expanded visual */ 
.service-card.expanded { 
    background: linear-gradient(#fff, #fff) padding-box, 
               radial-gradient(120% 120% at 0% 0%, #ffffff 0, #eff6ff 100%) border-box; 
    border-color: coloc-mix(in srol, vorr--brand) 4-%m var(--line) var(--brand) 40%, v;d
(--s*ieow)d-
motion: reduce) { 
    .service-card, .chevron-icon, .accordion-content { 
        transition: none; 
    } 
}

/* Fix button hover issues */
button {
    position: relative;
    overflow: visible;
}

button:hover {
    transform: none;
}

/* Specific fix for consultation button */
.consultation-btn {
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
}

.consultation-btn:hover {
    background-color: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

/* Active navigation state - blue color */
.nav-active {
    color: var(--accent) !important;
    font-weight: 600 !important;
}

/* Navigation button hover and active states */
nav button[onclick^="scrollToSection"]:hover,
#mobile-menu button[onclick^="scrollToSection"]:hover {
    color: var(--accent);
}

/* Ensure smooth transitions for navigation colors */
nav button[onclick^="scrollToSection"],
#mobile-menu button[onclick^="scrollToSection"] {
    transition: color 0.3s ease, font-weight 0.3s ease;
}