/* Reset box-sizing globally */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Root variables */
:root {
  --primary: #FE2C55;
  --primary-dark: #E41E4A;
  --secondary: #25F4EE;
  --dark: #121212;
  --gray-dark: #333;
  --gray-medium: #666;
  --gray-light: #f1f1f2;
  --white: #ffffff;
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Prevent horizontal scroll globally */
body, html {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Container */
.features-container {
  width: 100%;
  max-width: 1280px;
  margin: 180px auto 0;
  padding: 2rem 1.5rem;
  overflow-x: hidden; /* extra safeguard */
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
  user-select: text;
  padding: 0 1rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 0 auto 1.25rem;
  line-height: 1.3;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.section-header p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--gray-medium);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
  padding: 0 1rem;
  user-select: text;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

/* Feature Cards */
.feature {
  background-color: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  user-select: text;
}

.feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
  transition: height 0.3s ease;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature:hover::before {
  height: 100%;
}

.feature h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature p {
  font-size: 1rem;
  color: var(--gray-medium);
  line-height: 1.7;
}

/* CTA Section */
.cta-section {
  text-align: center;
  margin: 4rem 1rem 2rem;
  width: 100%;
  overflow-x: hidden;
  padding: 0 1rem; /* Add padding instead of margin for spacing */
  box-sizing: border-box;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3);
  border: none;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  white-space: normal;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(254, 44, 85, 0.4);
}

.cta-button:active {
  transform: translateY(0);
}

/* FAQ */
.faq {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 3rem 0;
}

.faq-item {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  cursor: pointer;
}

.faq-item:hover {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.faq-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-item p {
  font-size: 0.95rem;
  color: var(--gray-medium);
  line-height: 1.7;
  margin-top: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
  user-select: text;
}

.faq-item.active p {
  max-height: 300px;
  margin-top: 1rem;
}

.faq-toggle {
  width: 24px;
  height: 24px;
  position: relative;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-toggle::before,
.faq-toggle::after {
  content: '';
  position: absolute;
  background-color: var(--primary);
  transition: transform 0.3s ease;
}

.faq-toggle::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
}

.faq-toggle::after {
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

.faq-item.active .faq-toggle::after {
  transform: translateX(-50%) rotate(90deg);
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feature,
.faq-item {
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.feature:nth-child(1) {
  animation-delay: 0.1s;
}

.feature:nth-child(2) {
  animation-delay: 0.2s;
}

.feature:nth-child(3) {
  animation-delay: 0.3s;
}

.feature:nth-child(4) {
  animation-delay: 0.4s;
}

.feature:nth-child(5) {
  animation-delay: 0.5s;
}

.feature:nth-child(6) {
  animation-delay: 0.6s;
}

/* Responsive */
@media (max-width: 1024px) {
  .features-container {
    padding: 1.5rem;
  }
  .features-grid {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .section-header {
    margin-bottom: 2rem;
  }
  .feature {
    padding: 1.5rem;
  }
  .cta-button {
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .features-container {
    padding: 1rem;
    margin-top: 60px;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .faq-item {
    padding: 1.25rem;
  }
  .cta-button {
    width: 100%;
    padding: 1rem;
  }
}
