body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", Arial, sans-serif;
  background: linear-gradient(135deg, #4b79a1 0%, #283e51 100%);
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  width: min(840px, calc(100% - 32px));
  padding: 24px;
}

.card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
  padding: 32px;
}

.card-header {
  text-align: center;
  margin-bottom: 24px;
}

.card-header h1 {
  margin: 0;
  font-size: clamp(2rem, 2.5vw, 2.8rem);
  color: #111827;
}

.card-header p {
  margin: 12px auto 0;
  max-width: 620px;
  color: #4b5563;
  line-height: 1.6;
}

.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.file-label {
  display: inline-block;
  background: #3b82f6;
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.file-label:hover {
  transform: translateY(-1px);
  background: #2563eb;
}

#pdfFiles {
  display: none;
}

.file-list {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  min-height: 140px;
}

.file-list p.empty {
  margin: 0;
  color: #6b7280;
}

.range-area {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 12px;
}

.range-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.range-field label {
  font-weight: 600;
  color: #374151;
}

.range-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  font-size: 1rem;
}

.range-info {
  margin-bottom: 18px;
  color: #4b5563;
  font-size: 0.95rem;
}

.output-list {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
}

.output-list h3 {
  margin: 0 0 12px;
  color: #111827;
}

.output-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

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

.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  margin-bottom: 10px;
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-name {
  font-weight: 600;
  color: #111827;
}

.remove-file {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.remove-file:hover {
  background: #f3f4f6;
  color: #111827;
}

.file-size {
  color: #6b7280;
  font-size: 0.95rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

button {
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

#mergeBtn {
  background: #10b981;
  color: #ffffff;
}

#downloadBtn {
  background: #1d4ed8;
  color: #ffffff;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin-top: 18px;
  text-align: center;
  font-weight: 600;
}

.status.success {
  color: #15803d;
}

.status.error {
  color: #b91c1c;
}

@media (max-width: 640px) {
  .card {
    padding: 22px;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

/* Estilos para el overlay del caballo */
.caballo-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 1000;
}

.caballo-image {
  width: 70%;
  height: 100%;
  object-fit: cover;
  object-position: center left;
}

.cerrar-caballo {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.cerrar-caballo:hover {
  background: rgba(255, 255, 255, 1);
}

/* Frase para unir PDF */
.unir-pdf-link {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 1001;
}

.unir-pdf-link span {
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
  color: #0066cc;
  text-shadow: 
    0 0 5px #0066cc,
    0 0 10px #0066cc,
    0 0 15px #0066cc,
    0 0 20px #0066cc;
  display: inline-block;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 20px;
  border-radius: 10px;
  border: 3px solid #0066cc;
  transition: all 0.3s ease;
}

.unir-pdf-link span:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
  text-shadow: 
    0 0 10px #0066cc,
    0 0 20px #0066cc,
    0 0 30px #0066cc,
    0 0 40px #0066cc;
}

}

@media (max-width: 768px) {
  .unir-pdf-link {
    right: 20px;
  }
  
  .unir-pdf-link span {
    font-size: 18px;
    padding: 10px 15px;
  }
}
