.features-section {
  padding: 5rem 0;
  background-color: var(--bg-color);
  position: relative;
  z-index: 1;
}

.features-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  opacity: 0.2;
}

.features-header {
  max-width: 680px;
  margin: 0 auto 3rem;
  animation: fadeInUp 0.8s ease forwards;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Grid Layout */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* Feature Cards */
.feature-card {
  padding: 1.15rem 1.15rem 1rem;
  border-radius: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  z-index: 1;
  overflow: hidden;
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
  animation-delay: calc(var(--animation-order) * 0.1s);
}

.feature-card:nth-child(1) { --animation-order: 1; }
.feature-card:nth-child(2) { --animation-order: 2; }
.feature-card:nth-child(3) { --animation-order: 3; }
.feature-card:nth-child(4) { --animation-order: 4; }
.feature-card:nth-child(5) { --animation-order: 5; }
.feature-card:nth-child(6) { --animation-order: 6; }

/* Subtle inner glow */
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.06), transparent 40%);
  z-index: -1;
  border-radius: 1rem;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06), 0 0 12px var(--primary-glow);
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(to bottom, var(--card-bg), rgba(59, 130, 246, 0.02));
}

.feature-card:hover::after {
  opacity: 1;
}

/* Decorative top border */
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, #3b82f6, #ec4899);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 1;
}

/* Icon */
.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.65rem;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--primary-color);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), var(--shadow-sm);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.feature-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: destination-out;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.15);
  color: #8b5cf6;
}

.feature-card:hover .feature-icon::after {
  opacity: 1;
}

.feature-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.feature-card__meta {
  flex: 1;
  min-width: 0;
}

.feature-card__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.feature-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  transition: color 0.3s ease;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-card:hover .feature-title {
  color: var(--primary-color);
}

.feature-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feature-plan-badge {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.feature-plan-badge--core {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.feature-plan-badge--standard {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.25);
}

/* Dual mockup split — both halves are admin UI previews */
.feature-card__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  align-items: stretch;
}

.feature-preview {
  color-scheme: light;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 0.62rem;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
}

.feature-preview--alt {
  background: #f1f5f9;
}

.feature-preview__tab {
  padding: 0.28rem 0.5rem;
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-preview--alt .feature-preview__tab {
  background: #dbeafe;
  color: #1d4ed8;
  border-bottom-color: #bfdbfe;
}

.feature-preview__body {
  padding: 0.4rem 0.45rem;
  color: #334155;
  flex: 1;
  min-height: 4.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
}

.fp-row--compact {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
  padding: 0.2rem 0;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
}

.fp-row--compact:last-child { border-bottom: none; }

.fp-row--log {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.22rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.58rem;
}

.fp-row--log:last-child { border-bottom: none; }

.fp-name {
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-badge {
  display: inline-block;
  padding: 0.08rem 0.28rem;
  border-radius: 999px;
  font-size: 0.5rem;
  font-weight: 700;
  text-align: center;
}

.fp-badge--green { background: #dcfce7; color: #15803d; }
.fp-badge--amber { background: #fef3c7; color: #b45309; }
.fp-badge--blue { background: #dbeafe; color: #1d4ed8; }

.fp-attendance-bars,
.fp-bar-item { display: flex; flex-direction: column; gap: 0.2rem; }

.fp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.58rem;
  color: #475569;
}

.fp-bar-track {
  height: 4px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.fp-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.fp-exam-row {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.58rem;
}

.fp-exam-bar {
  height: 3px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.fp-exam-fill {
  height: 100%;
  border-radius: 999px;
}

.fp-exam-fill--green { background: #22c55e; }
.fp-exam-fill--blue { background: #3b82f6; }
.fp-exam-fill--amber { background: #f59e0b; }

.fp-exam-pct {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.55rem;
}

.fp-fee-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.3rem;
  align-items: center;
  padding: 0.15rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.58rem;
}

.fp-fee-row:last-child { border-bottom: none; }

.fp-fee-amt {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.55rem;
}

.fp-sms-bubble {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.55rem;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-sms-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.55rem;
  color: #64748b;
}

.fp-row--merit {
  display: grid;
  grid-template-columns: 1.1rem 1fr auto;
  gap: 0.3rem;
  padding: 0.2rem 0;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.58rem;
}

.fp-row--merit:last-child { border-bottom: none; }

.fp-rank {
  font-weight: 800;
  color: #2563eb;
  text-align: center;
}

.fp-gpa {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.55rem;
}

/* Mini bar chart — fee collection / report trend */
.fp-chart-cols,
.feature-preview__body:has(.fp-chart-col) {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-around;
  gap: 0.25rem;
}

.feature-preview__body:has(.fp-chart-col) {
  padding-bottom: 0.3rem;
}

.fp-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.fp-chart-col span {
  font-size: 0.48rem;
  color: #64748b;
  font-weight: 600;
}

.fp-chart-bar {
  width: 100%;
  max-width: 1.1rem;
  min-height: 4px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-radius: 2px 2px 0 0;
}

.fp-chart-bar--teal {
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
}
