/* =========================================================
   COMPONENT STYLES
   Reusable UI elements: buttons, cards, FAQ items, form.
   These should be self-contained and composable.
   ========================================================= */

/* ---------- Buttons ----------
   Two visual variants (primary / ghost) plus size + width
   modifiers. Built with a soft shadow + lift on hover. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}
/* Primary uses the deep forest color for high contrast against sage backgrounds */
.btn--primary {
  background: var(--forest);
  color: var(--cream);
  box-shadow: 0 6px 20px rgba(31, 42, 35, 0.18);
}
.btn--primary:hover {
  background: var(--sage-dark);
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(31, 42, 35, 0.22);
}
/* Ghost is for secondary CTAs — outlined, transparent fill */
.btn--ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.btn--ghost:hover {
  background: var(--forest);
  color: var(--cream);
  transform: translateY(-2px);
}
.btn--large { padding: 1rem 1.9rem; font-size: 1.02rem; }
.btn--full { width: 100%; }


/* ---------- Hero Floating Cards ----------
   Three small cards floating around the fern. Each has its
   own staggered floating animation so the layout feels alive. */
.hero__card {
  position: absolute;
  background: var(--white);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-300);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  /* Each card uses the float keyframe with different delays */
  animation: float 6s ease-in-out infinite;
}
.hero__card-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-dark);
}
.hero__card strong {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--forest);
}
.hero__card small {
  font-size: 0.82rem;
  color: var(--forest-light);
}
/* Position each of the three cards distinctly */
.hero__card--1 { top: 8%; left: 0; animation-delay: 0s; }
.hero__card--2 { top: 38%; right: 0; animation-delay: 1.2s; }
.hero__card--3 { bottom: 8%; left: 12%; animation-delay: 2.4s; }


/* ---------- Problem Cards ----------
   Small icon + text cards arranged in a grid. */
.problem-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.problem-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--sage);
}
.problem-card__icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--sage-tint);
  color: var(--sage-dark);
  display: grid;
  place-items: center;
}
.problem-card__icon svg { width: 22px; height: 22px; }
.problem-card p {
  font-size: 0.98rem;
  color: var(--forest);
  font-weight: 500;
  line-height: 1.4;
}


/* ---------- Step Cards (How It Works) ----------
   Dark cards with large numbered badges. */
.step-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 232, 232, 0.12);
  padding: var(--space-4) var(--space-3);
  border-radius: var(--radius-lg);
  z-index: 1;
  transition: transform var(--transition), background var(--transition);
}
.step-card:hover {
  transform: translateY(-6px);
  background: rgba(143, 168, 125, 0.1);
  border-color: var(--sage);
}
.step-card__num {
  display: inline-grid;
  place-items: center;
  width: 64px; height: 64px;
  background: var(--sage);
  color: var(--forest);
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  border-radius: 50%;
  margin-bottom: var(--space-2);
  /* Soft shadow to lift the badge above the dotted connector line */
  box-shadow: 0 6px 18px rgba(143, 168, 125, 0.4);
}
.step-card h3 { margin-bottom: var(--space-1); }
.step-card p {
  color: rgba(232, 232, 232, 0.85);
  margin-bottom: var(--space-2);
  font-size: 1.02rem;
}
.step-card__detail {
  font-size: 0.92rem;
  color: rgba(232, 232, 232, 0.6);
  padding-top: var(--space-2);
  border-top: 1px solid rgba(232, 232, 232, 0.12);
}


/* ---------- Service Cards ---------- */
.service-card {
  padding: var(--space-4) var(--space-3);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
/* Decorative top border that grows from left on hover */
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 4px;
  background: var(--sage);
  transition: width 0.6s var(--ease);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.service-card:hover::before { width: 100%; }
.service-card__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: var(--sage-tint);
  color: var(--sage-dark);
  display: grid;
  place-items: center;
  margin-bottom: var(--space-2);
}
.service-card__icon svg { width: 28px; height: 28px; }
.service-card h3 { margin-bottom: var(--space-1); font-size: 1.3rem; }
.service-card p { color: var(--forest-light); font-size: 0.98rem; }


/* ---------- Stat Cards (Results section) ---------- */
.stat {
  text-align: center;
  padding: var(--space-4) var(--space-2);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid rgba(143, 168, 125, 0.4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.stat:hover { transform: translateY(-4px); }
.stat__num {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 600;
  color: var(--sage-dark);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.stat__label {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--forest);
  margin-bottom: 4px;
}
.stat__sub {
  font-size: 0.85rem;
  color: var(--forest-light);
}


/* ---------- Case Study Card ---------- */
.case-study {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-5);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
  /* Sage accent bar on the left edge */
  border-left: 4px solid var(--sage);
}
.case-study__head {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--gray-300);
}
.case-study__head h3 { font-size: 1.6rem; }
.case-study__intro {
  color: var(--forest-light);
  margin-bottom: var(--space-3);
  font-size: 1.05rem;
}
.case-study__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2) var(--space-3);
}
.case-study__list li {
  position: relative;
  padding-left: var(--space-3);
  font-size: 0.98rem;
  color: var(--forest);
}
.case-study__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--sage-dark);
  font-weight: 700;
}
.case-study__list strong {
  color: var(--sage-dark);
  font-family: var(--font-serif);
  font-size: 1.1rem;
}


/* ---------- Why Choose Us cards ---------- */
.why-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  transition: transform var(--transition), border-color var(--transition);
}
.why-card:hover {
  transform: translateX(6px);
  border-color: var(--sage);
}
.why-card__icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  background: var(--sage-tint);
  border-radius: var(--radius-md);
}
.why-card h4 { margin-bottom: 4px; }
.why-card p {
  font-size: 0.95rem;
  color: var(--forest-light);
  line-height: 1.5;
}


/* ---------- FAQ Accordion ---------- */
.faq-item {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.faq-item.is-open {
  border-color: var(--sage);
  box-shadow: var(--shadow-sm);
}
.faq-item__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  text-align: left;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--forest);
  font-family: var(--font-sans);
  transition: color var(--transition);
}
.faq-item__btn:hover { color: var(--sage-dark); }

/* The plus icon is built with two pseudo-elements that rotate to form an X */
.faq-item__plus {
  position: relative;
  width: 18px; height: 18px;
  flex-shrink: 0;
}
.faq-item__plus::before,
.faq-item__plus::after {
  content: '';
  position: absolute;
  background: var(--sage-dark);
  border-radius: 1px;
  transition: transform 0.4s var(--ease);
}
.faq-item__plus::before {
  top: 50%; left: 0;
  width: 100%; height: 2px;
  transform: translateY(-50%);
}
.faq-item__plus::after {
  left: 50%; top: 0;
  height: 100%; width: 2px;
  transform: translateX(-50%);
}
/* When open, rotate the vertical bar so it disappears */
.faq-item.is-open .faq-item__plus::after { transform: translateX(-50%) rotate(90deg); }

/* The body uses max-height transition for smooth expand/collapse */
.faq-item__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease), padding 0.4s var(--ease);
  padding: 0 var(--space-3);
}
.faq-item.is-open .faq-item__body {
  max-height: 320px;
  padding: 0 var(--space-3) var(--space-3);
}
.faq-item__body p {
  color: var(--forest-light);
  font-size: 1rem;
  line-height: 1.6;
}


/* ---------- Form ---------- */
.form {
  background: var(--white);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.form h3 {
  text-align: center;
  margin-bottom: var(--space-3);
  font-size: 1.4rem;
}
.form__row { margin-bottom: var(--space-2); }
.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--forest);
}
.form label span { display: block; margin-bottom: 6px; }
.form label em { color: var(--gray-500); font-style: normal; font-weight: 400; }

.form input,
.form select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--forest);
  background: var(--cream);
  transition: border-color var(--transition), background var(--transition);
}
.form input:focus,
.form select:focus {
  outline: none;
  border-color: var(--sage);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(143, 168, 125, 0.18);
}
.form__note {
  display: block;
  text-align: center;
  margin-top: var(--space-2);
  font-size: 0.82rem;
  color: var(--forest-light);
}

/* Success state — replaces form content after submit */
.form__success {
  text-align: center;
  padding: var(--space-3) 0;
}
.form__success h4 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--sage-dark);
  margin-bottom: var(--space-1);
}
.form__success p { color: var(--forest-light); }
