/* process.css */

/* ── HERO ── */
.proc-hero { background: var(--navy, #081F4D); }
.proc-accent { color: var(--accent, #00AEEF); }

.proc-hero-sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  color: var(--text-muted, #AFC0D9);
  line-height: 1.8;
  max-width: 540px;
  margin-top: 1rem;
}

.proc-tag {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #00AEEF);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.8rem;
}

/* ── TIMELINE ── */
.proc-timeline-section {
  background: #F4F8FB;
  padding: clamp(4rem, 8vh, 7rem) clamp(2rem, 7vw, 7rem);
}

.proc-timeline-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.proc-timeline-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(3rem, 7vh, 6rem);
}

.proc-timeline-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 800;
  color: var(--navy, #081F4D);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.proc-timeline-sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  color: #4A5568;
  line-height: 1.7;
}

/* Steps grid */
.proc-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  padding-top: 60px;
}

.proc-line {
  position: absolute;
  top: 60px;
  left: calc(100% / 12);
  right: calc(100% / 12);
  height: 2px;
  background: #C8D9F2;
  transform: translateY(-50%);
  z-index: 0;
}

.proc-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--navy, #081F4D), var(--accent, #00AEEF));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.proc-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 8px;
  position: relative;
  z-index: 1;
  opacity: 0.3;
  transition: opacity 0.5s ease;
  cursor: default;
}

.proc-step.is-active { opacity: 1; }

.proc-step-node {
  position: relative;
  margin-bottom: 20px;
}

.proc-step-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #C8D9F2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  box-shadow: 0 2px 8px rgba(8, 31, 77, 0.08);
}

.proc-step-circle svg {
  width: 22px;
  height: 22px;
  color: #A6CAE1;
  transition: color 0.4s ease;
}

.proc-step.is-active .proc-step-circle {
  background: var(--navy, #081F4D);
  border-color: var(--navy, #081F4D);
  box-shadow:
    0 0 0 6px rgba(8, 31, 77, 0.08),
    0 4px 16px rgba(8, 31, 77, 0.2);
  transform: scale(1.08);
}

.proc-step.is-active .proc-step-circle svg {
  color: #FFFFFF;
}

.proc-step-num {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #A6CAE1;
  color: var(--navy, #081F4D);
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease;
}

.proc-step.is-active .proc-step-num {
  background: var(--accent, #00AEEF);
  color: #FFFFFF;
}

.proc-step-content {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.proc-step.is-active .proc-step-content {
  opacity: 1;
  transform: translateY(0);
}

.proc-step-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  font-weight: 700;
  color: var(--navy, #081F4D);
  line-height: 1.2;
  margin-bottom: 10px;
  /* All title blocks share identical height so the accent line lands on the same Y */
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 3.5rem;
}

.proc-step-title::after {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--accent, #00AEEF);
  background-clip: content-box;
  border-radius: 1px;
  opacity: 0.5;
  margin-top: auto;
  padding-top: 7px;
  box-sizing: content-box;
  flex-shrink: 0;
  transition: opacity 0.4s ease 0.3s, width 0.4s ease 0.3s;
}

.proc-step.is-active .proc-step-title::after {
  opacity: 1;
  width: 24px;
}

.proc-step-desc {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.7rem, 0.8vw, 0.8rem);
  color: #4A5568;
  line-height: 1.6;
}


/* ── DOCUMENTACIÓN ── */
.proc-docs-section {
  background: #FFFFFF;
  padding: clamp(4rem, 9vh, 8rem) clamp(2rem, 7vw, 7rem);
  border-top: 1px solid #C8D9F2;
}

.proc-docs-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vh, 4rem);
}

.proc-docs-header { max-width: 680px; }

.proc-docs-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 800;
  color: var(--navy, #081F4D);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.proc-docs-sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.88rem, 1vw, 0.98rem);
  color: #4A5568;
  line-height: 1.8;
}

.proc-docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #C8D9F2;
  border: 1px solid #C8D9F2;
  border-radius: 12px;
  overflow: hidden;
}

.proc-doc-group {
  background: #FFFFFF;
  /* layout handled per face / breakpoint */
}

/* ── FLIP CARD — DESKTOP ── */
@media (min-width: 769px) {

  /*
   * overflow:hidden on an ancestor can flatten preserve-3d in Chrome/Safari.
   * We remove it from the grid and replicate rounded corners on the card faces.
   */
  .proc-docs-grid {
    overflow: visible;
  }

  .proc-doc-group {
    background: transparent;
    min-height: 380px;
    position: relative;
  }

  /* Restore outer rounded corners now that grid overflow is visible */
  .proc-doc-group:first-child .proc-doc-card-front,
  .proc-doc-group:first-child .proc-doc-card-back {
    border-radius: 11px 0 0 11px;
  }

  .proc-doc-group:last-child .proc-doc-card-front,
  .proc-doc-group:last-child .proc-doc-card-back {
    border-radius: 0 11px 11px 0;
  }

  /*
   * Half-flip approach: each face rotates only ±90° (edge-on = naturally invisible).
   * No backface-visibility needed — faces never overlap when fully face-on.
   */
  .proc-doc-card-inner {
    position: relative;
    width: 100%;
    min-height: 380px;
    cursor: pointer;
  }

  .proc-doc-card-front,
  .proc-doc-card-back {
    position: absolute;
    inset: 0;
    padding: clamp(1.6rem, 2.5vw, 2.2rem);
  }

  /* ─ FRENTE: starts visible, rotates to -90° on hover ─ */
  .proc-doc-card-front {
    background: var(--navy-dark, #050F2B);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform: perspective(1100px) rotateY(0deg);
    transition:
      transform 0.32s cubic-bezier(0.4, 0, 1, 1),
      opacity   0.32s ease;
    opacity: 1;
    z-index: 2;
  }

  .proc-doc-group:hover .proc-doc-card-front {
    transform: perspective(1100px) rotateY(-90deg);
    opacity: 0;
  }

  .proc-doc-card-front::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(0,174,239,0.14) 0%, transparent 68%);
    pointer-events: none;
  }

  .proc-doc-front-bg-num {
    position: absolute;
    bottom: -0.5rem;
    right: 1rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(5rem, 9vw, 8rem);
    font-weight: 800;
    color: rgba(255,255,255,0.04);
    line-height: 1;
    pointer-events: none;
    user-select: none;
  }

  .proc-doc-front-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
  }

  .proc-doc-front-num {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent, #00AEEF);
    text-transform: uppercase;
  }

  .proc-doc-front-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.15;
  }

  .proc-doc-front-rule {
    display: block;
    width: 24px;
    height: 1px;
    background: rgba(0,174,239,0.5);
    margin: 0.2rem auto;
  }

  .proc-doc-front-hint {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(0,174,239,0.7);
    margin-top: 0.3rem;
  }

  /* ─ REVERSO: starts hidden at 90°, rotates to 0° on hover ─ */
  .proc-doc-card-back {
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transform: perspective(1100px) rotateY(90deg);
    opacity: 0;
    transition:
      transform 0.32s cubic-bezier(0, 0, 0.6, 1) 0.28s,
      opacity   0s linear 0.28s;
    z-index: 1;
  }

  .proc-doc-group:hover .proc-doc-card-back {
    transform: perspective(1100px) rotateY(0deg);
    opacity: 1;
  }
}

/* ── FLIP CARD — MOBILE RESET ── */
@media (max-width: 768px) {
  .proc-doc-card-front { display: none; }
  .proc-doc-card-inner { display: block; }
  .proc-doc-card-back {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: clamp(1.5rem, 5vw, 2rem);
    background: #FFFFFF;
  }
}

.proc-doc-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--navy, #081F4D);
}

.proc-doc-group-num {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #00AEEF);
  letter-spacing: 0.1em;
}

.proc-doc-group-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  font-weight: 700;
  color: var(--navy, #081F4D);
  line-height: 1.2;
}

.proc-doc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.proc-doc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F4F8FB;
  transition: background 0.2s ease;
}

.proc-doc-item:last-child { border-bottom: none; }

.proc-doc-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 174, 239, 0.08);
  border: 1px solid rgba(0, 174, 239, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #00AEEF);
  flex-shrink: 0;
  margin-top: 1px;
}

.proc-doc-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proc-doc-name {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.78rem, 0.9vw, 0.88rem);
  font-weight: 600;
  color: var(--navy, #081F4D);
  line-height: 1.3;
}

.proc-doc-detail {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.7rem, 0.78vw, 0.78rem);
  color: #8892A4;
  line-height: 1.5;
}

/* Nota informativa */
.proc-docs-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: clamp(1rem, 2.5vh, 1.5rem) clamp(1.2rem, 2.5vw, 1.8rem);
  background: rgba(0, 174, 239, 0.05);
  border: 1px solid rgba(0, 174, 239, 0.15);
  border-radius: 10px;
  border-left: 3px solid var(--accent, #00AEEF);
}

.proc-docs-note-icon {
  color: var(--accent, #00AEEF);
  flex-shrink: 0;
  margin-top: 2px;
}

.proc-docs-note-text {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.82rem, 0.95vw, 0.92rem);
  color: #4A5568;
  line-height: 1.7;
}

.proc-docs-note-text strong {
  color: var(--navy, #081F4D);
  font-weight: 600;
}

/* ── CTA FINAL ── */
.proc-cta-section {
  background: var(--navy-dark, #050F2B);
  padding: clamp(4rem, 9vh, 8rem) clamp(2rem, 7vw, 7rem);
  position: relative;
  overflow: hidden;
}

.proc-cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 60px,
    rgba(255, 255, 255, 0.015) 60px,
    rgba(255, 255, 255, 0.015) 61px
  );
  pointer-events: none;
}

.proc-cta-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(3rem, 6vw, 7rem);
  align-items: center;
}

.proc-cta-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.proc-cta-desc {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  color: var(--text-muted, #AFC0D9);
  line-height: 1.8;
  margin-bottom: 1.8rem;
}

.proc-cta-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proc-cta-step {
  display: flex;
  align-items: center;
  gap: 14px;
}

.proc-cta-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 174, 239, 0.12);
  border: 1px solid rgba(0, 174, 239, 0.25);
  color: var(--accent, #00AEEF);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.proc-cta-step-text {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(175, 192, 217, 0.8);
}

/* Card de acción */
.proc-cta-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: clamp(1.8rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proc-cta-card-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}

.proc-cta-card-sub {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-muted, #AFC0D9);
  line-height: 1.6;
}

.proc-cta-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, #00AEEF);
  color: var(--navy, #081F4D);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 15px 28px;
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all 0.3s ease;
}

.proc-cta-btn-primary:hover {
  background: var(--accent-light, #2CC4FF);
  transform: translateY(-1px);
}

.proc-cta-card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.proc-cta-card-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(175, 192, 217, 0.5);
}

.proc-cta-card-detail svg {
  color: var(--accent, #00AEEF);
  opacity: 0.6;
  flex-shrink: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .proc-docs-grid { grid-template-columns: 1fr; }
  .proc-cta-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ── TIMELINE VERTICAL MOBILE ── */
@media (max-width: 768px) {

  .proc-timeline-section {
    padding: clamp(3rem, 7vh, 5rem) clamp(1.2rem, 5vw, 2rem);
  }

  .proc-line { display: none; }

  .proc-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0;
    position: relative;
  }

  /* Línea vertical continua a la izquierda */
  .proc-steps::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #C8D9F2;
    z-index: 0;
  }

  /* Línea de progreso vertical (fill) */
  .proc-steps::after {
    content: '';
    position: absolute;
    left: 25px;
    top: 0;
    width: 2px;
    height: var(--proc-fill, 0%);
    background: linear-gradient(to bottom, var(--navy, #081F4D), var(--accent, #00AEEF));
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    border-radius: 2px;
  }

  .proc-step {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 0 16px;
    align-items: flex-start;
    text-align: left;
    padding: 0 0 clamp(1.6rem, 4vh, 2.4rem) 0;
    opacity: 1;
    position: relative;
    z-index: 1;
  }

  .proc-step:last-child { padding-bottom: 0; }

  .proc-step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 0;
    padding-top: 2px;
  }

  .proc-step-circle {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
  }

  /* Número badge: reposicionar sobre el círculo */
  .proc-step-num {
    top: -6px;
    right: -4px;
  }

  .proc-step-content {
    opacity: 1;
    transform: none;
    transition: none;
    padding-top: 6px;
  }

  .proc-step:not(.is-active) .proc-step-circle {
    background: #F4F8FB;
    border-color: #C8D9F2;
  }

  .proc-step:not(.is-active) .proc-step-circle svg {
    color: #C8D9F2;
  }

  .proc-step:not(.is-active) .proc-step-title {
    color: #AFC0D9;
  }

  .proc-step:not(.is-active) .proc-step-desc {
    color: #C8D9F2;
  }

  .proc-step.is-active .proc-step-circle {
    transform: scale(1.05);
  }

  .proc-step-title {
    font-size: clamp(1rem, 4vw, 1.15rem);
    margin-bottom: 6px;
    transition: color 0.4s ease;
    /* Reset flex layout — vertical stack doesn't need height normalization */
    display: block;
    min-height: unset;
  }

  .proc-step-desc {
    font-size: clamp(0.8rem, 3.5vw, 0.88rem);
    transition: color 0.4s ease;
  }

  .proc-step-title::after {
    display: block;
    margin-top: 7px;
    margin-left: 0;
    padding-top: 0;
  }

  .proc-cta-inner { gap: 2rem; }
  .proc-cta-title { font-size: clamp(2rem, 7vw, 3rem); }
}
