/* ── Features Page Styles ── */

/* Hero */
.features-hero {
  padding: 100px 0 70px;
  background: linear-gradient(135deg, #FFF5F2 0%, #FFF 40%, #f0fafb 100%);
  overflow: hidden;
  position: relative;
}

.features-hero::after {
  content: "";
  position: absolute;
  top: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 56, 15, .06) 0%, transparent 70%);
  pointer-events: none;
}

.features-hero-inner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.features-hero-inner h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 18px;
}

.features-hero-inner > p {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  margin: 0 0 32px;
  line-height: 1.8;
}

.features-hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: #fff;
}

.hero-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
}

.hero-badge .badge-dot.orange {
  background: var(--color-secondary);
}

.hero-badge .badge-dot.cyan {
  background: var(--color-accent-dark);
}

/* ── Architecture Section ── */
.arch-section {
  padding: 80px 0;
  background: var(--color-bg-subtle);
}

.arch-header {
  text-align: center;
  margin-bottom: 56px;
}

.pipeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
}

.pipeline-step {
  flex: 1;
  text-align: center;
  padding: 28px 16px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--color-border);
  position: relative;
  transition: all .3s;
  min-width: 0;
}

.pipeline-step:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.pipeline-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.pipeline-icon.mic {
  background: rgba(242, 56, 15, .08);
}

.pipeline-icon.cloud {
  background: rgba(59, 130, 246, .08);
}

.pipeline-icon.ai {
  background: rgba(16, 185, 129, .08);
}

.pipeline-icon.doc {
  background: rgba(242, 148, 65, .08);
}

.pipeline-step h4 {
  font-size: .85rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.pipeline-step p {
  font-size: .72rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

.pipeline-arrow {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  font-weight: 300;
}

.pipeline-arrow svg {
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  opacity: .4;
}

/* Detailed pipeline below */
.pipeline-detail {
  max-width: 960px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.detail-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--color-border);
  transition: all .3s;
}

.detail-card:hover {
  box-shadow: var(--shadow-md);
}

.detail-card h4 {
  font-size: .85rem;
  font-weight: 700;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-card h4 .num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  font-size: .72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-card p {
  font-size: .82rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.7;
}

.detail-card .tech-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* ── Before / After Section ── */
.ba-section {
  padding: 80px 0;
  background: var(--color-bg);
}

.ba-header {
  text-align: center;
  margin-bottom: 56px;
}

.ba-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 880px;
  margin: 0 auto;
}

.ba-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
  transition: all .3s;
}

.ba-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.ba-before,
.ba-after {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ba-before {
  background: rgba(239, 68, 68, .03);
}

.ba-after {
  background: rgba(16, 185, 129, .03);
}

.ba-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
}

.ba-before .ba-label {
  color: var(--color-error);
}

.ba-after .ba-label {
  color: var(--color-success);
}

.ba-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
}

.ba-before .ba-text {
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, .3);
  color: var(--color-text-secondary);
}

.ba-after .ba-text {
  color: var(--color-text);
}

.ba-desc {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.ba-divider {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-subtle);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

.ba-divider svg {
  width: 20px;
  height: 20px;
  color: var(--color-secondary);
}

.ba-category-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.ba-category-tag.medical {
  background: rgba(59, 130, 246, .08);
  color: #3B82F6;
}

.ba-category-tag.drug {
  background: rgba(168, 85, 247, .08);
  color: #A855F7;
}

.ba-category-tag.acronym {
  background: rgba(236, 72, 153, .08);
  color: #EC4899;
}

.ba-category-tag.context {
  background: rgba(245, 158, 11, .08);
  color: #F59E0B;
}

.ba-category-tag.custom {
  background: rgba(16, 185, 129, .08);
  color: #10B981;
}

/* ── Stats Banner ── */
.stats-banner {
  padding: 48px 0;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-block strong {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-block span {
  font-size: .82rem;
  opacity: .85;
}

/* ── Custom Rules Section ── */
.custom-section {
  padding: 80px 0;
  background: var(--color-bg-subtle);
}

.custom-header {
  text-align: center;
  margin-bottom: 56px;
}

.custom-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.custom-demo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.custom-demo-header {
  padding: 12px 20px;
  background: #1e1e2e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.custom-demo-dot:nth-child(1) { background: #ff5f56; }
.custom-demo-dot:nth-child(2) { background: #ffbd2e; }
.custom-demo-dot:nth-child(3) { background: #27c93f; }

.custom-demo-title {
  font-size: .72rem;
  color: rgba(255,255,255,.5);
  margin-left: 8px;
}

.custom-demo-body {
  padding: 24px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: .82rem;
  line-height: 2;
  background: #1e1e2e;
  color: #cdd6f4;
  min-height: 200px;
}

.code-comment {
  color: #6c7086;
}

.code-key {
  color: #89b4fa;
}

.code-string {
  color: #a6e3a1;
}

.code-arrow {
  color: #f38ba8;
}

.code-bracket {
  color: #fab387;
}

.custom-text h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.3;
}

.custom-text p {
  font-size: .9rem;
  color: var(--color-text-secondary);
  margin: 0 0 20px;
  line-height: 1.8;
}

.custom-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .85rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.custom-features li .check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(16, 185, 129, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.custom-features li .check svg {
  width: 12px;
  height: 12px;
  color: var(--color-success);
}

/* ── Pricing Section ── */
.pricing-section {
  padding: 80px 0;
  background: var(--color-bg);
}

.pricing-header {
  text-align: center;
  margin-bottom: 56px;
}

.pricing-table-wrap {
  max-width: 880px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.pricing-table thead th {
  padding: 18px 20px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-muted);
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
}

.pricing-table thead th:first-child {
  width: 32%;
}

.pricing-table thead th.highlight-col {
  background: rgba(242, 96, 12, .06);
  color: var(--color-secondary);
  border-bottom-color: rgba(242, 96, 12, .2);
}

.pricing-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table tbody td.highlight-col {
  background: rgba(242, 96, 12, .03);
  font-weight: 600;
}

.pricing-table .price-value {
  font-size: 1rem;
  font-weight: 700;
}

.pricing-table .price-value.primary {
  color: var(--color-secondary);
}

.pricing-table .feature-check {
  color: var(--color-success);
  font-weight: 700;
}

.pricing-table .feature-x {
  color: var(--color-text-muted);
}

.pricing-table .feature-label {
  font-weight: 600;
  color: var(--color-text);
}

.pricing-note {
  max-width: 880px;
  margin: 16px auto 0;
  font-size: .75rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ── Pricing Cards (visual comparison) ── */
.pricing-visual {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 880px;
  margin: 0 auto 40px;
}

.price-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 32px 24px;
  background: #fff;
  text-align: center;
  transition: all .3s;
  position: relative;
}

.price-card:hover {
  box-shadow: var(--shadow-md);
}

.price-card.featured {
  border-color: var(--color-secondary);
  box-shadow: 0 4px 24px rgba(242, 96, 12, .15);
}

.price-card.featured::before {
  content: "RECOMMENDED";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-secondary);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 4px 16px;
  border-radius: 999px;
}

.price-card-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

.price-card-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 4px;
}

.price-card.featured .price-card-price {
  color: var(--color-secondary);
}

.price-card-unit {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.price-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

.price-card-features li {
  padding: 8px 0;
  font-size: .82rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
}

.price-card-features li:last-child {
  border-bottom: none;
}

.price-card-features li .icon-check {
  color: var(--color-success);
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.price-card-features li .icon-x {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: .85rem;
  flex-shrink: 0;
}

/* ── CTA for features page ── */
.features-cta {
  padding: 80px 0;
  background: linear-gradient(180deg, #FFF 0%, #FFF5F2 100%);
  text-align: center;
}

.features-cta h2 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.features-cta p {
  color: var(--color-text-secondary);
  font-size: .95rem;
  margin: 0 0 32px;
  line-height: 1.7;
}

.features-cta .cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .pipeline {
    flex-direction: column;
    gap: 0;
  }

  .pipeline-arrow {
    transform: rotate(90deg);
    flex: 0 0 32px;
  }

  .pipeline-detail {
    grid-template-columns: 1fr;
  }

  .ba-card {
    grid-template-columns: 1fr;
  }

  .ba-divider {
    width: 100%;
    height: 40px;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .custom-layout {
    grid-template-columns: 1fr;
  }

  .pricing-visual {
    grid-template-columns: 1fr;
  }

  .features-hero-inner h1 {
    font-size: 1.8rem;
  }

  .pricing-table-wrap {
    overflow-x: auto;
  }
}
