/**
 * @file Modern Stylesheet for LM Accounting
 * @description A professionally structured stylesheet using a sophisticated green color palette,
 * modern design patterns like glassmorphism, and smooth, custom-timed animations.
 */

/* --- Color Palette & Global Variables --- */
:root {
  --dark-green: #1e6a45; /* Darkest green, for primary headings & dark backgrounds */
  --charcoal-gray: #375534; /* Main text color & secondary dark elements */
  --medium-green: #6b9071; /* Primary accent for buttons, icons, and highlights */
  --light-green: #aec3b0; /* Lighter accent, often for hover states */
  --extra-light-green: #e3eed4; /* Light backgrounds for section separation */
  --white: #ffffff; /* Pure white for text on dark backgrounds */

  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --transition-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --header-height: 80px;
}

/* --- Base & Foundational Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--charcoal-gray);
  background: var(--white);
  -webkit-font-smoothing: antialiased; /* For crisper text */
}
main {
  overflow-x: hidden;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
}
h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--dark-green);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.section-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 2.5rem); /* Responsive font size */
  margin-bottom: 3rem;
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}
#preloader.hidden {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--extra-light-green);
  border-top-color: var(--medium-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Modern Header & Navigation --- */
#header {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  /* --- FIX: Set permanent white background and shadow for the header --- */
  background-color: var(--white);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  /* --- FIX: Removed background-color and box-shadow transitions --- */
  transition: height 0.4s var(--transition-smooth);
}

#header.scrolled {
  /* --- FIX: Removed redundant background, blur, and shadow styles --- */
  /* Styles are now applied to #header directly */
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  height: var(--header-height);
}
.logo-img {
  /* --- FIX: Increased logo height --- */
  height: 60px;
  width: auto;
  transition: height 0.3s ease;
}
#header.scrolled .logo-img {
  /* --- FIX: Increased scrolled logo height --- */
  height: 55px;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-links a {
  color: var(--charcoal-gray);
  text-decoration: none;
  font-weight: 500;
  font-family: var(--font-heading);
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 5px;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--medium-green);
  transition: width 0.4s var(--transition-smooth);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--dark-green);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* --- CTA Button --- */
.cta-button {
  background-color: var(--medium-green);
  color: var(--white);
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: 50px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(107, 144, 113, 0.3);
}
.cta-button:hover {
  background-color: var(--dark-green);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(107, 144, 113, 0.4);
}
.nav-cta::after {
  display: none;
}

/* --- Hamburger & Full-Screen Mobile Nav --- */
.hamburger-menu {
  display: none;
  cursor: pointer;
  z-index: 1001;
}
.hamburger-menu .bar {
  width: 25px;
  height: 3px;
  background-color: var(--charcoal-gray);
  margin: 5px 0;
  transition: all 0.4s var(--transition-smooth);
}
.mobile-nav {
  position: fixed;
  top: 0;
  left: 100%;
  width: 100%;
  height: 100%;
  background: var(--dark-green);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: left 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}
.mobile-nav a {
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 2rem;
  margin: 1.5rem 0;
  opacity: 0;
  transform: translateY(20px);
}
.mobile-nav.active {
  left: 0;
}
.mobile-nav.active a {
  animation: mobileNavLinkFade 0.5s ease forwards;
}
@keyframes mobileNavLinkFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.mobile-nav.active a:nth-child(2) {
  animation-delay: 0.1s;
}
.mobile-nav.active a:nth-child(3) {
  animation-delay: 0.2s;
}
.mobile-nav.active a:nth-child(4) {
  animation-delay: 0.3s;
}

/* Change hamburger color to white when menu is active */
.hamburger-menu.active .bar {
  background-color: var(--white);
}
.hamburger-menu.active .bar:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}
.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* --- Hero Section --- */
#hero {
  min-height: 100vh;
  background: linear-gradient(
      rgba(30, 106, 69, 0.8),
      rgba(30, 106, 69, 0.8)
    ),
    url('https://images.unsplash.com/photo-1554224155-1696413565d3?q=80&w=2070&auto=format&fit=crop')
      no-repeat center center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 0 1rem;
}
.hero-content h1 {
  font-size: clamp(2.8rem, 7vw, 4rem);
  color: var(--white);
  font-weight: 800;
}
.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
}

/* --- Services & Content Sections --- */
#about {
  background-color: var(--white);
}

/* --- FIX: Created alternating background colors for sections --- */
/* #approach is now white (default), #services and #why-us are light green */
#services,
#why-us {
  background-color: var(--extra-light-green);
}

.service-card-container {
  display: grid;
  /* --- FIX: Changed to auto-fit for 4 cards and better responsiveness --- */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  /* --- FIX: Removed overlap styles (margin-top, position, z-index) --- */
}
.service-card {
  background: var(--white);
  padding: 2.5rem;
  text-align: center;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.4s var(--transition-smooth),
    box-shadow 0.4s var(--transition-smooth);
}
.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}
.service-card i {
  font-size: 2.5rem;
  color: var(--medium-green);
  margin-bottom: 1.5rem;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-image {
  width: 100%;
  height: 450px;
  background: url('https://images.unsplash.com/photo-1521737604893-d14cc237f11d?q=80&w=1784&auto=format&fit=crop')
    no-repeat center center/cover;
  border-radius: 10px;
}
.core-values {
  list-style: none;
  margin-top: 1.5rem;
}
.core-values li {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}
.core-values i {
  color: var(--medium-green);
  margin-right: 1rem;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
.process-step span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--light-green);
  color: var(--dark-green);
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0 auto 1rem;
}

.accordion {
  max-width: 800px;
  margin: 0 auto;
}
.accordion-item {
  border-bottom: 1px solid var(--light-green);
}
.accordion-header {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 1.5rem 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--charcoal-gray);
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
}
.accordion-header:hover {
  color: var(--dark-green);
}
.accordion-header::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 10px;
  transition: transform 0.4s var(--transition-smooth);
}
.accordion-header.active::after {
  transform: rotate(180deg);
}
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}
.accordion-content ul {
  padding: 0.5rem 0 1.5rem 1rem;
  list-style-type: none;
}
.accordion-content li {
  margin-bottom: 0.5rem;
}

/* --- Stats & Contact --- */

/* --- FIX: Removed all styles for the old #why-us, .stats-container, and .stat --- */
/* The #why-us section now uses the .service-card styles from above */

.contact-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: flex-start;
}
.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: var(--font-body);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--medium-green);
  box-shadow: 0 0 0 3px rgba(107, 144, 113, 0.2);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--charcoal-gray);
  border: 2px solid transparent;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--medium-green);
}
.contact-card i {
  font-size: 2rem;
  color: var(--dark-green);
}
.contact-card h3 {
  margin-bottom: 0.25rem;
  color: var(--dark-green);
}
.contact-card p {
  margin: 0;
  font-size: 1rem;
}
.contact-address {
  padding-top: 1rem;
  border-top: 1px solid var(--light-green);
}
.contact-address i {
  color: var(--dark-green);
  margin-right: 1rem;
}

/* --- Footer & Back to Top --- */
footer {
  background-color: var(--charcoal-gray);
  color: var(--white);
  text-align: center;
  padding: 2rem;
}
#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--dark-green);
  color: var(--white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  font-size: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  text-decoration: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}
#back-to-top:hover {
  background-color: var(--medium-green);
  transform: scale(1.1);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .nav-links {
    display: none;
  }
  .hamburger-menu {
    display: block;
  }
  .service-card-container,
  .process-flow,
  /* --- FIX: Removed .stats-container --- */
  .about-content,
  .contact-container {
    grid-template-columns: 1fr;
  }
  .about-image {
    margin-top: 2rem;
    height: 300px;
  }
  .hero-content h1 {
    font-size: 2.8rem;
  }
}
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .section-title {
    font-size: 2rem;
  }
  .container {
    padding: 3rem 1.5rem;
  }
  .contact-container {
    gap: 2rem;
  }
}