/* sections/03_como_funciona.css */

/* =========================
   03 COMO FUNCIONA
========================= */

.live-demo-section {
  width: 100%;
  max-width: none;
  padding: 110px 54px;
}

.live-demo-copy {
  max-width: 860px;
  margin-bottom: 44px;
}

.live-demo-copy p {
  max-width: 780px;
  margin-top: 16px;
  font-size: 1.02rem;
  line-height: 1.28;
}

.live-demo-panel {
  width: 100%;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

/* STEPS */

.live-demo-steps {
  display: grid;
  grid-template-columns: 1fr 80px 1fr 80px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 32px;
}

.live-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  opacity: .45;
}

.live-step span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e7eff6;
  color: #5a7790;
  font-weight: 800;
}

.live-step.is-active,
.live-step.is-done {
  opacity: 1;
  color: var(--heading);
}

.live-step.is-active span {
  background: var(--accent);
  color: white;
}

.live-step.is-done span {
  background: var(--green);
  color: white;
}

.live-step-line {
  height: 2px;
  border-radius: 999px;
  background: #dbe6ee;
}

/* GRID */

.live-demo-grid {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 28px;
  align-items: stretch;
}

/* CARDS */

.live-upload-card,
.live-preview-card {
  position: relative;
  overflow: hidden;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #f8fbfd;
}

.live-upload-card {
  padding: 22px;
}

.live-preview-card {
  padding: 22px;
  background: #eef4f8;
}

/* DRAG FILE */

.drag-file {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 24px 18px;
  border: 1px solid #dfeaf2;
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: grab;
  user-select: none;
  animation: fileInvite 1.5s ease-in-out infinite;
  transition:
    transform .22s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    opacity .22s ease;
}

.drag-file:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 47, 31, .5);
  box-shadow: 0 14px 28px rgba(54, 95, 130, .08);
}

.drag-file:active {
  cursor: grabbing;
  transform: scale(.98);
}

.drag-file i {
  color: #18a85a;
  font-size: 2.1rem;
}

.drag-file span {
  color: var(--heading);
  font-size: .96rem;
  font-weight: 800;
}

.drag-file small {
  color: var(--muted);
  font-size: .78rem;
}

/* EDIT BUTTON */

.edit-content-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(54, 95, 130, .18);
  transition:
    transform .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

.edit-content-btn i {
  color: #ffffff;
  font-size: .95rem;
}

.edit-content-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 28px rgba(54, 95, 130, .24);
}

.edit-content-btn:active {
  transform: scale(.96);
}

/* DRAG ARROW */

.drag-arrow {
  display: grid;
  place-items: center;
  margin: 0 0 12px;
  color: #ff2f1f;
  font-size: 2.05rem;
  animation: arrowPulse 1.1s ease-in-out infinite;
}

/* DROPZONE */

.upload-dropzone {
  position: relative;
  min-height: 170px;
  display: grid;
  place-items: center;
  padding: 20px;
  border: 1.5px dashed #b8cad9;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdff, #f1f6fa);
  transition:
    border-color .25s ease,
    background .25s ease,
    box-shadow .25s ease,
    transform .25s ease;
}

.upload-dropzone.is-drag-over {
  border-color: #ff2f1f;
  background: rgba(255, 47, 31, .07);
  box-shadow:
    0 0 0 8px rgba(255, 47, 31, .16),
    0 0 22px rgba(255, 47, 31, .18);
  transform: translateY(-1px);
}

.drop-target {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  min-height: 110px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .66);
  text-align: center;
  transition:
    background .25s ease,
    transform .25s ease;
}

.upload-dropzone.is-drag-over .drop-target {
  background: #ffffff;
  transform: scale(1.015);
}

.drop-target i {
  color: var(--accent);
  font-size: 1.8rem;
}

.upload-dropzone.is-drag-over .drop-target i {
  color: #ff2f1f;
}

.drop-target strong {
  color: var(--heading);
  font-size: .96rem;
}

.drop-target span {
  color: var(--muted);
  font-size: .82rem;
}

/* FILE LOADED */

.live-upload-card.is-file-loaded .drag-file {
  animation: none;
  opacity: .45;
}

.live-upload-card.is-file-loaded .drag-arrow {
  display: none;
}

.live-upload-card.is-file-loaded .upload-dropzone {
  border-color: var(--green);
  background: rgba(35, 178, 109, .06);
  box-shadow: 0 0 0 6px rgba(35, 178, 109, .06);
}

.live-upload-card.is-file-loaded .drop-target i {
  color: var(--green);
}

.live-upload-card.is-file-loaded .drop-target strong {
  font-size: 0;
}

.live-upload-card.is-file-loaded .drop-target strong::before {
  content: "Archivo cargado correctamente";
  color: var(--green);
  font-size: .96rem;
}

/* SEND BUTTON */

.send-data-btn {
  width: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #ffffff;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    background .25s ease,
    transform .2s ease,
    box-shadow .25s ease;
}

.send-data-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(54, 95, 130, .16);
}

.live-upload-card.is-file-loaded .send-data-btn {
  display: flex;
  animation: sendPulse 1.25s ease-in-out infinite;
}

.live-upload-card.is-sent .send-data-btn {
  background: var(--green);
  animation: none;
}

/* PROCESSING */

.processing-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e3ecf3;
  border-radius: var(--radius-md);
  background: #ffffff;
  opacity: .45;
  transition:
    opacity .35s ease,
    border-color .35s ease,
    background .35s ease;
}

.processing-orb {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #eef4f8;
  color: var(--accent);
}

.processing-box strong {
  display: block;
  color: var(--heading);
  font-size: .92rem;
}

.processing-box span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.2;
}

.live-upload-card.is-processing .processing-box,
.live-upload-card.is-sent .processing-box {
  opacity: 1;
  border-color: rgba(54, 95, 130, .22);
  background: #ffffff;
}

.live-upload-card.is-processing .processing-orb i {
  animation: spinSoft 1.8s linear infinite;
}

.live-upload-card.is-sent .processing-orb {
  background: rgba(35, 178, 109, .10);
  color: var(--green);
}

/* PREVIEW EMPTY */

.preview-empty {
  position: absolute;
  inset: 22px;
  display: grid;
  place-items: center;
  padding: 34px;
  border: 1.5px dashed #b6c8d8;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfdff, #f5f9fc);
  text-align: center;
  color: #7890a5;
  transition:
    opacity .35s ease,
    transform .35s ease;
}

.preview-empty i {
  margin-bottom: 16px;
  color: #ff4930;
  font-size: 2.8rem;
}

.preview-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--heading);
}

.preview-empty span {
  display: block;
  max-width: 340px;
  font-size: .9rem;
  line-height: 1.25;
}

/* FILES WAITING PANEL */

.files-waiting-panel {
  width: 100%;
  height: 100%;
  padding: 26px;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.files-waiting-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.files-waiting-header i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(54, 95, 130, .10);
  color: var(--accent);
  font-size: 1.1rem;
}

.files-waiting-header strong {
  display: block;
  color: var(--heading);
  font-size: 1rem;
}

.files-waiting-header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
  word-break: break-all;
}

.generated-files-grid {
  display: grid;
  gap: 14px;
}

.generated-file-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #dfeaf2;
  border-radius: var(--radius-md);
  background: #f8fbfd;
}

.generated-file-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef4f8;
  color: var(--accent);
  font-size: 1.15rem;
}

.generated-file-copy strong {
  display: block;
  color: var(--heading);
  font-size: .95rem;
}

.generated-file-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .82rem;
}

.generated-file-action {
  color: var(--accent);
  font-size: 1rem;
}

.generated-file-card.is-processing {
  border-color: rgba(54, 95, 130, .28);
}

.generated-file-card.is-completed {
  border-color: rgba(35, 178, 109, .35);
  background: rgba(35, 178, 109, .06);
}

.generated-file-card.is-completed .generated-file-icon {
  background: rgba(35, 178, 109, .12);
  color: var(--green);
}

.generated-file-card.is-completed .generated-file-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.generated-file-card.is-error {
  border-color: rgba(255, 47, 31, .35);
  background: rgba(255, 47, 31, .05);
}

.generated-file-card.is-error .generated-file-icon,
.generated-file-card.is-error .generated-file-action {
  color: #ff2f1f;
}

/* MINI REPORT */

.mini-report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.mini-report-summary div {
  padding: 14px;
  border: 1px solid #dfeaf2;
  border-radius: var(--radius-md);
  background: #f8fbfd;
}

.mini-report-summary strong {
  display: block;
  color: var(--heading);
  font-size: 1rem;
}

.mini-report-summary span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .72rem;
}

.mini-report-chart {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid #dfeaf2;
  border-radius: var(--radius-md);
  background: #ffffff;
}

/* ANIMATIONS */

@keyframes fileInvite {
  0%, 100% {
    border-color: #dfeaf2;
    box-shadow: 0 0 0 0 rgba(255, 47, 31, 0);
  }

  50% {
    border-color: #ff2f1f;
    box-shadow:
      0 0 0 8px rgba(255, 47, 31, .22),
      0 0 22px rgba(255, 47, 31, .26);
  }
}

@keyframes arrowPulse {
  0%, 100% {
    transform: translateY(0);
    opacity: .65;
  }

  50% {
    transform: translateY(10px);
    opacity: 1;
    text-shadow: 0 0 18px rgba(255, 47, 31, .45);
  }
}

@keyframes sendPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 47, 31, 0);
    outline: 0 solid rgba(255, 47, 31, 0);
  }

  50% {
    box-shadow:
      0 0 0 9px rgba(255, 47, 31, .22),
      0 0 24px rgba(255, 47, 31, .28);
    outline: 2px solid rgba(255, 47, 31, .65);
  }
}

@keyframes spinSoft {
  to {
    transform: rotate(360deg);
  }
}

/* RESPONSIVE */

@media (max-width: 980px) {

  .live-demo-section {
    padding: 88px 22px;
  }

  .live-demo-panel {
    padding: 22px;
  }

  .live-demo-steps {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .live-step-line {
    display: none;
  }

  .live-demo-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {

  .live-demo-panel {
    padding: 16px;
  }

  .live-upload-card,
  .live-preview-card {
    min-height: auto;
  }

  .preview-empty {
    position: relative;
    inset: auto;
    min-height: 260px;
  }

  .mini-report-summary {
    grid-template-columns: 1fr 1fr;
  }

  .generated-file-card {
    grid-template-columns: 42px 1fr;
  }

  .generated-file-action {
    grid-column: 1 / -1;
  }

}