/* ============================================================
   AUTODEB — Cómo Funciona Page
   ============================================================ */

.how-hero {
  padding-top: calc(var(--header-height) + var(--sp-20));
  padding-bottom: var(--sp-12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* ── Process Steps ── */
.process-section {
  padding-block: var(--sp-20);
}
.process-timeline {
  position: relative;
  max-width: 900px;
  margin-inline: auto;
}
.process-timeline::before {
  content: '';
  position: absolute;
  left: 60px;
  top: 40px;
  bottom: 40px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
  opacity: 0.3;
}
.process-step {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--sp-8);
  margin-bottom: var(--sp-12);
  position: relative;
  align-items: flex-start;
}
.process-step:last-child { margin-bottom: 0; }
.step-number-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}
.step-number {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-extrabold);
  color: #fff;
  box-shadow: var(--shadow-glow);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.step-connector {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
  opacity: 0.25;
  min-height: 40px;
}
.process-step:last-child .step-connector { display: none; }
.step-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--sp-6) var(--sp-8);
  transition: all var(--ease-base);
}
.step-content:hover {
  border-color: rgba(124,58,237,0.25);
  box-shadow: var(--shadow-md);
}
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.step-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}
.step-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-4);
}
.step-details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.step-tag {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.15);
  color: var(--color-primary-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* ── Flow Diagram ── */
.flow-section {
  padding-block: var(--sp-20);
  background: var(--bg-secondary);
}
.flow-diagram {
  max-width: 900px;
  margin-inline: auto;
}
.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.flow-node {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-4) var(--sp-5);
  text-align: center;
  min-width: 130px;
  transition: all var(--ease-base);
  position: relative;
}
.flow-node:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}
.flow-node.primary {
  border-color: var(--color-primary);
  background: rgba(124,58,237,0.08);
}
.flow-node.secondary {
  border-color: var(--color-secondary);
  background: rgba(6,182,212,0.08);
}
.flow-node.success {
  border-color: var(--color-accent);
  background: rgba(16,185,129,0.08);
}
.flow-node-icon {
  width: 34px;
  height: 34px;
  margin-bottom: var(--sp-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}
.flow-node-icon svg {
  width: 28px;
  height: 28px;
}
.flow-icon-letter {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  line-height: 1;
}
.flow-node.primary .flow-node-icon { color: #fff; }
.flow-node.secondary .flow-node-icon { color: var(--color-secondary-light); }
.flow-node.success .flow-node-icon { color: var(--color-accent-light); }
.flow-node:not(.primary):not(.secondary):not(.success) .flow-node-icon {
  color: var(--color-primary-light);
}
.flow-node-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}
.flow-node-subtitle {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.flow-arrow {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}
.flow-arrow svg { width: 20px; height: 20px; }
.flow-arrow-down {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-4);
  color: var(--text-tertiary);
}
.flow-arrow-down svg { width: 20px; height: 20px; }
.flow-label {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: var(--weight-bold);
  font-family: var(--font-mono);
  color: var(--color-primary);
  background: var(--bg-card);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(124,58,237,0.3);
  white-space: nowrap;
}

/* ── Processing States ── */
.states-section {
  padding-block: var(--sp-20);
}
.states-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-12);
}
.state-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--sp-6);
  text-align: center;
  transition: all var(--ease-base);
}
.state-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.state-indicator {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  margin: 0 auto var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.state-indicator svg { width: 22px; height: 22px; }
.state-pending  { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); }
.state-pending  .state-indicator { background: rgba(245,158,11,0.2); }
.state-pending  svg { color: #FCD34D; }
.state-process  { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.25); }
.state-process  .state-indicator { background: rgba(59,130,246,0.2); }
.state-process  svg { color: #93C5FD; }
.state-success  { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25); }
.state-success  .state-indicator { background: rgba(16,185,129,0.2); }
.state-success  svg { color: #34D399; }
.state-failed   { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); }
.state-failed   .state-indicator { background: rgba(239,68,68,0.2); }
.state-failed   svg { color: #FCA5A5; }
.state-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-bottom: var(--sp-2); }
.state-desc { font-size: var(--text-xs); color: var(--text-secondary); line-height: var(--leading-relaxed); }

/* ── Timeline FAQ ── */
.faq-section {
  padding-block: var(--sp-20);
  background: var(--bg-secondary);
}
.faq-list {
  max-width: 780px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color var(--ease-fast);
}
.faq-item.open { border-color: rgba(124,58,237,0.3); }
.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  cursor: pointer;
  background: none;
  text-align: left;
  transition: background var(--ease-fast);
}
.faq-trigger:hover { background: rgba(124,58,237,0.04); }
.faq-question { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-primary); }
.faq-chevron {
  width: 20px; height: 20px;
  color: var(--text-tertiary);
  transition: transform var(--ease-base);
  flex-shrink: 0;
}
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--color-primary); }
.faq-body {
  display: none;
  padding: 0 var(--sp-6) var(--sp-5);
}
.faq-body p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .process-timeline::before { display: none; }
  .process-step { grid-template-columns: 1fr; }
  .step-number-col { flex-direction: row; }
  .step-connector { display: none; }
  .states-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-row { gap: var(--sp-2); }
  .flow-node { min-width: 100px; }
}
@media (max-width: 480px) {
  .states-grid { grid-template-columns: 1fr; }
}
